Skip to content

Commit

Permalink
use MPMetaGGARelaxSetGenerator instead of StaticSetGenerator test_set…
Browse files Browse the repository at this point in the history
…_kspacing_and_auto_ismear

since it uses kspacing by default
  • Loading branch information
janosh committed Oct 18, 2023
1 parent a9389d3 commit 3398395
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/atomate2/vasp/sets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ class VaspInputGenerator(InputGenerator):
force_gamma: bool = True
symprec: float = SETTINGS.SYMPREC
vdw: str = None
# copy _BASE_VASP_SET to ensure each class instance has its own copy
# otherwise in-place changes can affect other instances
config_dict: dict = field(default_factory=lambda: _BASE_VASP_SET)
inherit_incar: bool = None

Expand Down
9 changes: 5 additions & 4 deletions tests/vasp/test_sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from pymatgen.core import Lattice, Species, Structure

from atomate2.vasp.sets.core import StaticSetGenerator
from atomate2.vasp.sets.mp import MPMetaGGARelaxSetGenerator


@pytest.fixture(scope="module")
Expand Down Expand Up @@ -172,10 +173,10 @@ def test_set_u_params(structure, request) -> None:
(10, {"KSPACING": 0.44, "ISMEAR": -5, "SIGMA": 0.05}),
],
)
def test_set_kspacing_and_auto_ismear(struct_no_magmoms, bandgap, expected_params):
static_set = StaticSetGenerator(auto_ismear=True, auto_kspacing=True)
# need to indicate to atomate2 to use KSPACING instead of KPOINTS
static_set.config_dict["INCAR"]["KSPACING"] = 42 # dummy value
def test_set_kspacing_and_auto_ismear(
struct_no_magmoms, bandgap, expected_params, monkeypatch
):
static_set = MPMetaGGARelaxSetGenerator(auto_ismear=True, auto_kspacing=True)

incar = static_set._get_incar(
structure=struct_no_magmoms,
Expand Down

0 comments on commit 3398395

Please sign in to comment.