Skip to content

Commit

Permalink
minor fixes, left over from #1026
Browse files Browse the repository at this point in the history
  • Loading branch information
ocefpaf committed May 18, 2023
1 parent 07a7874 commit 3e27d85
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 9 deletions.
4 changes: 2 additions & 2 deletions compliance_checker/acdd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions compliance_checker/cf/cf_1_6.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down Expand Up @@ -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")
):
Expand Down
2 changes: 0 additions & 2 deletions compliance_checker/cf/cf_1_7.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 0 additions & 2 deletions compliance_checker/cf/cf_1_9.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]"
Expand Down
2 changes: 1 addition & 1 deletion compliance_checker/cf/cf_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 3e27d85

Please sign in to comment.