Skip to content

Commit

Permalink
pydoc / bump emmet-core for r2SCAN inp set
Browse files Browse the repository at this point in the history
  • Loading branch information
esoteric-ephemera committed Jan 23, 2025
1 parent d363a1e commit a0e44bc
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 26 deletions.
5 changes: 5 additions & 0 deletions pymatgen/io/validation/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ class InvalidOperation(Exception):
"""Define custom exception when checking valid operations."""

def __init__(self, operation: str) -> None:
"""Define custom exception when checking valid operations.
Args:
operation (str) : a symbolic string for an operation that is not valid.
"""
msg = f"Unknown operation type {operation}; valid values are: {VALID_OPERATIONS}"
super().__init__(msg)

Expand Down
51 changes: 26 additions & 25 deletions pymatgen/io/validation/vasp_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,31 +38,7 @@ class InputCategory(Enum):


class VaspParam:
"""Define the default value of a VASP parameter.
Args:
name (str) : the name of the INCAR keyword
value (Any) : the default value of this parameter if
statically assigned by VASP. If this parameter is dynamically assigned
by VASP, set the default to None.
tag (InputCategory, str) : the general category of input the tag belongs to.
Used only to properly update INCAR fields in the same way VASP does.
operation : str, Sequence of str, or None
Mathematical operation used to determine if an input value is valid.
See VALID_OPERATIONS for a list of possible operators.
If a single str, this specifies one operation.
Can be a list of valid operations.
alias : str or None
If a str, an alternate name for a parameter to use when reporting
invalid values. A good example is ENCUT, which is set by the
user, but is overwritten to ENMAX in the vasprun.xml parameters.
In this case, `name = "ENMAX"` but `alias = "ENCUT"` to be informative.
If None, it is set to `name`.
tolerance : float, default = 1.e-4
The tolerance used when evaluating approximate float equality.
commment : str or None
Additional information to pass to the user if a check fails.
"""
"""Define a schema for validating VASP parameters."""

__slots__: tuple[str, ...] = (
"name",
Expand All @@ -88,7 +64,32 @@ def __init__(
warning: str | None = None,
severity: Literal["reason", "warning"] = "reason",
) -> None:
"""
Define a schema for validating VASP parameters.
Args:
name (str) : the name of the INCAR keyword
value (Any) : the default value of this parameter if
statically assigned by VASP. If this parameter is dynamically assigned
by VASP, set the default to None.
tag (InputCategory, str) : the general category of input the tag belongs to.
Used only to properly update INCAR fields in the same way VASP does.
operation : str, Sequence of str, or None
Mathematical operation used to determine if an input value is valid.
See VALID_OPERATIONS for a list of possible operators.
If a single str, this specifies one operation.
Can be a list of valid operations.
alias : str or None
If a str, an alternate name for a parameter to use when reporting
invalid values. A good example is ENCUT, which is set by the
user, but is overwritten to ENMAX in the vasprun.xml parameters.
In this case, `name = "ENMAX"` but `alias = "ENCUT"` to be informative.
If None, it is set to `name`.
tolerance : float, default = 1.e-4
The tolerance used when evaluating approximate float equality.
commment : str or None
Additional information to pass to the user if a check fails.
"""
self.name = name
self.value = value
if (isinstance(operation, str) and operation not in VALID_OPERATIONS) or (
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pymatgen==2024.11.13
emmet-core==0.83.6
emmet-core==0.84.5
pydantic==2.4.2
pydantic-core==2.10.1
pydantic-settings==2.2.1
Expand Down

0 comments on commit a0e44bc

Please sign in to comment.