Skip to content

Commit

Permalink
Change ERROR to WARNING
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-richling committed Aug 7, 2024
1 parent 3085b79 commit 7b844bc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/adf_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def load_regrid_dataset(self, case, field):
"""Return a data set to be used as reference (aka baseline) for variable field."""
fils = self.get_regrid_file(case, field)
if not fils:
warnings.warn(f"ERROR: Did not find regrid file(s) for case: {case}, variable: {field}")
warnings.warn(f"WARNING: Did not find regrid file(s) for case: {case}, variable: {field}")
return None
return self.load_dataset(fils)

Expand All @@ -215,7 +215,7 @@ def load_regrid_da(self, case, field):
add_offset, scale_factor = self.get_value_converters(case, field)
fils = self.get_regrid_file(case, field)
if not fils:
warnings.warn(f"ERROR: Did not find regrid file(s) for case: {case}, variable: {field}")
warnings.warn(f"WARNING: Did not find regrid file(s) for case: {case}, variable: {field}")
return None
return self.load_da(fils, field, add_offset=add_offset, scale_factor=scale_factor)

Expand All @@ -239,7 +239,7 @@ def load_reference_regrid_dataset(self, case, field):
"""Return a data set to be used as reference (aka baseline) for variable field."""
fils = self.get_ref_regrid_file(case, field)
if not fils:
warnings.warn(f"ERROR: Did not find regridded file(s) for case: {case}, variable: {field}")
warnings.warn(f"WARNING: Did not find regridded file(s) for case: {case}, variable: {field}")
return None
return self.load_dataset(fils)

Expand All @@ -249,7 +249,7 @@ def load_reference_regrid_da(self, case, field):
add_offset, scale_factor = self.get_value_converters(case, field)
fils = self.get_ref_regrid_file(case, field)
if not fils:
warnings.warn(f"ERROR: Did not find regridded file(s) for case: {case}, variable: {field}")
warnings.warn(f"WARNING: Did not find regridded file(s) for case: {case}, variable: {field}")
return None
#Change the variable name from CAM standard to what is
# listed in variable defaults for this observation field
Expand Down Expand Up @@ -286,7 +286,7 @@ def load_da(self, fils, variablename, **kwargs):
"""Return xarray DataArray from files(s) w/ optional scale factor, offset, and/or new units"""
ds = self.load_dataset(fils)
if ds is None:
warnings.warn(f"ERROR: Load failed for {variablename}")
warnings.warn(f"WARNING: Load failed for {variablename}")
return None
da = (ds[variablename]).squeeze()
scale_factor = kwargs.get('scale_factor', 1)
Expand Down

0 comments on commit 7b844bc

Please sign in to comment.