Skip to content

Commit 44ec886

Browse files
[pre-commit.ci] pre-commit autoupdate (#102)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.8.6 → v0.11.4](astral-sh/ruff-pre-commit@v0.8.6...v0.11.4) - [github.com/codespell-project/codespell: v2.3.0 → v2.4.1](codespell-project/codespell@v2.3.0...v2.4.1) - [github.com/pre-commit/mirrors-mypy: v1.14.1 → v1.15.0](pre-commit/mirrors-mypy@v1.14.1...v1.15.0) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 3238fb4 commit 44ec886

File tree

5 files changed

+19
-20
lines changed

5 files changed

+19
-20
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ci:
55

66
repos:
77
- repo: https://github.com/astral-sh/ruff-pre-commit
8-
rev: v0.8.6
8+
rev: v0.11.4
99
hooks:
1010
- id: ruff
1111
args: [--fix]
@@ -23,14 +23,14 @@ repos:
2323
- id: trailing-whitespace
2424

2525
- repo: https://github.com/codespell-project/codespell
26-
rev: v2.3.0
26+
rev: v2.4.1
2727
hooks:
2828
- id: codespell
2929
exclude_types: [json]
3030
args: [--check-filenames]
3131

3232
- repo: https://github.com/pre-commit/mirrors-mypy
33-
rev: v1.14.1
33+
rev: v1.15.0
3434
hooks:
3535
- id: mypy
3636
exclude: (tests|examples)/

aviary/predict.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,9 @@ def predict_from_wandb_checkpoints(
214214
print(f"Using checkpoints from {len(runs)} run(s):")
215215

216216
run_target = runs[0].config["target"]
217-
assert all(
218-
run_target == run.config["target"] for run in runs
219-
), f"Runs have differing targets, first {run_target=}"
217+
assert all(run_target == run.config["target"] for run in runs), (
218+
f"Runs have differing targets, first {run_target=}"
219+
)
220220

221221
target_col = kwargs.get("target_col")
222222
if target_col and target_col != run_target:

aviary/train.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -433,9 +433,9 @@ def checkpoint_model(
433433
torch.save(checkpoint_dict, checkpoint_path)
434434

435435
if checkpoint_endpoint == "wandb":
436-
assert (
437-
wandb.run is not None
438-
), "can't save model checkpoint to Weights and Biases, wandb.run is None"
436+
assert wandb.run is not None, (
437+
"can't save model checkpoint to Weights and Biases, wandb.run is None"
438+
)
439439
torch.save(
440440
checkpoint_dict,
441441
f"{wandb.run.dir}/{timestamp + '-' if timestamp else ''}{run_name}-{epochs}.pth",
@@ -584,9 +584,9 @@ def df_train_test_split(
584584
if folds:
585585
n_folds, test_fold_idx = folds
586586
assert 1 < n_folds <= 10, f"{n_folds = } must be between 2 and 10"
587-
assert (
588-
0 <= test_fold_idx < n_folds
589-
), f"{test_fold_idx = } must be between 0 and {n_folds - 1}"
587+
assert 0 <= test_fold_idx < n_folds, (
588+
f"{test_fold_idx = } must be between 0 and {n_folds - 1}"
589+
)
590590

591591
df_splits: list[pd.DataFrame] = np.array_split(df, n_folds)
592592
test_df = df_splits.pop(test_fold_idx)

aviary/wren/data.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,7 @@ def parse_protostructure_label(
276276

277277
if len(elems) != len(wyckoff_letters):
278278
raise ValueError(
279-
f"Chemical system {chemsys} does not match Wyckoff letters "
280-
f"{wyckoff_letters}"
279+
f"Chemical system {chemsys} does not match Wyckoff letters {wyckoff_letters}"
281280
)
282281

283282
wyckoff_site_multiplicities = []

tests/test_wyckoff_ops.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -349,9 +349,9 @@ def test_get_protostructure_label_from_aflow(structure, expected):
349349
@pytest.mark.parametrize("structure, expected", zip(TEST_STRUCTS, TEST_PROTOSTRUCTURES))
350350
def test_get_protostructure_label_from_moyopy(structure, expected):
351351
"""Check that moyopy gives correct protostructure label simple cases."""
352-
assert (
353-
get_protostructure_label_from_moyopy(structure) == expected
354-
), f"unexpected moyopy protostructure for {structure=}"
352+
assert get_protostructure_label_from_moyopy(structure) == expected, (
353+
f"unexpected moyopy protostructure for {structure=}"
354+
)
355355

356356

357357
@pytest.mark.parametrize(
@@ -365,9 +365,9 @@ def test_moyopy_spglib_consistency(protostructure):
365365
moyopy_label = get_protostructure_label_from_moyopy(struct)
366366
spglib_label = get_protostructure_label_from_spglib(struct)
367367

368-
assert (
369-
moyopy_label == spglib_label
370-
), f"spglib moyopy protostructure mismatch for {protostructure}"
368+
assert moyopy_label == spglib_label, (
369+
f"spglib moyopy protostructure mismatch for {protostructure}"
370+
)
371371

372372

373373
@pytest.mark.skipif(pyxtal is None, reason="pyxtal not installed")

0 commit comments

Comments
 (0)