From 426c55e3e00aa6f88e7cd53fbc690b34193c1bbe Mon Sep 17 00:00:00 2001 From: Jackson Burns <33505528+JacksonBurns@users.noreply.github.com> Date: Sun, 26 Jan 2025 22:37:11 -0500 Subject: [PATCH] collider is never None - must change test (See ext) passing an empty dict for third_body results in the attribute being None, but we need it to just be an unpopulated ThirdBody to indicate that the Reaction is a third body reaction --- rmgpy/reaction.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rmgpy/reaction.py b/rmgpy/reaction.py index ec742be959..cffc774b4c 100644 --- a/rmgpy/reaction.py +++ b/rmgpy/reaction.py @@ -348,13 +348,13 @@ def to_cantera(self, species_list=None, use_chemkin_identifier=False): elif isinstance(self.kinetics, ThirdBody): # Cantera 3 doesn't have a ThirdBody class, only third body attribute in the normal class - if ct_collider is not None: + if ct_collider: ct_reaction = ct.Reaction(reactants=ct_reactants, products=ct_products, third_body=ct_collider, rate=ct.ArrheniusRate()) else: # provide the default collider (if we don't have one) to establish this as a ThirdBody reaction ct_reaction = ct.Reaction(reactants=ct_reactants, products=ct_products, third_body=ct.ThirdBody(), rate=ct.ArrheniusRate()) elif isinstance(self.kinetics, Troe): - if ct_collider is not None: + if ct_collider: ct_reaction = ct.Reaction( reactants=ct_reactants, products=ct_products, @@ -369,7 +369,7 @@ def to_cantera(self, species_list=None, use_chemkin_identifier=False): ) elif isinstance(self.kinetics, Lindemann): - if ct_collider is not None: + if ct_collider: ct_reaction = ct.Reaction( reactants=ct_reactants, products=ct_products,