From 4994363b28230b90b7703e53b5e3810a42f89391 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Thu, 23 May 2024 13:25:32 +0200 Subject: [PATCH 1/2] improve readability --- cc_plugin_glider/glider_dac.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/cc_plugin_glider/glider_dac.py b/cc_plugin_glider/glider_dac.py index 956f952..9474eb6 100644 --- a/cc_plugin_glider/glider_dac.py +++ b/cc_plugin_glider/glider_dac.py @@ -653,8 +653,7 @@ def check_qartod(self, dataset): dtype = flag_values.dtype test_ctx.assert_true( util.compare_dtype(dtype, np.dtype("|i1")), - f"attribute {qartod_var}:flag_values has an illegal data-type, must " - "be byte", + f"attribute {qartod_var}:flag_values has an illegal data-type, must be byte", ) valid_min_dtype = getattr(valid_min, "dtype", None) @@ -692,10 +691,7 @@ def check_ancillary_variables(self, dataset): test = acv in dataset.variables score += int(test) if not test: - msg = ( - f"Invalid ancillary_variables attribute for {var}, " - f"{acv} is not a variable" - ) + msg = f"Invalid ancillary_variables attribute for {var}, {acv} is not a variable" messages.append(msg) return self.make_result(level, score, out_of, "Ancillary Variables", messages) @@ -746,8 +742,7 @@ def check_valid_min_dtype(self, dataset): if valid_min is not None: test_ctx.assert_true( util.compare_dtype(np.dtype(valid_min_dtype), ncvar.dtype), - f"{var_name}:valid_min has a different data type, {valid_min_dtype}, than variable {var_name}, " - f"{str(ncvar.dtype)}", + f"{var_name}:valid_min has a different data type, {valid_min_dtype}, than variable {var_name}, {ncvar.dtype}", ) return test_ctx.to_result() From 3815ceeca6743306f4ab57bb39f32d8706a894a5 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Thu, 23 May 2024 13:25:38 +0200 Subject: [PATCH 2/2] ruff lint --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 50bdb5a..872cda5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,7 +57,7 @@ tag_regex = "^(?Pv)?(?P[^\\+]+)(?P.*)?$" target-version = "py38" line-length = 79 -select = [ +lint.select = [ "A", # flake8-builtins "B", # flake8-bugbear "C4", # flake8-comprehensions