Skip to content

Commit

Permalink
move files to src layout
Browse files Browse the repository at this point in the history
  • Loading branch information
janosh committed Aug 7, 2024
1 parent a0715d9 commit 0a5695b
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 4 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ repos:
rev: v1.11.1
hooks:
- id: mypy
entry: env MYPYPATH=src mypy

- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ repair-wheel-command = "delocate-wheel --require-archs {delocate_archs} -w {dest
[tool.ruff]
target-version = "py39"
line-length = 120
output-format = "concise"

[tool.ruff.lint]
select = ["ALL"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
"""Re-export all VASP input sets, for more convenient imports and to maintain backwards compatible imports
following the split up of sets.py into submodules in #3865.
"""

from __future__ import annotations

from pymatgen.io.vasp.sets.base import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ruff: noqa: PGH003
"""
This module defines the VaspInputSet abstract base class and a concrete implementation for the parameters developed
and tested by the core team of pymatgen, including the Materials Virtual Lab, Materials Project and the MIT high
Expand Down Expand Up @@ -369,7 +370,7 @@ def as_dict(self, verbosity=2):
return dct

@property # type: ignore
def structure(self) -> Structure:
def structure(self) -> Structure: # noqa: F811
"""Structure."""
return self._structure

Expand Down Expand Up @@ -840,7 +841,7 @@ def kpoints(self) -> Kpoints | None:
self.structure, kconfig["zero_weighted_reciprocal_density"], self.force_gamma
)
sga = SpacegroupAnalyzer(self.structure, symprec=self.sym_prec)
mesh = sga.get_ir_reciprocal_mesh(zero_weighted_kpoints.kpts[0])
mesh = sga.get_ir_reciprocal_mesh(zero_weighted_kpoints.kpts[0]) # type: ignore[arg-type]
zero_weighted_kpoints = Kpoints(
comment="Uniform grid",
style=Kpoints.supported_modes.Reciprocal,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# ruff: noqa: PGH003

from __future__ import annotations

import warnings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class MatPESStaticSet(VaspInputSet):
# These are parameters that we will inherit from any previous INCAR supplied. They are mostly parameters related
# to symmetry and convergence set by Custodian when errors are encountered in a previous run. Given that our goal
# is to have a strictly homogeneous PES data, all other parameters (e.g., ISMEAR, ALGO, etc.) are not inherited.
inherit_incar: list[str] | bool = ( # type: ignore
inherit_incar: list[str] | bool = ( # type: ignore # noqa: PGH003
"LPEAD",
"NGX",
"NGY",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# ruff: noqa: PGH003

from __future__ import annotations

import warnings
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# ruff: noqa: PGH003

from __future__ import annotations

from dataclasses import dataclass
Expand Down Expand Up @@ -381,7 +383,7 @@ def incar_updates(self) -> dict:
"LDAU": False,
}
# Set NPT-AIMD ENCUT = 1.5 * VASP_default
enmax = [self.potcar[i].keywords["ENMAX"] for i in range(self.structure.ntypesp)] # type: ignore
enmax = [self.potcar[i].keywords["ENMAX"] for i in range(self.structure.ntypesp)] # type: ignore[union-attr]
updates["ENCUT"] = max(enmax) * 1.5
return updates

Expand Down

0 comments on commit 0a5695b

Please sign in to comment.