From 3aea3e5a5fe228f23166ec12e50cc4fbace2f847 Mon Sep 17 00:00:00 2001 From: Connie Gao Date: Tue, 20 Aug 2013 13:26:53 -0400 Subject: [PATCH] Do not add reverse reaction if it already exists. If forward reaction has the same template, then do not include it; if not, then we have found an additional transition state and the reaction should be included. Do not include any reverse reactions if the family has its own reverse otherwise we are including kinetics for more than one direction. --- rmgpy/rmg/model.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rmgpy/rmg/model.py b/rmgpy/rmg/model.py index df360512ee0..159d5653a05 100644 --- a/rmgpy/rmg/model.py +++ b/rmgpy/rmg/model.py @@ -478,13 +478,12 @@ def checkForExistingReaction(self, rxn): # Now use short-list to check for matches. All should be in same forward direction. for rxn0 in my_reactionList: if (rxn0.reactants == rxn.reactants and rxn0.products == rxn.products): - if rxn0.template == rxn.template: + if set(rxn0.template) == set(rxn.template): return True, rxn0 if isinstance(family,KineticsFamily) and family.ownReverse: if (rxn0.reactants == rxn.products and rxn0.products == rxn.reactants): - if rxn0.template == rxn.template: - return True, rxn0 + return True, rxn0 # Now check seed mechanisms # We want to check for duplicates in *other* seed mechanisms, but allow