Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix LNONCOLLINEAR match in Outcar parser #4034

Merged
merged 8 commits into from
Sep 4, 2024
Prev Previous commit
Next Next commit
avoid hard coding number of spaces
  • Loading branch information
DanielYang59 committed Sep 3, 2024
commit 92b79f606784f37497964b62b94bb72476c2746b
8 changes: 4 additions & 4 deletions src/pymatgen/io/vasp/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2107,7 +2107,7 @@ def __init__(self, filename: PathLike) -> None:

# Check if calculation is spin polarized
self.spin = False
self.read_pattern({"spin": "ISPIN = 2"})
self.read_pattern({"spin": r"ISPIN\s*=\s*2"})
if self.data.get("spin", []):
self.spin = True

Expand All @@ -2130,7 +2130,7 @@ def __init__(self, filename: PathLike) -> None:

# Check if LEPSILON is True and read piezo data if so
self.lepsilon = False
self.read_pattern({"epsilon": "LEPSILON= T"})
self.read_pattern({"epsilon": r"LEPSILON\s*=\s*T"})
if self.data.get("epsilon", []):
self.lepsilon = True
self.read_lepsilon()
Expand All @@ -2140,7 +2140,7 @@ def __init__(self, filename: PathLike) -> None:

# Check if LCALCPOL is True and read polarization data if so
self.lcalcpol = False
self.read_pattern({"calcpol": "LCALCPOL = T"})
self.read_pattern({"calcpol": r"LCALCPOL\s*=\s*T"})
if self.data.get("calcpol", []):
self.lcalcpol = True
self.read_lcalcpol()
Expand All @@ -2155,7 +2155,7 @@ def __init__(self, filename: PathLike) -> None:
self.read_electrostatic_potential()

self.nmr_cs = False
self.read_pattern({"nmr_cs": r"LCHIMAG = (T)"})
self.read_pattern({"nmr_cs": r"LCHIMAG\s*=\s*(T)"})
if self.data.get("nmr_cs"):
self.nmr_cs = True
self.read_chemical_shielding()
Expand Down