From 1cdccf615c8f6e1b4a2747882f28772931b6af4f Mon Sep 17 00:00:00 2001 From: justin-richling <56696811+justin-richling@users.noreply.github.com> Date: Fri, 3 Apr 2026 10:48:51 -0600 Subject: [PATCH] Fix `None` for `fils` in `load_reference_climo_da` --- lib/adf_dataset.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/adf_dataset.py b/lib/adf_dataset.py index 2cb326cb0..9de88a0d7 100644 --- a/lib/adf_dataset.py +++ b/lib/adf_dataset.py @@ -199,7 +199,8 @@ def get_climo_file(self, case, variablename): a = self.adf.get_cam_info("cam_climo_loc", required=True) # list of paths (could be multiple cases) caseindex = (self.case_names).index(case) # the entry for specified case model_cl_loc = Path(a[caseindex]) - return sorted(model_cl_loc.glob(f"{case}_{variablename}_climo.nc")) + fils = sorted(model_cl_loc.glob(f"{case}_{variablename}_climo.nc")) + return fils # Reference case (baseline/obs) @@ -213,13 +214,11 @@ def get_reference_climo_file(self, var): """Return a list of files to be used as reference (aka baseline) for variable var.""" if self.adf.compare_obs: fils = self.ref_var_loc.get(var, None) - return [fils] if fils is not None else None + return [fils] if fils is not None else [] ref_loc = self.adf.get_baseline_info("cam_climo_loc") # NOTE: originally had this looking for *_baseline.nc fils = sorted(Path(ref_loc).glob(f"{self.ref_case_label}_{var}_climo.nc")) - if fils: - return fils - return None + return fils #------------------ @@ -363,4 +362,4 @@ def get_value_converters(self, case, variablename): - \ No newline at end of file +