diff --git a/src/data_sources.py b/src/data_sources.py index 81b78fb0d..a8db76c1e 100644 --- a/src/data_sources.py +++ b/src/data_sources.py @@ -65,7 +65,7 @@ def read_varlist(self, parent, append_vars: bool=False): def set_date_range(self, startdate: str, enddate: str): self.date_range = util.DateRange(start=startdate, end=enddate) - def set_query_base(self, var: varlist_util.VarlistEntry, path_regex: str): + def set_query(self, var: varlist_util.VarlistEntry, path_regex: str): realm_regex = var.realm + '*' date_range = var.T.range var_id = var.name @@ -126,7 +126,8 @@ class CMIPDataSource(DataSourceBase): convention: str = "CMIP" def set_query(self, var: varlist_util.VarlistEntry, path_regex: str): - self.set_query_base(var, path_regex) + super().set_query(var, path_regex) + return @data_source.maker class CESMDataSource(DataSourceBase): @@ -139,7 +140,8 @@ class CESMDataSource(DataSourceBase): convention: str = "CESM" def set_query(self, var: varlist_util.VarlistEntry, path_regex: str): - self.set_query_base(var, path_regex) + super().set_query(var, path_regex) + return @data_source.maker class GFDLDataSource(DataSourceBase): @@ -152,7 +154,8 @@ class GFDLDataSource(DataSourceBase): convention: str = "GFDL" def set_query(self, var: varlist_util.VarlistEntry, path_regex: str): - self.set_query_base(var, path_regex) + super().set_query(var, path_regex) # this is hacky, but prevents the framework from grabbing from ice_1x1deg if self.query['realm'] == 'seaIce*': self.query['realm'] = 'ice' + return diff --git a/src/preprocessor.py b/src/preprocessor.py index 8495c4486..ce8281e38 100644 --- a/src/preprocessor.py +++ b/src/preprocessor.py @@ -97,7 +97,7 @@ def execute(self, var: varlist_util.VarlistEntry, pass -class PercentTo01Function(PreprocessorFunctionBase): +class PercentConversionFunction(PreprocessorFunctionBase): """A PreprocessorFunction which convers the dependent variable's units and values, for the specific case of percentages. ``0-1`` are not defined in the UDUNITS-2 library. So, this function handles the case where we have to convert from @@ -724,7 +724,7 @@ def _functions(self): """ # normal operation: run all functions return [ - AssociatedVariablesFunction, PercentTo01Function, + AssociatedVariablesFunction, PercentConversionFunction, PrecipRateToFluxFunction, ConvertUnitsFunction, ExtractLevelFunction, RenameVariablesFunction ]