Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions rmgpy/data/thermo.py
Original file line number Diff line number Diff line change
Expand Up @@ -1738,13 +1738,23 @@ def __addGroupThermoData(self, thermoData, database, molecule, atom):
if node is None:
raise DatabaseError('Unable to determine thermo parameters for {0}: no data for node {1} or any of its ancestors.'.format(molecule, node0) )

data = node.data; comment = node.label
while isinstance(data, basestring) and data is not None:
for entry in database.entries.values():
data = node.data
comment = node.label
loop_count = 0
while isinstance(data, basestring):
loop_count += 1
if loop_count > 100:
raise DatabaseError("Maximum iterations reached while following thermo group data pointers. A circular"
" reference may exist. Last node was {0} pointing to group called {1} in "
"database {2}".format(node.label, data, database.label))

for entry in database.entries.itervalues():
if entry.label == data:
data = entry.data
comment = entry.label
break
else:
raise DatabaseError("Node {0} points to a non-existant group called {1} in database: {2}".format(node.label, data, database.label))
data.comment = '{0}({1})'.format(database.label, comment)

# This code prints the hierarchy of the found node; useful for debugging
Expand Down