Skip to content

Commit

Permalink
Alias VaspInputSet to VaspInputGenerator (#3566)
Browse files Browse the repository at this point in the history
* add VaspInputGenerator alias to follow atomate2 terminology

* add test_vasp_input_set_alias()
  • Loading branch information
janosh authored Feb 23, 2024
1 parent daf42d2 commit f6b8236
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions pymatgen/io/vasp/sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ def as_dict(self, verbosity=2):
return dct


# create VaspInputGenerator alias to follow atomate2 terminology
VaspInputGenerator = VaspInputSet


def _load_yaml_config(fname):
config = loadfn(MODULE_DIR / (f"{fname}.yaml"))
if "PARENT" in config:
Expand Down
8 changes: 7 additions & 1 deletion tests/io/vasp/test_sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
MVLRelax52Set,
MVLScanRelaxSet,
MVLSlabSet,
VaspInputGenerator,
VaspInputSet,
batch_write_input,
get_structure_from_prev_run,
Expand Down Expand Up @@ -537,7 +538,7 @@ def test_as_from_dict(self):

dct = mp_user_set.as_dict()
val = dec.process_decoded(dct)
# assert isinstance(val, MPVaspInputSet)
assert isinstance(val, VaspInputSet)
assert val.user_incar_settings["MAGMOM"] == {"Fe": 10, "S": -5, "Mn3+": 100}

def test_hubbard_off_and_ediff_override(self):
Expand Down Expand Up @@ -2037,6 +2038,7 @@ def test_rpa(self):
assert absorption_rpa.incar["NBANDS"] == 48
assert absorption_rpa.incar["NKREDX"] == 13
assert absorption_rpa.incar["ALGO"] == "Chi"

assert absorption_rpa.incar["LREAL"] is False
assert "LOPTICS" not in absorption_rpa.incar
assert "LWAVE" not in absorption_rpa.incar
Expand Down Expand Up @@ -2072,3 +2074,7 @@ def test_as_from_dict(self):
assert vasp_input.incar["ALGO"] == "Chi"
assert vasp_input.incar["NBANDS"] == 48
assert vasp_input.incar["GGA"] == "Ps"


def test_vasp_input_set_alias():
assert VaspInputSet is VaspInputGenerator

0 comments on commit f6b8236

Please sign in to comment.