From d3ee89b25f7e68aa5c4f54304b5eb6bff64ebe99 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Thu, 11 Apr 2024 11:13:51 +0200 Subject: [PATCH] fix some lints --- compliance_checker/cf/cf_1_6.py | 7 +------ compliance_checker/cf/cf_1_7.py | 7 +------ compliance_checker/tests/test_cf_integration.py | 4 +--- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/compliance_checker/cf/cf_1_6.py b/compliance_checker/cf/cf_1_6.py index dd571c07..2e31f029 100644 --- a/compliance_checker/cf/cf_1_6.py +++ b/compliance_checker/cf/cf_1_6.py @@ -2764,12 +2764,7 @@ def check_cell_boundaries(self, ds): ): valid = False reasoning.append( - "Dimension {} of boundary variable (for {}) must have at least {} elements to form a simplex/closed cell with previous dimensions {}.".format( - boundary_variable.name, - variable.name, - len(variable.dimensions) + 1, - boundary_variable.dimensions[:-1], - ), + f"Dimension {boundary_variable.name} of boundary variable (for {variable.name}) must have at least {len(variable.dimensions) + 1} elements to form a simplex/closed cell with previous dimensions {boundary_variable.dimensions[:-1]}.", ) result = Result( BaseCheck.MEDIUM, diff --git a/compliance_checker/cf/cf_1_7.py b/compliance_checker/cf/cf_1_7.py index e47ca240..50eb05ee 100644 --- a/compliance_checker/cf/cf_1_7.py +++ b/compliance_checker/cf/cf_1_7.py @@ -283,12 +283,7 @@ def check_cell_boundaries(self, ds): ): valid = False reasoning.append( - "Dimension {} of boundary variable (for {}) must have at least {} elements to form a simplex/closed cell with previous dimensions {}.".format( - boundary_variable.name, - variable.name, - len(variable.dimensions) + 1, - boundary_variable.dimensions[:-1], - ), + f"Dimension {boundary_variable.name} of boundary variable (for {variable.name}) must have at least {len(variable.dimensions) + 1} elements to form a simplex/closed cell with previous dimensions {boundary_variable.dimensions[:-1]}.", ) # 7.1 Required 3/5: diff --git a/compliance_checker/tests/test_cf_integration.py b/compliance_checker/tests/test_cf_integration.py index 5d162672..33f8fa29 100644 --- a/compliance_checker/tests/test_cf_integration.py +++ b/compliance_checker/tests/test_cf_integration.py @@ -45,9 +45,7 @@ 'ยง2.6.1 Conventions global attribute does not contain "CF-1.8"', f"standard_name visibility is not defined in Standard Name Table v{std_names._version}. Possible close match(es): ['visibility_in_air']", 'Standard name modifier "data_quality" for variable visibility_qc is not a valid modifier according to CF Appendix C', - "standard_name wind_direction is not defined in Standard Name Table v{}. Possible close match(es): ['wind_to_direction', 'wind_from_direction', 'wind_gust_from_direction']".format( - std_names._version, - ), + f"standard_name wind_direction is not defined in Standard Name Table v{std_names._version}. Possible close match(es): ['wind_to_direction', 'wind_from_direction', 'wind_gust_from_direction']", 'Standard name modifier "data_quality" for variable wind_direction_qc is not a valid modifier according to CF Appendix C', f"standard_name wind_gust is not defined in Standard Name Table v{std_names._version}. Possible close match(es): ['y_wind_gust', 'x_wind_gust', 'wind_speed_of_gust']", 'Standard name modifier "data_quality" for variable wind_gust_qc is not a valid modifier according to CF Appendix C',