Skip to content

Commit

Permalink
Fix bug in VASP parameter parsing (#3870)
Browse files Browse the repository at this point in the history
Co-authored-by: Matthew Horton <matthew.horton@microsoft.com>
  • Loading branch information
mkhorton and Matthew Horton authored Jun 9, 2024
1 parent 85e0f34 commit b0d9946
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pymatgen/io/vasp/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,10 @@ def run_type(self) -> str:
Hubbard U terms and vdW corrections are detected automatically as well.
"""

# Care should be taken: if a GGA tag is not specified, VASP will default
# to the functional specified by the POTCAR. It is not clear how
# VASP handles the "--" value.
GGA_TYPES = {
"RE": "revPBE",
"PE": "PBE",
Expand Down Expand Up @@ -1356,7 +1360,9 @@ def _parse_params(self, elem: XML_Element) -> dict:
"""Parse INCAR parameters."""
params: dict = {}
for c in elem:
name = c.attrib.get("name", "")
# VASP 6.4.3 can add trailing whitespace
# for example, <i type="string" name="GGA ">PE</i>
name = c.attrib.get("name", "").strip()
if c.tag not in {"i", "v"}:
p = self._parse_params(c)
if name == "response functions":
Expand Down

0 comments on commit b0d9946

Please sign in to comment.