Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
bnb32 committed Jul 19, 2024
1 parent d82884e commit 59b9817
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
fetch-depth: 0
- name: Lint Code Base
uses: super-linter/super-linter/[email protected]
uses: super-linter/super-linter@v4
env:
VALIDATE_ALL_CODEBASE: false
VALIDATE_PYTHON_BLACK: false
Expand Down
2 changes: 0 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ repos:
[
--rcfile,
.github/linters/.python-lint,
--ignore-paths,
tests/,
]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.3
Expand Down
6 changes: 1 addition & 5 deletions sup3r/pipeline/forward_pass_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ def main(ctx, verbose):
)
@click.pass_context
def from_config(ctx, config_file, verbose=False, pipeline_step=None):
"""Run sup3r forward pass from a config file.
TODO: Can we figure out how to remove the first ForwardPassStrategy
initialization here, so that its only initialized once for each node?
"""
"""Run sup3r forward pass from a config file."""

config = BaseCLI.from_config_preflight(
ModuleName.FORWARD_PASS, ctx, config_file, verbose
Expand Down
2 changes: 1 addition & 1 deletion sup3r/qa/qa.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def get_node_cmd(cls, config):
log_arg_str += f', log_file="{log_file}"'

cmd = (
f"python -c '{import_str};\n"
f"python -c '{import_str};\n"
't0 = time.time();\n'
f'logger = init_logger({log_arg_str});\n'
f'qa = {qa_init_str};\n'
Expand Down
4 changes: 2 additions & 2 deletions tests/data_handlers/test_dh_nc_cc.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def test_get_just_coords_nc():
assert np.array_equal(
handler.lat_lon[-1, 0, :],
(
handler.extracter[Dimension.LATITUDE].min(),
handler.extracter[Dimension.LONGITUDE].min(),
handler.extracter.data[Dimension.LATITUDE].min(),
handler.extracter.data[Dimension.LONGITUDE].min(),
),
)
assert not handler.data_vars
Expand Down
6 changes: 4 additions & 2 deletions tests/extracters/test_extracter_caching.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,13 @@ def test_data_caching(input_files, ext, shape, target, features):
assert extracter.data.dtype == np.dtype(np.float32)
loader = Loader(cacher.out_files)
assert np.array_equal(
loader[features, ...].compute(), extracter[features, ...].compute()
loader.data[features, ...].compute(),
extracter.data[features, ...].compute(),
)

# make sure full domain can be loaded with extracters
extracter = Extracter(cacher.out_files)
assert np.array_equal(
loader[features, ...].compute(), extracter[features, ...].compute()
loader.data[features, ...].compute(),
extracter.data[features, ...].compute(),
)

0 comments on commit 59b9817

Please sign in to comment.