Skip to content

Commit 37b31eb

Browse files
rwestbjkreitz
authored andcommitted
Restore the atom labels to every molecule.
I think this part that puts the atom labels back should probably be inside the loop where we took them off so that all the molecules get their labels back.
1 parent 2e3fd4e commit 37b31eb

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

rmgpy/data/thermo.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1640,6 +1640,13 @@ def lowest_energy(species):
16401640
add_thermo_data(thermo, adsorption_thermo, group_additivity=True)
16411641

16421642
resonance_data.append(thermo)
1643+
# if the molecule had labels, reapply them
1644+
for label, atom in labeled_atoms.items():
1645+
if isinstance(atom,list):
1646+
for a in atom:
1647+
a.label = label
1648+
else:
1649+
atom.label = label
16431650

16441651
# Get the enthalpy of formation of every adsorbate at 298 K and determine the resonance structure with the lowest enthalpy of formation
16451652
# We assume that the lowest enthalpy of formation is the correct thermodynamic property for the adsorbate
@@ -1656,14 +1663,6 @@ def lowest_energy(species):
16561663

16571664
find_cp0_and_cpinf(species, thermo)
16581665

1659-
# if the molecule had labels, reapply them
1660-
for label,atom in labeled_atoms.items():
1661-
if isinstance(atom,list):
1662-
for a in atom:
1663-
a.label = label
1664-
else:
1665-
atom.label = label
1666-
16671666
return thermo
16681667

16691668
def _add_adsorption_correction(self, adsorption_thermo, adsorption_groups, molecule, surface_sites):

0 commit comments

Comments
 (0)