Skip to content

Commit c3e66b3

Browse files
committed
change to normpath so resolve relative paths but don't resolve synmlinks which is needed for running unblinded data
1 parent 31aa878 commit c3e66b3

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

scripts/util/patterns.py

+2-9
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"""
44

55
import os
6-
import pathlib
76

87
from .utils import (
98
par_dsp_path,
@@ -230,10 +229,7 @@ def get_pattern_tier(setup, tier, check_in_cycle=True):
230229
else:
231230
msg = "invalid tier"
232231
raise Exception(msg)
233-
if (
234-
tier_path(setup) not in str(pathlib.Path(file_pattern).resolve())
235-
and check_in_cycle is True
236-
):
232+
if tier_path(setup) not in os.path.normpath(file_pattern) and check_in_cycle is True:
237233
return "/tmp/{experiment}-{period}-{run}-{datatype}-{timestamp}-" + f"tier_{tier}.lh5"
238234
else:
239235
return file_pattern
@@ -411,10 +407,7 @@ def get_pattern_pars(setup, tier, name=None, extension="json", check_in_cycle=Tr
411407
else:
412408
msg = "invalid tier"
413409
raise Exception(msg)
414-
if (
415-
pars_path(setup) not in str(pathlib.Path(file_pattern).resolve())
416-
and check_in_cycle is True
417-
):
410+
if pars_path(setup) not in os.path.normpath(file_pattern) and check_in_cycle is True:
418411
if name is None:
419412
return "/tmp/{experiment}-{period}-{run}-cal-{timestamp}-" + f"par_{tier}.{extension}"
420413
else:

0 commit comments

Comments
 (0)