diff --git a/rmgpy/data/kinetics/common.py b/rmgpy/data/kinetics/common.py index e36e6282b43..fc0e4b632e4 100644 --- a/rmgpy/data/kinetics/common.py +++ b/rmgpy/data/kinetics/common.py @@ -198,7 +198,7 @@ def ensure_independent_atom_ids(input_species, resonance=True): Modifies the list in place (replacing :class:`Molecule` with :class:`Species`). Returns None. """ - ensure_species(input_species, resonance=resonance) + ensure_species(input_species, resonance=resonance, keep_isomorphic=True) # Method to check that all species' atom ids are different def independent_ids(): num_atoms = 0 diff --git a/rmgpy/data/kinetics/kineticsTest.py b/rmgpy/data/kinetics/kineticsTest.py index f6b2df1ab50..58d3f3322c5 100644 --- a/rmgpy/data/kinetics/kineticsTest.py +++ b/rmgpy/data/kinetics/kineticsTest.py @@ -590,6 +590,19 @@ def test_degeneracy_multiple_resonance_different_template(self): self.assertFalse(reaction_list[0].duplicate) + def test_degeneracy_resonance_keep_isomorphic(self): + """Test that we get the correct degeneracy for [CH2]C=C[CH2] + [H]. + + Incorrect results would be obtained if isomorphic resonance structures are not kept.""" + family_label = 'R_Recombination' + reactants = ['[CH2]C=C[CH2]', '[OH]'] + products = ['[CH2]C(O)C=C'] + + correct_rxn_num = 1 + correct_degeneracy = {2} + + self.assert_correct_reaction_degeneracy(reactants, correct_rxn_num, correct_degeneracy, family_label, products) + class TestKineticsCommentsParsing(unittest.TestCase):