Skip to content

Commit d035806

Browse files
pre-commit auto-fixes
1 parent e873ac3 commit d035806

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

pymatgen/io/vasp/sets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,7 @@ def next_g_size(cur_g_size):
11231123
return ng_vec, [ng_ * finer_g_scale for ng_ in ng_vec]
11241124

11251125
@staticmethod
1126-
def from_directory(directory: str | Path, optional_files: dict = None) -> VaspInput:
1126+
def from_directory(directory: str | Path, optional_files: dict | None = None) -> VaspInput:
11271127
"""Load a set of VASP inputs from a directory.
11281128
11291129
Note that only the standard INCAR, POSCAR, POTCAR and KPOINTS files are read

tests/io/vasp/test_sets.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -649,31 +649,28 @@ def test_valid_magmom_struct(self):
649649
vis.incar.items()
650650

651651
def test_write_input_and_from_directory(self):
652-
structure = Structure.from_spacegroup("Fm-3m",Lattice.cubic(4.),["Fe"],[[0.,0.,0.]])
652+
structure = Structure.from_spacegroup("Fm-3m", Lattice.cubic(4.0), ["Fe"], [[0.0, 0.0, 0.0]])
653653

654654
vis = self.set(structure=structure)
655655
input_set = vis.get_input_set()
656656

657657
vis.write_input(output_dir=".")
658-
assert all(
659-
os.path.isfile(file) for file in ("INCAR","KPOINTS","POSCAR","POTCAR")
660-
)
658+
assert all(os.path.isfile(file) for file in ("INCAR", "KPOINTS", "POSCAR", "POTCAR"))
661659
input_set_from_dir = self.set().from_directory(".")
662660

663-
assert all(
664-
input_set_from_dir[k] == input_set[k] for k in ("INCAR","KPOINTS","POTCAR")
665-
)
661+
assert all(input_set_from_dir[k] == input_set[k] for k in ("INCAR", "KPOINTS", "POTCAR"))
666662
# for some reason the POSCARs are not identical, but their structures and as_dict()'s are
667663
assert input_set_from_dir["POSCAR"].structure == input_set["POSCAR"].structure
668664
assert input_set_from_dir["POSCAR"].as_dict() == input_set["POSCAR"].as_dict()
669665

670666
def test_get_nedos(self):
671-
vrun = Vasprun(f"{VASP_OUT_DIR}/vasprun.pbesol.xml.gz")
667+
vrun = Vasprun(f"{VASP_OUT_DIR}/vasprun.pbesol.xml.gz")
672668
vis = self.set(structure=vrun.structures[-1])
673669
# no `prev_vasprun` --> default value of NEDOS
674670
assert vis._get_nedos(0.1) == 2000
675671
vis.prev_vasprun = vrun
676-
assert vis._get_nedos(0.1) == pytest.approx(741,abs=1)
672+
assert vis._get_nedos(0.1) == pytest.approx(741, abs=1)
673+
677674

678675
class TestMPStaticSet(PymatgenTest):
679676
def setUp(self):

0 commit comments

Comments
 (0)