Skip to content

Commit

Permalink
Simplify file mapping definitions.
Browse files Browse the repository at this point in the history
  • Loading branch information
shyuep committed Oct 23, 2024
1 parent ab99149 commit 2ffdf78
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions src/pymatgen/io/vasp/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5761,24 +5761,28 @@ class VaspDir(collections.abc.Mapping):
"""

FILE_MAPPINGS: typing.ClassVar = {
"INCAR": Incar,
"POSCAR": Poscar,
n: globals()[n.capitalize()]
for n in [
"INCAR",
"POSCAR",
"KPOINTS",
"POTCAR",
"vasprun",
"OUTCAR",
"OSZICAR",
"CHGCAR",
"WAVECAR",
"WAVEDER",
"LOCPOT",
"XDATCAR",
"EIGENVAL",
"PROCAR",
"ELFCAR",
"DYNMAT",
]
} | {
"CONTCAR": Poscar,
"KPOINTS": Kpoints,
"IBZKPT": Kpoints,
"POTCAR": Potcar,
"vasprun": Vasprun,
"OUTCAR": Outcar,
"OSZICAR": Oszicar,
"CHGCAR": Chgcar,
"WAVECAR": Wavecar,
"WAVEDER": Waveder,
"LOCPOT": Locpot,
"XDATCAR": Xdatcar,
"EIGENVAL": Eigenval,
"PROCAR": Procar,
"ELFCAR": Elfcar,
"DYNMAT": Dynmat,
"WSWQ": WSWQ,
}

Expand Down

0 comments on commit 2ffdf78

Please sign in to comment.