Skip to content

Commit aa8b53a

Browse files
author
Pierre Bhoorasingh
committed
Merge pull request #214 from wking/no-_E0
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.
2 parents 263e613 + ac89738 commit aa8b53a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

rmgpy/reaction.py

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -765,10 +765,10 @@ def calculateTSTRateCoefficient(self, T):
765765
for spec in self.reactants:
766766
logging.debug(' Calculating Partition function for ' + spec.label)
767767
Qreac *= spec.getPartitionFunction(T) / (constants.R * T / 101325.)
768-
E0 -= spec.conformer._E0.value_si
768+
E0 -= spec.conformer.E0.value_si
769769
logging.debug(' Calculating Partition function for ' + self.transitionState.label)
770770
Qts = self.transitionState.getPartitionFunction(T) / (constants.R * T / 101325.)
771-
E0 += self.transitionState.conformer._E0.value_si
771+
E0 += self.transitionState.conformer.E0.value_si
772772
k = (constants.kB * T / constants.h * Qts / Qreac) * math.exp(-E0 / constants.R / T)
773773

774774
# Apply tunneling correction

rmgpy/species.py

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ def getEnthalpy(self, T):
285285
if self.hasThermo():
286286
H = self.thermo.getEnthalpy(T)
287287
elif self.hasStatMech():
288-
H = self.conformer.getEnthalpy(T) + self.conformer._E0.value_si
288+
H = self.conformer.getEnthalpy(T) + self.conformer.E0.value_si
289289
else:
290290
raise Exception('Unable to calculate enthalpy for species {0!r}: no thermo or statmech data available.'.format(self.label))
291291
return H
@@ -315,7 +315,7 @@ def getFreeEnergy(self, T):
315315
if self.hasThermo():
316316
G = self.thermo.getFreeEnergy(T)
317317
elif self.hasStatMech():
318-
G = self.conformer.getFreeEnergy(T) + self.conformer._E0.value_si
318+
G = self.conformer.getFreeEnergy(T) + self.conformer.E0.value_si
319319
else:
320320
raise Exception('Unable to calculate free energy for species {0!r}: no thermo or statmech data available.'.format(self.label))
321321
return G

0 commit comments

Comments
 (0)