Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add exception list of vars to prevent overwriting in preprocessor #613

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/preprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1297,14 +1297,16 @@ 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)
varlist_ex = [v_l.translation.name for v_l in case_list[case_name].varlist.iter_vars()]
varlist_ex.remove(tv_name)
for v_d in var_xr_dataset.variables:
cat_subset[case_name][v_d] = var_xr_dataset[v_d]
if v_d not in varlist_ex:
cat_subset[case_name].update({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],
case_name=case_name)
cat_subset[case_name] = pp_func_dataset

return cat_subset

def write_pp_catalog(self,
Expand Down
Loading