Skip to content

Commit

Permalink
linted
Browse files Browse the repository at this point in the history
  • Loading branch information
esoteric-ephemera authored and janosh committed May 20, 2024
1 parent e1e1a70 commit ddf74e1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
16 changes: 8 additions & 8 deletions pymatgen/io/vasp/inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
"""POTCAR or POTCAR.spec object."""
return self[self._potcar_filename]
14 changes: 5 additions & 9 deletions tests/io/vasp/test_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
1 change: 1 addition & 0 deletions tests/io/vasp/test_sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ddf74e1

Please sign in to comment.