diff --git a/compliance_checker/cf/cf_1_6.py b/compliance_checker/cf/cf_1_6.py index c1280d96..49178abf 100644 --- a/compliance_checker/cf/cf_1_6.py +++ b/compliance_checker/cf/cf_1_6.py @@ -116,17 +116,13 @@ def check_child_attr_data_types(self, ds): """ ctx = TestCtx(BaseCheck.MEDIUM, self.section_titles["2.5"]) - special_attrs = { - "actual_range", - "valid_min", - "valid_max", - "valid_range", - "_FillValue", - } + special_attrs = ("actual_range", "valid_min", "valid_max", + "valid_range", "_FillValue") for _var_name, var in ds.variables.items(): - for att_name in special_attrs.intersection(var.ncattrs()): - self._parent_var_attr_type_check(att_name, var, ctx) + for att_name in special_attrs: + if att_name in var.ncattrs(): + self._parent_var_attr_type_check(att_name, var, ctx) return ctx.to_result() # TODO: consider renaming to avoid confusion with non-underscore