Skip to content

Commit

Permalink
Rename reserved word string in Cantherm thermo.py
Browse files Browse the repository at this point in the history
  • Loading branch information
alongd committed Jul 4, 2018
1 parent f100c03 commit 322feb1
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions rmgpy/cantherm/thermo.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ def generateThermo(self):
else:
species.thermo = wilhoit


def save(self, outputFile):
"""
Save the results of the thermodynamics job to the file located
Expand Down Expand Up @@ -168,11 +169,11 @@ def save(self, outputFile):
f.write('# {0:11g} {1:11.3f} {2:11.3f} {3:11.3f} {4:11.3f}\n'.format(T, Cp, H, S, G))
f.write('# =========== =========== =========== =========== ===========\n')

string = 'thermo(label={0!r}, thermo={1!r})'.format(species.label, species.getThermoData())
f.write('{0}\n\n'.format(prettify(string)))
thermo_string = 'thermo(label={0!r}, thermo={1!r})'.format(species.label, species.getThermoData())
f.write('{0}\n\n'.format(prettify(thermo_string)))

f.close()
# write chemkin file
# write Chemkin file
f = open(os.path.join(os.path.dirname(outputFile), 'chem.inp'), 'a')
if isinstance(species, Species):
if species.molecule and isinstance(species.molecule[0], Molecule):
Expand All @@ -184,17 +185,17 @@ def save(self, outputFile):
elementCounts = {'C': 0, 'H': 0}
else:
elementCounts = {'C': 0, 'H': 0}
string = writeThermoEntry(species, elementCounts=elementCounts, verbose=False)
f.write('{0}\n'.format(string))
chemkin_thermo_string = writeThermoEntry(species, elementCounts=elementCounts, verbose=False)
f.write('{0}\n'.format(chemkin_thermo_string))
f.close()

# write species dictionary
f = open(os.path.join(os.path.dirname(outputFile), 'species_dictionary.txt'), 'a')
if isinstance(species, Species):
if species.molecule and isinstance(species.molecule[0], Molecule):
f = open(os.path.join(os.path.dirname(outputFile), 'species_dictionary.txt'), 'a')
f.write(species.molecule[0].toAdjacencyList(removeH=False,label=species.label))
f.write('\n')
f.close()
f.close()
return chemkin_thermo_string

def plot(self, outputDirectory):
Expand Down

0 comments on commit 322feb1

Please sign in to comment.