Skip to content

Commit

Permalink
Merge pull request #59 from ocefpaf/improve_readability
Browse files Browse the repository at this point in the history
Improve readability
  • Loading branch information
ocefpaf authored May 23, 2024
2 parents 860ef0e + 3815cee commit 8681c88
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
11 changes: 3 additions & 8 deletions cc_plugin_glider/glider_dac.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ tag_regex = "^(?P<prefix>v)?(?P<version>[^\\+]+)(?P<suffix>.*)?$"
target-version = "py38"
line-length = 79

select = [
lint.select = [
"A", # flake8-builtins
"B", # flake8-bugbear
"C4", # flake8-comprehensions
Expand Down

0 comments on commit 8681c88

Please sign in to comment.