Skip to content

Commit

Permalink
trying to pass training reaction metal attributes into thermo calcula…
Browse files Browse the repository at this point in the history
…tions
  • Loading branch information
mazeau committed Sep 9, 2020
1 parent 162305d commit 34aa030
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions rmgpy/data/kinetics/family.py
Expand Up @@ -3829,12 +3829,18 @@ def fix_labels_mol(mol, root_labels):
for j, react in enumerate(r.item.reactants):
if rxns[i].reactants[j].thermo is None:
react.generate_resonance_structures()
rxns[i].reactants[j].thermo = tdb.get_thermo_data(react)
if r.metal:
rxns[i].reactants[j].thermo = tdb.get_thermo_data(react, metal=r.metal)
else:
rxns[i].reactants[j].thermo = tdb.get_thermo_data(react)

for j, react in enumerate(r.item.products):
if rxns[i].products[j].thermo is None:
react.generate_resonance_structures()
rxns[i].products[j].thermo = tdb.get_thermo_data(react)
if r.metal:
rxns[i].products[j].thermo = tdb.get_thermo_data(react, metal=r.metal)
else:
rxns[i].products[j].thermo = tdb.get_thermo_data(react)

rxns[i].kinetics = r.data
rxns[i].rank = r.rank
Expand Down Expand Up @@ -3911,7 +3917,10 @@ def fix_labels_mol(mol, root_labels):
if r.thermo is None:
therm_spc = deepcopy(r)
therm_spc.generate_resonance_structures()
r.thermo = tdb.get_thermo_data(therm_spc)
if r.metal:
r.thermo = tdb.get_thermo_data(therm_spc, metal=r.metal)
else:
r.thermo = tdb.get_thermo_data(therm_spc)

rev_rxns.append(rrev)

Expand Down Expand Up @@ -3952,7 +3961,10 @@ def fix_labels_mol(mol, root_labels):
if r.thermo is None:
therm_spc = deepcopy(r)
therm_spc.generate_resonance_structures()
r.thermo = tdb.get_thermo_data(therm_spc)
if r.metal:
r.thermo = tdb.get_thermo_data(therm_spc, metal=r.metal)
else:
r.thermo = tdb.get_thermo_data(therm_spc)
rxns[i] = rrev

if self.own_reverse and get_reverse:
Expand Down

0 comments on commit 34aa030

Please sign in to comment.