Skip to content

Commit 09a39e9

Browse files
committed
Make check explicitly 'not None'.
The only way r would be 'None' is if a symmetrical reaction (reactants == products) was found in a library, and hit this check in check_for_existing_reaction that's called by make_new_reaction. But that suggests some other problem. So I doubt this test is often needed. But Matt added it for something. I can't see any way it would be False, so now we check it's not None. (as requested in code review)
1 parent 6071531 commit 09a39e9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

rmgpy/rmg/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1712,8 +1712,8 @@ def add_reaction_library_to_edge(self, reaction_library):
17121712
kinetics=rxn.kinetics, duplicate=rxn.duplicate,
17131713
reversible=rxn.reversible
17141714
)
1715-
if r and getattr(r.kinetics, 'coverage_dependence', None):
17161715
r, isNew = self.make_new_reaction(rxn) # updates self.new_species_list and self.new_reaction_list
1716+
if r is not None and getattr(rxn.kinetics, 'coverage_dependence', None):
17171717
self.process_coverage_dependence(r.kinetics)
17181718
if not isNew:
17191719
logging.info("This library reaction was not new: {0}".format(rxn))

0 commit comments

Comments
 (0)