Skip to content

Commit

Permalink
Merge pull request #199 from nasa/feature/issue-198-resolve-linting-e…
Browse files Browse the repository at this point in the history
…rror

Feature/issue 198 resolve linting error
  • Loading branch information
danielfromearth authored Apr 30, 2024
2 parents 4c4a0e7 + 01fc7bc commit 21d21f1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ repos:

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: 'v0.3.7'
rev: 'v0.4.2'
hooks:
- id: ruff
args: [ "--fix" ]

# https://github.com/python/black#version-control-integration
- repo: https://github.com/psf/black
rev: 24.4.0
rev: 24.4.2
hooks:
- id: black-jupyter

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.9.0
rev: v1.10.0
hooks:
- id: mypy
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Deprecated
### Removed
### Fixed
- [pull/190](https://github.com/nasa/ncompare/pull/190): codecov upload token error
- [Pull/190](https://github.com/nasa/ncompare/pull/190): codecov upload token error
- [Pull #199](https://github.com/nasa/ncompare/pull/199): Resolve linting error
### Security

## [1.8.0]
Expand Down
9 changes: 4 additions & 5 deletions ncompare/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def run_through_comparisons(
if comparison_var_group:
# Show the variables within the selected group.
out.print(
Fore.LIGHTBLUE_EX + "\nVariables within specified group <%s>:" % comparison_var_group,
Fore.LIGHTBLUE_EX + f"\nVariables within specified group <{comparison_var_group}>:",
add_to_history=True,
)
vlist_a = _get_vars(nc_a, comparison_var_group)
Expand All @@ -160,16 +160,15 @@ def run_through_comparisons(
# Print the first part of the values array for the selected variable.
out.print(
Fore.LIGHTBLUE_EX
+ "\nSample values within specified variable <%s>:" % comparison_var_name
+ f"\nSample values within specified variable <{comparison_var_name}>:"
)
_print_sample_values(out, nc_a, comparison_var_group, comparison_var_name)
_print_sample_values(out, nc_b, comparison_var_group, comparison_var_name)
# compare_sample_values(nc_a, nc_b, groupname=comparison_var_group, varname=comparison_var_name)

out.print(
Fore.LIGHTBLUE_EX
+ "\nChecking multiple random values within specified variable <%s>:"
% comparison_var_name
+ f"\nChecking multiple random values within specified variable <{comparison_var_name}>:"
)
compare_multiple_random_values(
out, nc_a, nc_b, groupname=comparison_var_group, varname=comparison_var_name
Expand Down Expand Up @@ -597,7 +596,7 @@ def _get_vars(nc_filepath: Union[str, Path], groupname: str) -> list:
try:
grp = xr.open_dataset(nc_filepath, backend_kwargs={"group": groupname})
except OSError as err:
print("\nError occurred when attempting to open group within <%s>.\n" % nc_filepath)
print(f"\nError occurred when attempting to open group within <{nc_filepath}>.\n")
raise err
grp_varlist = sorted(list(grp.variables.keys())) # type:ignore[type-var]

Expand Down

0 comments on commit 21d21f1

Please sign in to comment.