Skip to content

Commit

Permalink
pre-commit autoupdate (#4213)
Browse files Browse the repository at this point in the history
* pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.7.2 → v0.8.1](astral-sh/ruff-pre-commit@v0.7.2...v0.8.1)
- [github.com/MarcoGorelli/cython-lint: v0.16.2 → v0.16.6](MarcoGorelli/cython-lint@v0.16.2...v0.16.6)
- [github.com/igorshubovych/markdownlint-cli: v0.42.0 → v0.43.0](igorshubovych/markdownlint-cli@v0.42.0...v0.43.0)
- [github.com/kynan/nbstripout: 0.8.0 → 0.8.1](kynan/nbstripout@0.8.0...0.8.1)
- [github.com/RobertCraigie/pyright-python: v1.1.387 → v1.1.389](RobertCraigie/pyright-python@v1.1.387...v1.1.389)

* pre-commit auto-fixes

* Convert to f-syntax to satisfy ruff

Signed-off-by: Matthew Horton <[email protected]>

---------

Signed-off-by: Matthew Horton <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Matthew Horton <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and mkhorton authored Dec 11, 2024
1 parent b2a5e0f commit 8c7a4c2
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 23 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ci:

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.2
rev: v0.8.1
hooks:
- id: ruff
args: [--fix, --unsafe-fixes]
Expand Down Expand Up @@ -36,7 +36,7 @@ repos:
exclude: src/pymatgen/analysis/aflow_prototypes.json

- repo: https://github.com/MarcoGorelli/cython-lint
rev: v0.16.2
rev: v0.16.6
hooks:
- id: cython-lint
args: [--no-pycodestyle]
Expand All @@ -48,7 +48,7 @@ repos:
- id: blacken-docs

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.42.0
rev: v0.43.0
hooks:
- id: markdownlint
# MD013: line too long
Expand All @@ -59,12 +59,12 @@ repos:
args: [--disable, MD013, MD024, MD025, MD033, MD041, "--"]

- repo: https://github.com/kynan/nbstripout
rev: 0.8.0
rev: 0.8.1
hooks:
- id: nbstripout
args: [--drop-empty-cells, --keep-output]

- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.387
rev: v1.1.389
hooks:
- id: pyright
2 changes: 1 addition & 1 deletion src/pymatgen/io/aims/inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ def get_content(
width = parameters["smearing"][1]
if name == "methfessel-paxton":
order = parameters["smearing"][2]
order = " %d" % order
order = f" {order:d}"
else:
order = ""

Expand Down
1 change: 0 additions & 1 deletion src/pymatgen/io/cp2k/sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
from pymatgen.io.vasp.inputs import KpointsSupportedModes

if TYPE_CHECKING:
from pathlib import Path
from typing import Literal

__author__ = "Nicholas Winner"
Expand Down
7 changes: 2 additions & 5 deletions src/pymatgen/io/lobster/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,11 +444,8 @@ def __init__(
for line in lines:
if (
("_" not in line.split()[1] and version != "5.1.0")
or "_" not in line.split()[1]
and version == "5.1.0"
or (line.split()[1].count("_") == 1)
and version == "5.1.0"
and self.is_lcfo
or ("_" not in line.split()[1] and version == "5.1.0")
or ((line.split()[1].count("_") == 1) and version == "5.1.0" and self.is_lcfo)
):
data_without_orbitals.append(line)
elif line.split()[1].count("_") >= 2 and version == "5.1.0":
Expand Down
2 changes: 1 addition & 1 deletion src/pymatgen/io/vasp/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4517,7 +4517,7 @@ def __init__(
else:
preamble.append(line)

elif line == "" or "Direct configuration=" in line and len(coords_str) > 0:
elif line == "" or ("Direct configuration=" in line and len(coords_str) > 0):
parse_poscar = True
restart_preamble = False
else:
Expand Down
2 changes: 1 addition & 1 deletion src/pymatgen/symmetry/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from pymatgen.core.lattice import Lattice

# Don't import at runtime to avoid circular import
from pymatgen.core.operations import SymmOp # noqa: TCH004
from pymatgen.core.operations import SymmOp # noqa: TC004

CrystalSystem = Literal[
"cubic",
Expand Down
21 changes: 12 additions & 9 deletions tests/io/lobster/test_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1670,16 +1670,19 @@ def test_has_good_quality_check_occupied_bands_patched(self):
)
# Assert for expected results
if (
actual_deviation == 0.05
and number_occ_bands_spin_up <= 7
and number_occ_bands_spin_down <= 7
and spin is Spin.up
or actual_deviation == 0.05
and spin is Spin.down
(
actual_deviation == 0.05
and number_occ_bands_spin_up <= 7
and number_occ_bands_spin_down <= 7
and spin is Spin.up
)
or (actual_deviation == 0.05 and spin is Spin.down)
or actual_deviation == 0.1
or actual_deviation in [0.2, 0.5, 1.0]
and number_occ_bands_spin_up == 0
and number_occ_bands_spin_down == 0
or (
actual_deviation in [0.2, 0.5, 1.0]
and number_occ_bands_spin_up == 0
and number_occ_bands_spin_down == 0
)
):
assert result
else:
Expand Down

0 comments on commit 8c7a4c2

Please sign in to comment.