diff --git a/pymatgen/io/vasp/inputs.py b/pymatgen/io/vasp/inputs.py index 40c60fd372e..47c15a96894 100644 --- a/pymatgen/io/vasp/inputs.py +++ b/pymatgen/io/vasp/inputs.py @@ -2892,20 +2892,20 @@ def run_vasp( @property def incar(self) -> Incar: - """ INCAR object. """ - return Incar(self["INCAR"]) if isinstance(self["INCAR"],dict) else self["INCAR"] + """INCAR object.""" + return Incar(self["INCAR"]) if isinstance(self["INCAR"], dict) else self["INCAR"] @property def kpoints(self) -> Kpoints | None: - """ KPOINTS object. """ + """KPOINTS object.""" return self["KPOINTS"] - + @property def poscar(self) -> Poscar: - """ POSCAR object. """ + """POSCAR object.""" return self["POSCAR"] - + @property def potcar(self) -> Potcar | str | None: - """ POTCAR or POTCAR.spec object. """ - return self[self._potcar_filename] \ No newline at end of file + """POTCAR or POTCAR.spec object.""" + return self[self._potcar_filename] diff --git a/tests/io/vasp/test_inputs.py b/tests/io/vasp/test_inputs.py index a115b8f37b0..e99ecc9bc25 100644 --- a/tests/io/vasp/test_inputs.py +++ b/tests/io/vasp/test_inputs.py @@ -1365,24 +1365,20 @@ def test_from_directory(self): assert "CONTCAR_Li2O" in vasp_input def test_input_attr(self): - assert all( - v == getattr(self.vasp_input, k.lower()) for k, v in self.vasp_input.items() - ) + assert all(v == getattr(self.vasp_input, k.lower()) for k, v in self.vasp_input.items()) vis_potcar_spec = VaspInput( self.vasp_input.incar, self.vasp_input.kpoints, self.vasp_input.poscar, "\n".join(self.vasp_input.potcar.symbols), - potcar_spec = True - ) - assert all(k in vis_potcar_spec for k in ("INCAR","KPOINTS","POSCAR","POTCAR.spec")) - assert all( - self.vasp_input[k] == getattr(vis_potcar_spec, k.lower()) - for k in ("INCAR","KPOINTS","POSCAR") + potcar_spec=True, ) + assert all(k in vis_potcar_spec for k in ("INCAR", "KPOINTS", "POSCAR", "POTCAR.spec")) + assert all(self.vasp_input[k] == getattr(vis_potcar_spec, k.lower()) for k in ("INCAR", "KPOINTS", "POSCAR")) assert isinstance(vis_potcar_spec.potcar, str) + def test_potcar_summary_stats() -> None: potcar_summary_stats = loadfn(POTCAR_STATS_PATH) diff --git a/tests/io/vasp/test_sets.py b/tests/io/vasp/test_sets.py index 7c7e40e894b..fe181ae578d 100644 --- a/tests/io/vasp/test_sets.py +++ b/tests/io/vasp/test_sets.py @@ -671,6 +671,7 @@ def test_get_nedos(self): vis.prev_vasprun = vrun assert vis._get_nedos(0.1) == pytest.approx(741, abs=1) + class TestMPStaticSet(PymatgenTest): def setUp(self): self.set = MPStaticSet