Skip to content

Commit

Permalink
Reverses the recipe actions for reverse templates
Browse files Browse the repository at this point in the history
Recipes that decrement THEN break a bond, when reversed
must create THEN increment the bond, not increment
then create. i.e. the recipe steps must be played backwards
in order.

reversing the loop, suggested by mliu49.
  • Loading branch information
mazeau authored and mliu49 committed Dec 4, 2019
1 parent e3caa05 commit b691b45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rmgpy/data/kinetics/family.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def get_reverse(self):
of the reaction that this is the recipe for.
"""
other = ReactionRecipe()
for action in self.actions:
for action in reversed(self.actions): # Play the reverse recipe in the reverse order
if action[0] == 'CHANGE_BOND':
other.add_action(['CHANGE_BOND', action[1], str(-int(action[2])), action[3]])
elif action[0] == 'FORM_BOND':
Expand Down

0 comments on commit b691b45

Please sign in to comment.