Skip to content

Commit

Permalink
Extra error logging in HBI thermo estimation.
Browse files Browse the repository at this point in the history
  • Loading branch information
rwest committed May 3, 2024
1 parent 355b5d4 commit 8cd7528
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions rmgpy/data/thermo.py
Original file line number Diff line number Diff line change
Expand Up @@ -2049,8 +2049,12 @@ def estimate_radical_thermo_via_hbi(self, molecule, stable_thermo_estimator):
"not {0}".format(thermo_data_sat))
thermo_data_sat = thermo_data_sat[0]
else:
thermo_data_sat = stable_thermo_estimator(saturated_struct)

try:
thermo_data_sat = stable_thermo_estimator(saturated_struct)
except DatabaseError as e:
logging.error(f"Trouble finding thermo data for saturated structure {saturated_struct.to_adjacency_list()}"
f"when trying to evaluate radical {molecule.to_adjacency_list()} via HBI.")
raise
if thermo_data_sat is None:
# We couldn't get thermo for the saturated species from libraries, ml, or qm
# However, if we were trying group additivity, this could be a problem
Expand Down Expand Up @@ -2555,9 +2559,10 @@ def _add_group_thermo_data(self, thermo_data, database, molecule, atom):
node = node0
while node is not None and node.data is None:
node = node.parent
if node is None:
if node is None:
raise DatabaseError(f'Unable to determine thermo parameters for atom {atom} in molecule {molecule}: '
f'no data for node {node0} or any of its ancestors in database {database.label}.')
f'no data for node {node0} or any of its ancestors in database {database.label}.\n' +
molecule.to_adjacency_list())

data = node.data
comment = node.label
Expand Down

0 comments on commit 8cd7528

Please sign in to comment.