Skip to content

Commit

Permalink
Do not add reverse reaction if it already exists.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
connie committed Jan 5, 2015
1 parent 6519be4 commit 3aea3e5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions rmgpy/rmg/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3aea3e5

Please sign in to comment.