From 9c1a8cef4d3811d97758e59f9a14c29c12568436 Mon Sep 17 00:00:00 2001 From: Benjamin Adams Date: Mon, 16 Sep 2024 11:52:38 -0400 Subject: [PATCH 1/2] Remove set check for certain variable attributes due to sorting issues --- compliance_checker/cf/cf_1_6.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) 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 From b67dfd96dbf21a688bedeb86173dd1d0502c416e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2024 17:10:06 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- compliance_checker/cf/cf_1_6.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/compliance_checker/cf/cf_1_6.py b/compliance_checker/cf/cf_1_6.py index 49178abf..3979777e 100644 --- a/compliance_checker/cf/cf_1_6.py +++ b/compliance_checker/cf/cf_1_6.py @@ -116,8 +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: