# rmgpy.data.thermo.ThermoDatabase¶

class rmgpy.data.thermo.ThermoDatabase

A class for working with the RMG thermodynamics database.

computeGroupAdditivityThermo(molecule)

Return the set of thermodynamic parameters corresponding to a given Molecule object molecule by estimation using the group additivity values. If no group additivity values are loaded, a DatabaseError is raised.

The entropy is not corrected for the symmetry of the molecule. This should be done later by the calling function.

estimateRadicalThermoViaHBI(molecule, stableThermoEstimator)

Estimate the thermodynamics of a radical by saturating it, applying the provided stableThermoEstimator method on the saturated species, then applying hydrogen bond increment corrections for the radical site(s) and correcting for the symmetry.

estimateThermoViaGroupAdditivity(molecule)

Return the set of thermodynamic parameters corresponding to a given Molecule object molecule by estimation using the group additivity values. If no group additivity values are loaded, a DatabaseError is raised.

extractSourceFromComments(species)

species: A species object containing thermo data and thermo data comments

Parses the verbose string of comments from the thermo data of the species object, and extracts the thermo sources.

Returns a dictionary with keys of either ‘Library’, ‘QM’, and/or ‘GAV’. Commonly, species thermo are estimated using only one of these sources. However, a radical can be estimated with more than one type of source, for instance a saturated library value and a GAV HBI correction, or a QM saturated value and a GAV HBI correction.

source = {‘Library’: String_Name_of_Library_Used,
‘QM’: String_of_Method_Used, ‘GAV’: Dictionary_of_Groups_Used }

The Dictionary_of_Groups_Used looks like {‘groupType’:[List of tuples containing (Entry, Weight)]

getAllThermoData(species)

Return all possible sets of thermodynamic parameters for a given Species object species. The hits from the depository come first, then the libraries (in order), and then the group additivity estimate. This method is useful for a generic search job.

Returns: a list of tuples (ThermoData, source, entry) (Source is a library or depository, or None)

getRingGroupsFromComments(thermoData)

Takes a string of comments from group additivity estimation, and extracts the ring and polycyclic ring groups from them, returning them as lists.

getThermoData(species, trainingSet=None)

Return the thermodynamic parameters for a given Species object species. This function first searches the loaded libraries in order, returning the first match found, before falling back to estimation via group additivity.

Returns: ThermoData

getThermoDataFromDepository(species)

Return all possible sets of thermodynamic parameters for a given Species object species from the depository. If no depository is loaded, a DatabaseError is raised.

Returns: a list of tuples (thermoData, depository, entry) without any Cp0 or CpInf data.

getThermoDataFromGroups(species)

Return the set of thermodynamic parameters corresponding to a given Species object species by estimation using the group additivity values. If no group additivity values are loaded, a DatabaseError is raised.

The resonance isomer (molecule) with the lowest H298 is used, and as a side-effect the resonance isomers (items in species.molecule list) are sorted in ascending order.

Returns: ThermoData

getThermoDataFromLibraries(species, trainingSet=None)

Return the thermodynamic parameters for a given Species object species. This function first searches the loaded libraries in order, returning the first match found, before failing and returning None. trainingSet is used to identify if function is called during training set or not. During training set calculation we want to use gas phase thermo to not affect reverse rate calculation.

Returns: ThermoData or None

getThermoDataFromLibrary(species, library)

Return the set of thermodynamic parameters corresponding to a given Species object species from the specified thermodynamics library. If library is a string, the list of libraries is searched for a library with that name. If no match is found in that library, None is returned. If no corresponding library is found, a DatabaseError is raised.

Returns a tuple: (ThermoData, library, entry) or None.

load(path, libraries=None, depository=True)

Load the thermo database from the given path on disk, where path points to the top-level folder of the thermo database.

loadDepository(path)

Load the thermo database from the given path on disk, where path points to the top-level folder of the thermo database.

loadGroups(path)

Load the thermo database from the given path on disk, where path points to the top-level folder of the thermo database.

loadLibraries(path, libraries=None)

Load the thermo database from the given path on disk, where path points to the top-level folder of the thermo database.

loadOld(path)

Load the old RMG thermo database from the given path on disk, where path points to the top-level folder of the old RMG database.

prioritizeThermo(species, thermoDataList)

Use some metrics to reorder a list of thermo data from best to worst. Return a list of indices with the desired order associated with the index of thermo from the data list.

pruneHeteroatoms(allowed=['C', 'H', 'O', 'S'])

Remove all species from thermo libraries that contain atoms other than those allowed.

This is useful before saving the database for use in RMG-Java

save(path)

Save the thermo database to the given path on disk, where path points to the top-level folder of the thermo database.

saveDepository(path)

Save the thermo depository to the given path on disk, where path points to the top-level folder of the thermo depository.

saveGroups(path)

Save the thermo groups to the given path on disk, where path points to the top-level folder of the thermo groups.

saveLibraries(path)

Save the thermo libraries to the given path on disk, where path points to the top-level folder of the thermo libraries.

saveOld(path)

Save the old RMG thermo database to the given path on disk, where path points to the top-level folder of the old RMG database.