|
19 | 19 | from pymatgen.core import SETTINGS, Lattice, Species, Structure
|
20 | 20 | from pymatgen.core.surface import SlabGenerator
|
21 | 21 | from pymatgen.core.units import FloatWithUnit
|
22 |
| -from pymatgen.io.vasp.inputs import Incar, Kpoints, Poscar |
| 22 | +from pymatgen.io.vasp.inputs import Incar, Kpoints, Poscar, PotcarSingle |
23 | 23 | from pymatgen.io.vasp.outputs import Vasprun
|
24 | 24 | from pymatgen.io.vasp.sets import (
|
25 | 25 | BadInputSetWarning,
|
@@ -766,6 +766,8 @@ def test_default(self):
|
766 | 766 | assert default.potcar.functional == "PBE_54"
|
767 | 767 | assert default.kpoints is None
|
768 | 768 |
|
| 769 | + assert str(default.potcar[0]) == str(PotcarSingle.from_symbol_and_functional("Fe_pv", "PBE_54")) |
| 770 | + |
769 | 771 | def test_with_prev_incar(self):
|
770 | 772 | default_prev = MatPESStaticSet(structure=self.struct, prev_incar=self.prev_incar)
|
771 | 773 | incar = default_prev.incar
|
@@ -838,11 +840,12 @@ def test_functionals(self):
|
838 | 840 | functional = "LDA"
|
839 | 841 | with pytest.raises(ValueError, match=f"{functional} is not supported"):
|
840 | 842 | MatPESStaticSet(self.struct, xc_functional=functional)
|
841 |
| - with pytest.raises( |
| 843 | + with pytest.warns( |
842 | 844 | UserWarning,
|
843 |
| - match="inconsistent with the default of PBE_54", |
| 845 | + match="inconsistent with the recommended PBE_54", |
844 | 846 | ):
|
845 |
| - MatPESStaticSet(self.struct, potcar_functional=functional) |
| 847 | + diff_potcar = MatPESStaticSet(self.struct, user_potcar_functional="PBE") |
| 848 | + assert str(diff_potcar.potcar[0]) == str(PotcarSingle.from_symbol_and_functional("Fe_pv", "PBE")) |
846 | 849 |
|
847 | 850 |
|
848 | 851 | class TestMPNonSCFSet(PymatgenTest):
|
|
0 commit comments