Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 26, 2024
1 parent 01ad37c commit 0ad4686
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
10 changes: 7 additions & 3 deletions salishsea_cmd/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,9 +750,13 @@ def _sbatch_directives(
"""
run_id = get_run_desc_value(run_desc, ("run_id",))
nodes = math.ceil(n_processors / procs_per_node)
mem = {"beluga": "92G", "cedar": "0", "graham": "0", "narval": "0", "sockeye": "186gb"}.get(
SYSTEM, mem
)
mem = {
"beluga": "92G",
"cedar": "0",
"graham": "0",
"narval": "0",
"sockeye": "186gb",
}.get(SYSTEM, mem)
if deflate:
run_id = f"{result_type}_{run_id}_deflate"
try:
Expand Down
9 changes: 5 additions & 4 deletions tests/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -2296,9 +2296,7 @@ def test_graham(self, account, deflate, monkeypatch):
)
assert script == expected

@pytest.mark.parametrize(
"deflate", [True, False]
)
@pytest.mark.parametrize("deflate", [True, False])
def test_narval(self, deflate, monkeypatch):
desc_file = StringIO(
"run_id: foo\n" "walltime: 01:02:03\n" "email: [email protected]"
Expand Down Expand Up @@ -2883,6 +2881,7 @@ def test_unknown_system(self, caplog, monkeypatch):
assert caplog.records[0].levelname == "ERROR"
assert caplog.records[0].message == "unknown system: mythical"

Check warning on line 2882 in tests/test_run.py

View check run for this annotation

Codecov / codecov/patch

tests/test_run.py#L2881-L2882

Added lines #L2881 - L2882 were not covered by tests


class TestSbatchDirectives:
"""Unit tests for _sbatch_directives() function."""

Expand Down Expand Up @@ -3091,7 +3090,9 @@ def test_sockeye_sbatch_directives(self, caplog, monkeypatch):
("sockeye", 40),
),
)
def test_account_directive_from_yaml(self, system, procs_per_node, caplog, monkeypatch):
def test_account_directive_from_yaml(
self, system, procs_per_node, caplog, monkeypatch
):
desc_file = StringIO(
"run_id: foo\n" "walltime: 01:02:03\n" "account: def-sverdrup\n"
)
Expand Down

0 comments on commit 0ad4686

Please sign in to comment.