Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default_language_version:
exclude: ^(.github/|tests/test_data/abinit/)
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.15.10
rev: v0.16.3
hooks:
- id: ruff
args: [--fix]
Expand Down Expand Up @@ -33,15 +33,15 @@ repos:
- id: rst-directive-colons
- id: rst-inline-touching-normal
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.20.1
rev: v2.3.0
hooks:
- id: mypy
files: ^src/
additional_dependencies:
- tokenize-rt==4.1.0
- types-paramiko
- repo: https://github.com/codespell-project/codespell
rev: v2.4.2
rev: v2.4.3
hooks:
- id: codespell
stages: [pre-commit, commit-msg]
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ ignore = [
"C408", # Unnecessary (dict/list/tuple) call - remove call
"C901", # function too complex
"COM812", # trailing comma missing
"CPY001", # copyright notice at top of file
"EM", # exception message must not use f-string literal
"ERA001", # found commented out code
"FBT001",
Expand All @@ -229,6 +230,7 @@ ignore = [
"PLR0912", # too many branches
"PLR0913", # too many arguments
"PLR0915", # too many local statements
"PLR0917", # too many positional arguments
"PLR2004",
"PT006", # pytest-parametrize-names-wrong-type
"PT013", # pytest-incorrect-pytest-import
Expand Down
2 changes: 1 addition & 1 deletion src/atomate2/abinit/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
ALL_ABIEXTS = abi_extensions()


def fname2ext(filepath: Path | str) -> None | str:
def fname2ext(filepath: Path | str) -> str | None:
"""Get the abinit extension of a given filename.

This will return None if no extension is found.
Expand Down
4 changes: 2 additions & 2 deletions src/atomate2/cp2k/sets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Cp2kInputSet(InputSet):
def __init__(
self,
cp2k_input: Cp2kInput,
optional_files: dict | None | Literal[False] = None,
optional_files: dict | Literal[False] | None = None,
) -> None:
"""Initialize the set.

Expand Down Expand Up @@ -187,7 +187,7 @@ def get_input_set(
self,
structure: Structure | Molecule = None,
prev_dir: str | Path = None,
optional_files: dict | None | Literal[False] = None,
optional_files: dict | Literal[False] | None = None,
) -> Cp2kInputSet:
"""Get a CP2K input set.

Expand Down
2 changes: 1 addition & 1 deletion src/atomate2/jdftx/sets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class JdftxInputGenerator(InputGenerator):
user_settings: dict = field(default_factory=dict)
coulomb_truncation: bool = False
auto_kpoint_density: int = 1000
potential: None | float = None
potential: float | None = None
calc_type: str = "bulk"
pseudopotentials: str = "GBRV"
config_dict: dict = field(default_factory=lambda: _GENERATION_CONFIG)
Expand Down
8 changes: 5 additions & 3 deletions src/atomate2/openmm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,11 @@ def generate_opls_xml(

# Run LigParGen via Shifter / Docker / Apptainer
lpg_cmd = [
f"ligpargen -n {name} -p {name} "
f"-r {name} -c {charge} -o {checkopt} "
f"-cgen {charge_method} -s '{smiles}'"
(
f"ligpargen -n {name} -p {name} "
f"-r {name} -c {charge} -o {checkopt} "
f"-cgen {charge_method} -s '{smiles}'"
)
]
run_container = (
f"{os.environ['CONTAINER_SOFTWARE']} "
Expand Down
2 changes: 1 addition & 1 deletion src/atomate2/vasp/flows/ferroelectric.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class FerroelectricMaker(Maker):

name: str = "ferroelectric"
nimages: int = 8
relax_maker: BaseVaspMaker | None | tuple = field(
relax_maker: BaseVaspMaker | tuple | None = field(
default_factory=lambda: DoubleRelaxMaker.from_relax_maker(RelaxMaker())
)
lcalcpol_maker: BaseVaspMaker = field(default_factory=PolarizationMaker)
Expand Down
2 changes: 1 addition & 1 deletion tests/forcefields/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def get_deepmd_pretrained_model_path(test_dir: Path) -> Path:
file_url = "https://raw.github.com/sliutheorygroup/UniPero/main/model/graph.pb"
local_path = tempfile.NamedTemporaryFile(suffix=".pb") # noqa : SIM115
ref_md5 = "2814ae7f2eb1c605dd78f2964187de40"
_, http_message = urllib.request.urlretrieve(file_url, local_path.name) # noqa: S310
_, http_message = urllib.request.urlretrieve(file_url, local_path.name)
if "Content-Type: text/html" in http_message:
raise RuntimeError(f"Failed to download from: {file_url}")

Expand Down
Loading