Skip to content

Commit f2ef4dd

Browse files
authored
Auto-update pre-commit hooks
1 parent ee2d24e commit f2ef4dd

File tree

6 files changed

+10
-13
lines changed

6 files changed

+10
-13
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ default_language_version:
33
exclude: ^(.github/|tests/test_data/abinit/)
44
repos:
55
- repo: https://github.com/charliermarsh/ruff-pre-commit
6-
rev: v0.9.3
6+
rev: v0.11.2
77
hooks:
88
- id: ruff
99
args: [--fix]
@@ -31,15 +31,15 @@ repos:
3131
- id: rst-directive-colons
3232
- id: rst-inline-touching-normal
3333
- repo: https://github.com/pre-commit/mirrors-mypy
34-
rev: v1.14.1
34+
rev: v1.15.0
3535
hooks:
3636
- id: mypy
3737
files: ^src/
3838
additional_dependencies:
3939
- tokenize-rt==4.1.0
4040
- types-paramiko
4141
- repo: https://github.com/codespell-project/codespell
42-
rev: v2.4.0
42+
rev: v2.4.1
4343
hooks:
4444
- id: codespell
4545
stages: [pre-commit, commit-msg]

src/atomate2/cli/dev.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,13 +603,13 @@ def save_abinit_maker(maker: Maker) -> None:
603603
author_mail = None
604604
if git:
605605
name = subprocess.run(
606-
"git config user.name".split(),
606+
["git", "config", "user.name"],
607607
capture_output=True,
608608
encoding="utf-8",
609609
check=True,
610610
)
611611
mail = subprocess.run(
612-
"git config user.email".split(),
612+
["git", "config", "user.email"],
613613
capture_output=True,
614614
encoding="utf-8",
615615
check=True,

src/atomate2/common/jobs/mpmorph.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def get_entry_from_dict(chem_env: str) -> dict | None:
261261
for ielt in range(2, len(composition)):
262262
for combo in combinations(composition, ielt):
263263
chem_env_key = _get_chem_env_key_from_composition(
264-
Composition({spec: 1 for spec in combo}),
264+
Composition(dict.fromkeys(combo, 1)),
265265
ignore_oxi_states=ignore_oxi_states,
266266
)
267267

src/atomate2/forcefields/utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ def ase_calculator(calculator_meta: str | dict, **kwargs: Any) -> Calculator | N
7373
if isinstance(model, str | Path) and Path(model).exists():
7474
model_path = model
7575
device = kwargs.get("device") or "cpu"
76-
if "device" in kwargs:
77-
del kwargs["device"]
76+
kwargs.pop("device", None)
7877
calculator = MACECalculator(
7978
model_paths=model_path,
8079
device=device,

src/atomate2/utils/datetime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Helper functions for datetime objects.""" # noqa: A005
1+
"""Helper functions for datetime objects."""
22

33
from __future__ import annotations
44

tests/abinit/conftest.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,8 @@ def _get_differences_tol(
284284
self_dataset_dict = dict(self_dataset)
285285
other_dataset_dict = dict(other_dataset)
286286
for k in to_ignore:
287-
if k in self_dataset_dict:
288-
del self_dataset_dict[k]
289-
if k in other_dataset_dict:
290-
del other_dataset_dict[k]
287+
self_dataset_dict.pop(k, None)
288+
other_dataset_dict.pop(k, None)
291289
common_keys = set(self_dataset_dict.keys()).intersection(
292290
other_dataset_dict.keys()
293291
)

0 commit comments

Comments
 (0)