Skip to content

Commit

Permalink
Fix bug in KineticsModel.isIdenticalTo
Browse files Browse the repository at this point in the history
This method just checks that Tmin and Tmax are equal.
But if they were equal, it used to return False.

Now it returns False if one or other is None, or they're
different. Note, however, that because the Quantity.equals
method defaults to a 1% tolerance, that's 20K difference
needed at 2000K.
  • Loading branch information
rwest authored and mliu49 committed Sep 27, 2019
1 parent 1a17c44 commit 1cd2cd6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rmgpy/kinetics/model.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -230,15 +230,15 @@ cdef class KineticsModel:
Returns ``True`` if Tmin, Tmax for both objects match.
Otherwise returns ``False``
"""
if self.Tmin is not None and other_kinetics.Tmin is not None and not self.Tmin.equals(other_kinetics.Tmin):
return False
if self.Tmin is not None and other_kinetics.Tmin is not None and self.Tmin.equals(other_kinetics.Tmin):
pass
elif self.Tmin is None and other_kinetics.Tmin is None:
pass
else:
return False

if self.Tmax is not None and other_kinetics.Tmax is not None and not self.Tmax.equals(other_kinetics.Tmax):
return False
if self.Tmax is not None and other_kinetics.Tmax is not None and self.Tmax.equals(other_kinetics.Tmax):
pass
elif self.Tmax is None and other_kinetics.Tmax is None:
pass
else:
Expand Down

0 comments on commit 1cd2cd6

Please sign in to comment.