Skip to content

Commit

Permalink
reversing the loop, suggested by mliu49. This should make all tests p…
Browse files Browse the repository at this point in the history
…ass now
  • Loading branch information
mazeau committed Dec 3, 2019
1 parent c25a809 commit 95dc1ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 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 All @@ -258,7 +258,7 @@ def get_reverse(self):
other.add_action(['GAIN_PAIR', action[1], action[2]])
elif action[0] == 'GAIN_PAIR':
other.add_action(['LOSE_PAIR', action[1], action[2]])
other.actions = reversed(other.actions) # Play the reverse recipe in the reverse order
# other.actions = reversed(other.actions) # Play the reverse recipe in the reverse order
return other

def _apply(self, struct, forward, unique):
Expand Down

0 comments on commit 95dc1ed

Please sign in to comment.