From 3e27d85d50c2eded6859193e1ab08d9336f81244 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Thu, 18 May 2023 10:05:53 -0300 Subject: [PATCH] minor fixes, left over from #1026 --- compliance_checker/acdd.py | 4 ++-- compliance_checker/cf/cf_1_6.py | 4 ++-- compliance_checker/cf/cf_1_7.py | 2 -- compliance_checker/cf/cf_1_9.py | 2 -- compliance_checker/cf/cf_base.py | 2 +- 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/compliance_checker/acdd.py b/compliance_checker/acdd.py index 603b4156..6502f45d 100644 --- a/compliance_checker/acdd.py +++ b/compliance_checker/acdd.py @@ -256,7 +256,7 @@ def check_lat_extents(self, ds): # identify lat var(s) as per CF 4.1 lat_vars = {} # var -> number of criteria passed - for _name, var in ds.variables.items(): + for var in ds.variables.values(): # must have units if not hasattr(var, "units"): continue @@ -354,7 +354,7 @@ def check_lon_extents(self, ds): # identify lon var(s) as per CF 4.2 lon_vars = {} # var -> number of criteria passed - for _name, var in ds.variables.items(): + for var in ds.variables.values(): # must have units if not hasattr(var, "units"): continue diff --git a/compliance_checker/cf/cf_1_6.py b/compliance_checker/cf/cf_1_6.py index 4519f2fb..57eb6532 100644 --- a/compliance_checker/cf/cf_1_6.py +++ b/compliance_checker/cf/cf_1_6.py @@ -416,7 +416,7 @@ def check_fill_value_equal_missing_value(self, ds): fails = [] total = 0 - for _name, variable in ds.variables.items(): + for variable in ds.variables.values(): # If the variable have a defined _FillValue a defined missing_value check it. if hasattr(variable, "_FillValue") and hasattr(variable, "missing_value"): @@ -447,7 +447,7 @@ def check_valid_range_or_valid_min_max_present(self, ds): fails = [] total = 0 - for _name, variable in ds.variables.items(): + for variable in ds.variables.values(): if hasattr(variable, "valid_max") and ( hasattr(variable, "valid_min") or hasattr(variable, "valid_range") ): diff --git a/compliance_checker/cf/cf_1_7.py b/compliance_checker/cf/cf_1_7.py index fbfac740..1ff97520 100644 --- a/compliance_checker/cf/cf_1_7.py +++ b/compliance_checker/cf/cf_1_7.py @@ -794,8 +794,6 @@ def _evaluate_towgs84(self, val): return (True, msg) def check_grid_mapping(self, ds): - # FIXME: Looks like this is not needed. - # super().check_grid_mapping.__doc__ prev_return = super().check_grid_mapping(ds) grid_mapping_variables = cfutil.get_grid_mapping_variables(ds) for var_name in sorted(grid_mapping_variables): diff --git a/compliance_checker/cf/cf_1_9.py b/compliance_checker/cf/cf_1_9.py index 4f05fef9..5e085bd7 100644 --- a/compliance_checker/cf/cf_1_9.py +++ b/compliance_checker/cf/cf_1_9.py @@ -76,8 +76,6 @@ def check_time_coordinate_variable_has_calendar(self, ds): return ret_val def check_time_coordinate(self, ds): - # FIXME: Looks like this is not needed. - # super().check_calendar.__doc__ prev_return = super().check_time_coordinate(ds) seconds_regex = regex.compile( r"\w+ since \d{1,4}-\d{1,2}-\d{1,2}[ T]" diff --git a/compliance_checker/cf/cf_base.py b/compliance_checker/cf/cf_base.py index a6f6ed5d..2e420c81 100644 --- a/compliance_checker/cf/cf_base.py +++ b/compliance_checker/cf/cf_base.py @@ -567,7 +567,7 @@ def _find_ancillary_vars(self, ds, refresh=False): # Invalidate the cache at all costs self._ancillary_vars[ds] = [] - for _name, var in ds.variables.items(): + for var in ds.variables.values(): if hasattr(var, "ancillary_variables"): for anc_name in var.ancillary_variables.split(" "): if anc_name in ds.variables: