ReactionMechanismGenerator / RMG-Py

Python version of the amazing Reaction Mechanism Generator (RMG).
http://reactionmechanismgenerator.github.io/RMG-Py/
Other
400 stars 228 forks source link

Surface site thermo gets wrong answer when calling thermo.is_identical() #2657

Closed sevyharris closed 6 months ago

sevyharris commented 6 months ago

Bug Description

Surface site thermo is represented with all zeros for the NASA polynomial, but when you call thermo.is_identical_to() or thermo.is_similar_to() on two thermo models that are both all zeros, it returns False because there's a divide by zero in there.

How To Reproduce

Here's a miniscipt demonstrating the problem:

import os
import rmgpy.data.thermo
import rmgpy

library_path = os.path.join(rmgpy.settings['database.directory'], 'thermo')
database = rmgpy.data.thermo.ThermoDatabase()
database.load(
    library_path,
    libraries = ['surfaceThermoPt111']
)

X_thermo_data = database.libraries['surfaceThermoPt111'].entries['vacant'].data
print(X_thermo_data)
print(X_thermo_data.is_identical_to(X_thermo_data))
print(X_thermo_data.is_similar_to(X_thermo_data))

Expected Behavior

Even though it's all zeros, the thermo data object should be returning True when checking if it's identical to itself.

Additional Context

This matters because the surface regression test will fail if it compares vacant sites to each other.