From dcd1edfe6a320e0e3cebc71f0c6d98fa7794c789 Mon Sep 17 00:00:00 2001 From: Benjamin Adams Date: Mon, 15 Apr 2024 18:11:07 -0400 Subject: [PATCH] Rename function check_valid_range_or_valid_min_max_present Renames check function `check_valid_range_or_valid_min_max_present` to `check_valid_range_and_valid_min_max_present` for clarity. Existing compliance checker plugins checked do not reference this function so this appears to be a safe operation. --- compliance_checker/cf/cf_1_6.py | 2 +- compliance_checker/tests/test_cf.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compliance_checker/cf/cf_1_6.py b/compliance_checker/cf/cf_1_6.py index 3cc38a1e..f4ff4710 100644 --- a/compliance_checker/cf/cf_1_6.py +++ b/compliance_checker/cf/cf_1_6.py @@ -430,7 +430,7 @@ def check_fill_value_equal_missing_value(self, ds): msgs=fails, ) - def check_valid_range_or_valid_min_max_present(self, ds): + def check_valid_range_and_valid_min_max_present(self, ds): """ The valid_range attribute must not be present if the valid_min and/or valid_max attributes are present. This according to 2.5.1 Requirements. diff --git a/compliance_checker/tests/test_cf.py b/compliance_checker/tests/test_cf.py index 203b2ee1..292bfd82 100644 --- a/compliance_checker/tests/test_cf.py +++ b/compliance_checker/tests/test_cf.py @@ -396,7 +396,7 @@ def test_check_fill_value_equal_missing_value(self): assert result.msgs == expected_msgs - def test_check_valid_range_or_valid_min_max_present(self): + def test_check_valid_range_and_valid_min_max_present(self): """ 2.5.1 Missing data, valid and actual range of data Requirements: @@ -426,7 +426,7 @@ def test_check_valid_range_or_valid_min_max_present(self): dataset.variables["c"][1] = 2 dataset.variables["c"].setncattr("valid_range", [-10, 10]) - result = self.cf.check_valid_range_or_valid_min_max_present(dataset) + result = self.cf.check_valid_range_and_valid_min_max_present(dataset) # check if the test fails when when variable "a" is checked. expected_msgs = [