Skip to content

Commit 50a97d1

Browse files
committed
fix defaults so can dry run
1 parent c1196d7 commit 50a97d1

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

workflow/Snakefile

+6-5
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import logging
2121
from dbetto import AttrsDict
2222
from legendmeta import LegendMetadata
2323
from legenddataflow import CalGrouping, execenv, utils
24+
from legenddataflow.patterns import get_pattern_tier
2425

2526
utils.subst_vars_in_snakemake_config(workflow, config)
2627
config = AttrsDict(config)
@@ -89,7 +90,7 @@ onstart:
8990
hit_par_cat_file.unlink()
9091
try:
9192
Path(hit_par_cat_file).parent.mkdir(parents=True, exist_ok=True)
92-
ParsKeyResolve.write_to_yaml(hit_par_catalog, hit_par_cat_file)
93+
hit_par_catalog.write_to(hit_par_cat_file)
9394
except NameError:
9495
print("No hit parameter catalog found")
9596

@@ -98,7 +99,7 @@ onstart:
9899
pht_par_cat_file.unlink()
99100
try:
100101
Path(pht_par_cat_file).parent.mkdir(parents=True, exist_ok=True)
101-
ParsKeyResolve.write_to_yaml(pht_par_catalog, pht_par_cat_file)
102+
pht_par_catalog.write_to(pht_par_cat_file)
102103
except NameError:
103104
print("No pht parameter catalog found")
104105

@@ -107,7 +108,7 @@ onstart:
107108
dsp_par_cat_file.unlink()
108109
try:
109110
Path(dsp_par_cat_file).parent.mkdir(parents=True, exist_ok=True)
110-
ParsKeyResolve.write_to_yaml(dsp_par_catalog, dsp_par_cat_file)
111+
dsp_par_catalog.write_to(dsp_par_cat_file)
111112
except NameError:
112113
print("No dsp parameter catalog found")
113114

@@ -116,7 +117,7 @@ onstart:
116117
psp_par_cat_file.unlink()
117118
try:
118119
Path(psp_par_cat_file).parent.mkdir(parents=True, exist_ok=True)
119-
ParsKeyResolve.write_to_yaml(psp_par_catalog, psp_par_cat_file)
120+
psp_par_catalog.write_to(psp_par_cat_file)
120121
except NameError:
121122
print("No psp parameter catalog found")
122123

@@ -165,7 +166,7 @@ rule gen_filelist:
165166
lambda wildcards: get_filelist(
166167
wildcards,
167168
config,
168-
get_search_pattern(wildcards.tier),
169+
get_pattern_tier(config, "raw", check_in_cycle=False),
169170
ignore_keys_file=Path(det_status) / "ignored_daq_cycles.yaml",
170171
analysis_runs_file=Path(det_status) / "runlists.yaml",
171172
),

workflow/Snakefile-build-raw

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ onstart:
6161
raw_par_cat_file.unlink()
6262
try:
6363
Path(raw_par_cat_file).parent.mkdir(parents=True, exist_ok=True)
64-
ParsKeyResolve.write_to_yaml(raw_par_catalog, raw_par_cat_file)
64+
raw_par_catalog.write_to(raw_par_cat_file)
6565
except NameError:
6666
print("WARNING: no raw parameter catalog found")
6767

workflow/src/legenddataflow/cal_grouping.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def get_timestamp(
186186
fk = ChannelProcKey.get_filekey_from_pattern(Path(par_files[0]).name)
187187
return fk.timestamp
188188
else:
189-
return "20200101T000000Z"
189+
return "20240101T000000Z"
190190

191191
def get_wildcard_constraints(self, dataset, channel):
192192
if channel == "default":

workflow/src/legenddataflow/create_pars_keylist.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ def get_keys(keypart, search_pattern):
9696
keys.append(key)
9797
return keys
9898

99-
@staticmethod
100-
def get_par_catalog(keypart, search_patterns, name_dict):
99+
@classmethod
100+
def get_par_catalog(cls, keypart, search_patterns, name_dict):
101101
if isinstance(keypart, str):
102102
keypart = [keypart]
103103
if isinstance(search_patterns, (str, Path)):
@@ -113,5 +113,6 @@ def get_par_catalog(keypart, search_patterns, name_dict):
113113
else:
114114
msg = "No Keys found"
115115
warnings.warn(msg, stacklevel=0)
116-
entrylist = [ParsKeyResolve("00000000T000000Z", "all", [])]
116+
fk = FileKey("l200", "p00", "r000", "cal", "20230101T000000Z")
117+
entrylist = [ParsKeyResolve.entry_from_filekey(fk, name_dict)]
117118
return Catalog({"all": entrylist})

0 commit comments

Comments
 (0)