From e37e29db0e0881ade583d84a0e1437a92450f2ee 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 746bd3b9dc5..3926b370e87 100644 --- a/rmgpy/kinetics/model.pyx +++ b/rmgpy/kinetics/model.pyx @@ -231,15 +231,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: