Skip to content

Commit 426c55e

Browse files
authored
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
1 parent 33bd6f2 commit 426c55e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

rmgpy/reaction.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -348,13 +348,13 @@ def to_cantera(self, species_list=None, use_chemkin_identifier=False):
348348

349349
elif isinstance(self.kinetics, ThirdBody):
350350
# Cantera 3 doesn't have a ThirdBody class, only third body attribute in the normal class
351-
if ct_collider is not None:
351+
if ct_collider:
352352
ct_reaction = ct.Reaction(reactants=ct_reactants, products=ct_products, third_body=ct_collider, rate=ct.ArrheniusRate())
353353
else: # provide the default collider (if we don't have one) to establish this as a ThirdBody reaction
354354
ct_reaction = ct.Reaction(reactants=ct_reactants, products=ct_products, third_body=ct.ThirdBody(), rate=ct.ArrheniusRate())
355355

356356
elif isinstance(self.kinetics, Troe):
357-
if ct_collider is not None:
357+
if ct_collider:
358358
ct_reaction = ct.Reaction(
359359
reactants=ct_reactants,
360360
products=ct_products,
@@ -369,7 +369,7 @@ def to_cantera(self, species_list=None, use_chemkin_identifier=False):
369369
)
370370

371371
elif isinstance(self.kinetics, Lindemann):
372-
if ct_collider is not None:
372+
if ct_collider:
373373
ct_reaction = ct.Reaction(
374374
reactants=ct_reactants,
375375
products=ct_products,

0 commit comments

Comments
 (0)