Skip to content

Commit 1ec591a

Browse files
linting / docstr
1 parent ad14d45 commit 1ec591a

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

pymatgen/io/validation/check_common_errors.py

+17-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from emmet.core.tasks import TaskDoc
1010
from emmet.core.vasp.task_valid import TaskDocument
1111
from pymatgen.core import Structure
12+
from pymatgen.io.vasp import Incar
1213
from typing import Sequence
1314

1415

@@ -181,7 +182,7 @@ def check(
181182
@dataclass
182183
class CheckVaspVersion:
183184
"""
184-
Check for common calculation errors.
185+
Check for common errors related to the version of VASP used.
185186
186187
Parameters
187188
-----------
@@ -191,7 +192,21 @@ class CheckVaspVersion:
191192

192193
defaults: dict | None = None
193194

194-
def check(self, reasons: list[str], vasp_version: Sequence[int], parameters: dict, incar: dict) -> None:
195+
def check(self, reasons: list[str], vasp_version: Sequence[int], parameters: dict, incar: dict | Incar) -> None:
196+
"""
197+
Check for common errors related to the version of VASP used.
198+
199+
reasons : list[str]
200+
A list of error strings to update if a check fails. These are higher
201+
severity and would deprecate a calculation.
202+
vasp_version: Sequence[int]
203+
Vasp version, e.g., 6.4.1 could be represented as (6,4,1)
204+
parameters : dict[str,Any]
205+
Dict of user-supplied/-parsed INCAR parameters.
206+
incar : dict | Incar
207+
INCAR corresponding to the calculation.
208+
"""
209+
195210
if (
196211
vasp_version[0] == 5
197212
and (incar.get("METAGGA", self.defaults["METAGGA"]["value"]) not in [None, "--", "None"])

pymatgen/io/validation/settings.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class IOValidationSettings(BaseSettings):
8585
description="Number of ionic steps to average over when validating drift forces",
8686
)
8787

88-
VASP_DEFAULTS_FILENAME: str | Path = Field(
88+
VASP_DEFAULTS_FILENAME: Union[str, Path] = Field(
8989
default=import_resource_files("pymatgen.io.validation") / "vasp_defaults.yaml",
9090
description="Path to the of the YAML file containing default values of VASP parameters.",
9191
)

0 commit comments

Comments
 (0)