Skip to content

Commit acccd69

Browse files
committed
Fix ring correction searching in group additive thermo estimator.
The new method of storing bonds on atoms requires this change. Closes #81. NB. Ring corrections are searched using a molecule fragment with only the ring and no adjoining atoms. If a ring correction definition depends on ligands, it will not be found. (This is not a change in this commit, just an observation)
1 parent d177753 commit acccd69

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

rmgpy/data/thermo.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -732,14 +732,17 @@ def estimateThermoViaGroupAdditivity(self, molecule):
732732
# each ring one time; this doesn't work yet
733733
rings = molecule.getSmallestSetOfSmallestRings()
734734
for ring in rings:
735-
736735
# Make a temporary structure containing only the atoms in the ring
736+
# NB. if any of the ring corrections depend on ligands not in the ring, they will not be found!
737737
ringStructure = Molecule()
738-
for atom in ring: ringStructure.addAtom(atom)
738+
newAtoms = dict()
739+
for atom in ring:
740+
newAtoms[atom] = atom.copy()
741+
ringStructure.addAtom(newAtoms[atom]) # (addAtom deletes the atom's bonds)
739742
for atom1 in ring:
740743
for atom2 in ring:
741744
if molecule.hasBond(atom1, atom2):
742-
ringStructure.addBond(atom1, atom2, molecule.getBond(atom1, atom2))
745+
ringStructure.addBond(Bond(newAtoms[atom1], newAtoms[atom2], atom1.bonds[atom2].order ))
743746

744747
# Get thermo correction for this ring
745748
try:

0 commit comments

Comments
 (0)