Skip to content

Commit 741fa26

Browse files
committed
Fixes ZPE extraction when 'Eh' is present
Addresses an issue where the zero-point energy (ZPE) extraction fails when the "Eh" unit is explicitly present in the line. Improves the parsing logic to correctly identify and extract the ZPE value, regardless of whether the "Eh" unit is present or not.
1 parent 1039e88 commit 741fa26

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

arc/parser/adapters/orca.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,11 @@ def parse_zpe_correction(self) -> Optional[float]:
224224
if 'Zero point energy' in line:
225225
# Example: Zero point energy ... 0.025410 Eh
226226
try:
227-
zpe = float(line.split()[-2])
227+
parts = line.split()
228+
if 'Eh' in parts:
229+
zpe = float(parts[parts.index('Eh') - 1])
230+
else:
231+
zpe = float(parts[-2])
228232
break
229233
except (ValueError, IndexError):
230234
continue

0 commit comments

Comments
 (0)