Skip to content

Commit

Permalink
Small efficiency gain checking for charged species.
Browse files Browse the repository at this point in the history
I couldn't help myself, while doing code review.
  • Loading branch information
rwest authored and ssun30 committed Nov 24, 2024
1 parent 53059fe commit aca0b34
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rmgpy/data/kinetics/family.py
Original file line number Diff line number Diff line change
Expand Up @@ -1701,9 +1701,9 @@ def _create_reaction(self, reactants, products, is_forward):
)

if not self.allow_charged_species:
charged_species = [spc for spc in (reaction.reactants + reaction.products) if spc.get_net_charge() != 0]
if charged_species:
return None
for spc in (reaction.reactants + reaction.products):
if spc.get_net_charge() != 0:
return None

if not reaction.is_balanced():
return None
Expand Down

0 comments on commit aca0b34

Please sign in to comment.