From 635c24635b2b263f826310e14bde6d8918c13e4d Mon Sep 17 00:00:00 2001 From: Jacob Mims <122570226+jtmims@users.noreply.github.com> Date: Wed, 10 Jul 2024 19:31:39 -0500 Subject: [PATCH] add exception list of vars to prevent overwriting in preprocessor (#613) --- src/preprocessor.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/preprocessor.py b/src/preprocessor.py index 24ea90d82..3c05ce305 100644 --- a/src/preprocessor.py +++ b/src/preprocessor.py @@ -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,