Skip to content

Commit

Permalink
add logic for query freq and make parsing in process more explicit (#611
Browse files Browse the repository at this point in the history
)
  • Loading branch information
jtmims authored Jul 10, 2024
1 parent 64f5d2c commit 6236f21
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/preprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -905,9 +905,11 @@ def query_catalog(self,
for case_name, case_d in case_dict.items():
# path_regex = re.compile(r'(?i)(?<!\\S){}(?!\\S+)'.format(case_name))
path_regex = re.compile(r'({})'.format(case_name))
# path_regex = '*' + case_name + '*'
freq = case_d.varlist.T.frequency.format_local()

# path_regex = '*' + case_name + '*'
freq = case_d.varlist.T.frequency
if not isinstance(freq, str):
freq = freq.format_local()

for var in case_d.varlist.iter_vars():
realm_regex = var.realm + '*'
date_range = var.translation.T.range
Expand Down Expand Up @@ -1295,8 +1297,8 @@ def process(self,
for v in case_list[case_name].varlist.iter_vars():
tv_name = v.translation.name
var_xr_dataset = self.parse_ds(v, case_xr_dataset)
cat_subset[case_name]['time'] = var_xr_dataset['time']
cat_subset[case_name].update({tv_name: var_xr_dataset[tv_name]})
for v_d in var_xr_dataset.variables:
cat_subset[case_name][v_d] = var_xr_dataset[v_d]
pp_func_dataset = self.execute_pp_functions(v,
cat_subset[case_name],
work_dir=model_work_dir[case_name],
Expand Down

0 comments on commit 6236f21

Please sign in to comment.