Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add back symprec kwarg to MP and MatPES set generators #947

Merged
merged 3 commits into from
Aug 7, 2024
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 pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ forcefields = [
"calorine<=2.2.1",
"chgnet>=0.2.2",
"mace-torch>=0.3.3",
"matgl>=1.1.1",
"matgl>=1.1.3",
"quippy-ase>=0.9.14",
"sevenn>=0.9.3",
"torch<=2.2.1", # incompatibility with dgl if newer versions are used
Expand Down Expand Up @@ -93,7 +93,7 @@ strict = [
"jobflow==0.1.18",
"lobsterpy==0.4.5",
"mace-torch>=0.3.3",
"matgl==1.1.2",
"matgl==1.1.3",
"monty==2024.7.30",
"mp-api==0.41.2",
"numpy",
Expand Down Expand Up @@ -198,7 +198,7 @@ ignore = [
"S324", # use of insecure hash function
"S507", # paramiko auto trust
"S603", # use of insecure subprocess
"TD", # TODOs
"TD", # todos
"TRY003", # long message outside exception class
]
pydocstyle.convention = "numpy"
Expand Down
6 changes: 6 additions & 0 deletions src/atomate2/vasp/sets/matpes.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ class MatPesGGAStaticSetGenerator(MatPESStaticSet):
xc_functional: Literal["R2SCAN", "PBE", "PBE+U"] = "PBE"
auto_ismear: bool = False
auto_kspacing: bool = False
symprec: float | None = None

def __post_init__(self) -> None:
"""Raise deprecation warning and validate."""
if self.symprec is not None:
self.sym_prec = self.symprec
super().__post_init__()


Expand All @@ -42,9 +45,12 @@ class MatPesMetaGGAStaticSetGenerator(MatPESStaticSet):
xc_functional: Literal["R2SCAN", "PBE", "PBE+U"] = "R2SCAN"
auto_ismear: bool = False
auto_kspacing: bool = False
symprec: float | None = None

def __post_init__(self) -> None:
"""Raise deprecation warning and validate."""
if self.symprec is not None:
self.sym_prec = self.symprec
super().__post_init__()

@property
Expand Down
12 changes: 12 additions & 0 deletions src/atomate2/vasp/sets/mp.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@ class MPGGARelaxSetGenerator(MPRelaxSet):
bandgap_tol: float = None
force_gamma: bool = True
auto_metal_kpoints: bool = True
symprec: float | None = None

def __post_init__(self) -> None:
"""Raise deprecation warning and validate."""
if self.symprec is not None:
self.sym_prec = self.symprec
super().__post_init__()


Expand All @@ -57,9 +60,12 @@ class MPGGAStaticSetGenerator(MPStaticSet):
inherit_incar: bool | None = False
force_gamma: bool = True
auto_metal_kpoints: bool = True
symprec: float | None = None

def __post_init__(self) -> None:
"""Raise deprecation warning and validate."""
if self.symprec is not None:
self.sym_prec = self.symprec
super().__post_init__()


Expand All @@ -72,9 +78,12 @@ class MPMetaGGAStaticSetGenerator(MPScanStaticSet):
auto_kspacing: bool = True
bandgap_tol: float = 1e-4
inherit_incar: bool | None = False
symprec: float | None = None

def __post_init__(self) -> None:
"""Raise deprecation warning and validate."""
if self.symprec is not None:
self.sym_prec = self.symprec
super().__post_init__()

@property
Expand Down Expand Up @@ -118,9 +127,12 @@ class MPMetaGGARelaxSetGenerator(MPScanRelaxSet):
auto_ismear: bool = False
auto_kspacing: bool = True
inherit_incar: bool | None = False
symprec: float | None = None

def __post_init__(self) -> None:
"""Raise deprecation warning and validate."""
if self.symprec is not None:
self.sym_prec = self.symprec
super().__post_init__()

@property
Expand Down
Loading