From b691b45dd65963a2ccbdf8b256b38b34814f1e18 Mon Sep 17 00:00:00 2001 From: Emily Mazeau Date: Fri, 22 Nov 2019 16:43:29 -0500 Subject: [PATCH] Reverses the recipe actions for reverse templates 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. --- rmgpy/data/kinetics/family.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rmgpy/data/kinetics/family.py b/rmgpy/data/kinetics/family.py index 87f197251e..416744294f 100644 --- a/rmgpy/data/kinetics/family.py +++ b/rmgpy/data/kinetics/family.py @@ -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':