From 32b1bb891170929a00816e4c5aaf2488372f46f0 Mon Sep 17 00:00:00 2001 From: Richard West Date: Sat, 16 Nov 2019 23:07:14 -0500 Subject: [PATCH] Make Atom.apply_action more consistent (and slightly faster) Tiny change. Increases readability and presumably speed. --- rmgpy/molecule/molecule.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rmgpy/molecule/molecule.py b/rmgpy/molecule/molecule.py index 29022fec249..b371b0bb7be 100644 --- a/rmgpy/molecule/molecule.py +++ b/rmgpy/molecule/molecule.py @@ -490,9 +490,9 @@ def apply_action(self, action): for i in range(action[2]): self.increment_radical() elif act == 'LOSE_RADICAL': for i in range(abs(action[2])): self.decrement_radical() - elif action[0].upper() == 'GAIN_PAIR': + elif act == 'GAIN_PAIR': for i in range(action[2]): self.increment_lone_pairs() - elif action[0].upper() == 'LOSE_PAIR': + elif act == 'LOSE_PAIR': for i in range(abs(action[2])): self.decrement_lone_pairs() else: raise gr.ActionError('Unable to update Atom: Invalid action {0}".'.format(action))