Skip to content

Commit c05aeb5

Browse files
authored
Merge pull request #2595 from donerancl/gaussian_regex
Change method for loading energies from Gaussian log files to regex search to avoid errors
2 parents 9749453 + 4889ca0 commit c05aeb5

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

.github/workflows/CI.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ jobs:
167167
id: regression-execution
168168
timeout-minutes: 60
169169
run: |
170-
for regr_test in aromatics liquid_oxidation nitrogen oxidation sulfur superminimal RMS_constantVIdealGasReactor_superminimal RMS_CSTR_liquid_oxidation RMS_liquidSurface_ch4o2cat fragment RMS_constantVIdealGasReactor_fragment minimal_surface;
170+
for regr_test in aromatics liquid_oxidation nitrogen oxidation sulfur superminimal RMS_constantVIdealGasReactor_superminimal RMS_CSTR_liquid_oxidation RMS_liquidSurface_ch4o2cat fragment RMS_constantVIdealGasReactor_fragment;
171171
do
172172
if python-jl rmg.py test/regression/"$regr_test"/input.py; then
173173
echo "$regr_test" "Executed Successfully"
@@ -230,7 +230,7 @@ jobs:
230230
# the stable regression results
231231
run-id: ${{ env.CI_RUN_ID }}
232232
repository: ReactionMechanismGenerator/RMG-Py
233-
github-token: ${{ secrets.GH_PAT }}
233+
github-token: ${{ secrets.GITHUB_TOKEN }}
234234
name: stable_regression_results
235235
path: stable_regression_results
236236

@@ -243,7 +243,7 @@ jobs:
243243
run: |
244244
exec 2> >(tee -a regression.stderr >&2) 1> >(tee -a regression.stdout)
245245
mkdir -p "test/regression-diff"
246-
for regr_test in aromatics liquid_oxidation nitrogen oxidation sulfur superminimal RMS_constantVIdealGasReactor_superminimal RMS_CSTR_liquid_oxidation fragment RMS_constantVIdealGasReactor_fragment minimal_surface;
246+
for regr_test in aromatics liquid_oxidation nitrogen oxidation sulfur superminimal RMS_constantVIdealGasReactor_superminimal RMS_CSTR_liquid_oxidation fragment RMS_constantVIdealGasReactor_fragment;
247247
do
248248
echo ""
249249
echo "### Regression test $regr_test:"

arkane/ess/gaussian.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import logging
3636
import math
3737
import os.path
38-
38+
import re
3939
import numpy as np
4040

4141
import rmgpy.constants as constants
@@ -309,9 +309,8 @@ def load_energy(self, zpe_scale_factor=1.):
309309
with open(self.path, 'r') as f:
310310
line = f.readline()
311311
while line != '':
312-
313312
if 'SCF Done:' in line:
314-
e_elect = float(line.split()[4]) * constants.E_h * constants.Na
313+
e_elect = float(re.findall(r"SCF Done: E\(.+\) \=\s+[^\s]+", line)[0].split()[-1]) * constants.E_h * constants.Na
315314
elect_energy_source = 'SCF'
316315
elif ' E2(' in line and ' E(' in line:
317316
e_elect = float(line.split()[-1].replace('D', 'E')) * constants.E_h * constants.Na
@@ -351,7 +350,6 @@ def load_energy(self, zpe_scale_factor=1.):
351350
# G4MP2 calculation without opt and freq calculation
352351
# Keyword in Gaussian G4MP2(SP), No zero-point or thermal energies are included.
353352
e_elect = float(line.split()[2]) * constants.E_h * constants.Na
354-
355353
# Read the ZPE from the "E(ZPE)=" line, as this is the scaled version.
356354
# Gaussian defines the following as
357355
# E (0 K) = Elec + E(ZPE),

0 commit comments

Comments
 (0)