From 937ef0bd4073f4f514e02a9b7f9b1a73f4b43a2c Mon Sep 17 00:00:00 2001 From: Richard West Date: Fri, 23 Aug 2019 16:02:50 -0400 Subject: [PATCH] Fix bug in KineticsModel.isIdenticalTo 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. --- rmgpy/kinetics/model.pyx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rmgpy/kinetics/model.pyx b/rmgpy/kinetics/model.pyx index bf7005584a..9a15b7ac02 100644 --- a/rmgpy/kinetics/model.pyx +++ b/rmgpy/kinetics/model.pyx @@ -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: