@@ -163,13 +163,18 @@ cdef class HeatCapacityModel(RMGObject):
163163
164164 Tdata = [300 ,400 ,500 ,600 ,800 ,1000 ,1500 ,2000 ]
165165 for T in Tdata:
166- if not (0.8 < self .get_heat_capacity(T) / other.get_heat_capacity(T) < 1.25 ):
166+ # Do exact comparison in addition to relative in case both are zero (surface site)
167+ if self .get_heat_capacity(T) != other.get_heat_capacity(T) and \
168+ not (0.8 < self .get_heat_capacity(T) / other.get_heat_capacity(T) < 1.25 ):
167169 return False
168- elif not (0.8 < self .get_enthalpy(T) / other.get_enthalpy(T) < 1.25 ):
170+ elif self .get_enthalpy(T) != other.get_enthalpy(T) and \
171+ not (0.8 < self .get_enthalpy(T) / other.get_enthalpy(T) < 1.25 ):
169172 return False
170- elif not (0.8 < self .get_entropy(T) / other.get_entropy(T) < 1.25 ):
173+ elif self .get_entropy(T) != other.get_entropy(T) and \
174+ not (0.8 < self .get_entropy(T) / other.get_entropy(T) < 1.25 ):
171175 return False
172- elif not (0.8 < self .get_free_energy(T) / other.get_free_energy(T) < 1.25 ):
176+ elif self .get_free_energy(T) != other.get_free_energy(T) and \
177+ not (0.8 < self .get_free_energy(T) / other.get_free_energy(T) < 1.25 ):
173178 return False
174179
175180 return True
@@ -185,13 +190,18 @@ cdef class HeatCapacityModel(RMGObject):
185190
186191 Tdata = [300 ,400 ,500 ,600 ,800 ,1000 ,1500 ,2000 ]
187192 for T in Tdata:
188- if not (0.95 < self .get_heat_capacity(T) / other.get_heat_capacity(T) < 1.05 ):
193+ # Do exact comparison in addition to relative in case both are zero (surface site)
194+ if self .get_heat_capacity(T) != other.get_heat_capacity(T) and \
195+ not (0.95 < self .get_heat_capacity(T) / other.get_heat_capacity(T) < 1.05 ):
189196 return False
190- elif not (0.95 < self .get_enthalpy(T) / other.get_enthalpy(T) < 1.05 ):
197+ elif self .get_enthalpy(T) != other.get_enthalpy(T) and \
198+ not (0.95 < self .get_enthalpy(T) / other.get_enthalpy(T) < 1.05 ):
191199 return False
192- elif not (0.95 < self .get_entropy(T) / other.get_entropy(T) < 1.05 ):
200+ elif self .get_entropy(T) != other.get_entropy(T) and \
201+ not (0.95 < self .get_entropy(T) / other.get_entropy(T) < 1.05 ):
193202 return False
194- elif not (0.95 < self .get_free_energy(T) / other.get_free_energy(T) < 1.05 ):
203+ elif self .get_free_energy(T) != other.get_free_energy(T) and \
204+ not (0.95 < self .get_free_energy(T) / other.get_free_energy(T) < 1.05 ):
195205 return False
196206
197207 return True
0 commit comments