From 6094f4d351602df7684aa78b8996ba954c91ece0 Mon Sep 17 00:00:00 2001 From: Matt Johnson Date: Thu, 12 Dec 2019 15:50:37 -0500 Subject: [PATCH 1/4] generate resonance structures when generating treegen training set --- rmgpy/data/kinetics/family.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/rmgpy/data/kinetics/family.py b/rmgpy/data/kinetics/family.py index d6cdcca108a..1a12b6c29d8 100644 --- a/rmgpy/data/kinetics/family.py +++ b/rmgpy/data/kinetics/family.py @@ -3798,10 +3798,12 @@ def fix_labels_mol(mol, root_labels): if estimate_thermo: 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) 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) rxns[i].kinetics = r.data @@ -3877,7 +3879,9 @@ def fix_labels_mol(mol, root_labels): if estimate_thermo: for r in rrev.reactants: if r.thermo is None: - r.thermo = tdb.get_thermo_data(deepcopy(r)) + therm_spc = deepcopy(r) + therm_spc.generate_resonance_structures() + r.thermo = tdb.get_thermo_data(therm_spc) rev_rxns.append(rrev) @@ -3916,7 +3920,9 @@ def fix_labels_mol(mol, root_labels): if estimate_thermo: for r in rrev.reactants: if r.thermo is None: - r.thermo = tdb.get_thermo_data(deepcopy(r)) + therm_spc = deepcopy(r) + therm_spc.generate_resonance_structures() + r.thermo = tdb.get_thermo_data(therm_spc) rxns[i] = rrev if self.own_reverse and get_reverse: From 1d5bb0f856d81b5e80b320f14e18a7cf62f91894 Mon Sep 17 00:00:00 2001 From: Matt Johnson Date: Thu, 12 Dec 2019 15:51:32 -0500 Subject: [PATCH 2/4] add SABIC_aromatics to the thermolibraries used in tree generation --- scripts/generateTree.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/generateTree.py b/scripts/generateTree.py index 34dd51ad552..fc9079cee50 100644 --- a/scripts/generateTree.py +++ b/scripts/generateTree.py @@ -73,7 +73,7 @@ def main(): path=dbdir, thermo_libraries=['Klippenstein_Glarborg2016', 'BurkeH2O2', 'thermo_DFT_CCSDTF12_BAC', 'DFT_QCI_thermo', 'primaryThermoLibrary', 'primaryNS', 'NitrogenCurran', 'NOx2018', 'FFCM1(-)', - 'SulfurLibrary', 'SulfurGlarborgH2S'], + 'SulfurLibrary', 'SulfurGlarborgH2S', 'SABIC_aromatics'], transport_libraries=[], reaction_libraries=[], seed_mechanisms=[], From e050d784f5a2b2a9c661500fef6c4e929ad86b5d Mon Sep 17 00:00:00 2001 From: Matt Johnson Date: Fri, 13 Dec 2019 13:38:39 -0500 Subject: [PATCH 3/4] write the autoGenerated attribute to the groups.py file when saving --- rmgpy/data/kinetics/family.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rmgpy/data/kinetics/family.py b/rmgpy/data/kinetics/family.py index 1a12b6c29d8..075996d60bf 100644 --- a/rmgpy/data/kinetics/family.py +++ b/rmgpy/data/kinetics/family.py @@ -959,6 +959,9 @@ def save_groups(self, path): f.write('reactantNum = {0}\n\n'.format(self.reactant_num)) if self.product_num is not None: f.write('productNum = {0}\n\n'.format(self.product_num)) + + if self.auto_generated is not None: + f.write('autoGenerated = {0}\n\n'.format(self.auto_generated)) # Write the recipe f.write('recipe(actions=[\n') From c1973f08ce811234d8b07193fd08b129b6b39001 Mon Sep 17 00:00:00 2001 From: Matt Johnson Date: Fri, 13 Dec 2019 15:10:50 -0500 Subject: [PATCH 4/4] add autoGenerated attribute to intra_H_migration for family save test --- .../kinetics/families/intra_H_migration/groups.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rmgpy/test_data/testing_database/kinetics/families/intra_H_migration/groups.py b/rmgpy/test_data/testing_database/kinetics/families/intra_H_migration/groups.py index d2e499e8a39..720f9d1443c 100644 --- a/rmgpy/test_data/testing_database/kinetics/families/intra_H_migration/groups.py +++ b/rmgpy/test_data/testing_database/kinetics/families/intra_H_migration/groups.py @@ -11,6 +11,8 @@ reversible = True +autoGenerated = False + recipe(actions=[ ['BREAK_BOND', '*2', 1, '*3'], ['FORM_BOND', '*1', 1, '*3'],