From ac89738c13d4de54a89999f352db3397ba45e363 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 14 May 2014 08:23:47 -0700 Subject: [PATCH] Remove external references to Conformer._E0 In rmgpy/statmech/conformer.pyx, _E0 is the private attribute backing the public E0 property (to support an Energy cast on setting). Respect that privacy and use the public interface. --- rmgpy/reaction.py | 4 ++-- rmgpy/species.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) mode change 100644 => 100755 rmgpy/reaction.py mode change 100644 => 100755 rmgpy/species.py diff --git a/rmgpy/reaction.py b/rmgpy/reaction.py old mode 100644 new mode 100755 index 5edb29fb98..83f81fceb2 --- a/rmgpy/reaction.py +++ b/rmgpy/reaction.py @@ -765,10 +765,10 @@ def calculateTSTRateCoefficient(self, T): for spec in self.reactants: logging.debug(' Calculating Partition function for ' + spec.label) Qreac *= spec.getPartitionFunction(T) / (constants.R * T / 101325.) - E0 -= spec.conformer._E0.value_si + E0 -= spec.conformer.E0.value_si logging.debug(' Calculating Partition function for ' + self.transitionState.label) Qts = self.transitionState.getPartitionFunction(T) / (constants.R * T / 101325.) - E0 += self.transitionState.conformer._E0.value_si + E0 += self.transitionState.conformer.E0.value_si k = (constants.kB * T / constants.h * Qts / Qreac) * math.exp(-E0 / constants.R / T) # Apply tunneling correction diff --git a/rmgpy/species.py b/rmgpy/species.py old mode 100644 new mode 100755 index 2ec3caf696..4fdf54da93 --- a/rmgpy/species.py +++ b/rmgpy/species.py @@ -285,7 +285,7 @@ def getEnthalpy(self, T): if self.hasThermo(): H = self.thermo.getEnthalpy(T) elif self.hasStatMech(): - H = self.conformer.getEnthalpy(T) + self.conformer._E0.value_si + H = self.conformer.getEnthalpy(T) + self.conformer.E0.value_si else: raise Exception('Unable to calculate enthalpy for species {0!r}: no thermo or statmech data available.'.format(self.label)) return H @@ -315,7 +315,7 @@ def getFreeEnergy(self, T): if self.hasThermo(): G = self.thermo.getFreeEnergy(T) elif self.hasStatMech(): - G = self.conformer.getFreeEnergy(T) + self.conformer._E0.value_si + G = self.conformer.getFreeEnergy(T) + self.conformer.E0.value_si else: raise Exception('Unable to calculate free energy for species {0!r}: no thermo or statmech data available.'.format(self.label)) return G