Skip to content

Commit

Permalink
Adjustments to Arkane's prettify calls
Browse files Browse the repository at this point in the history
  • Loading branch information
alongd committed Oct 3, 2019
1 parent 5f72f0e commit 0d298b7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 22 deletions.
2 changes: 1 addition & 1 deletion arkane/kinetics.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def write_output(self, output_directory):
f.write('# k_rev (TST) = {0} \n'.format(kinetics_0_rev))
f.write('# k_rev (TST+T) = {0} \n\n'.format(kinetics_rev))
# Reaction path degeneracy is INCLUDED in the kinetics itself!
rxn_str = 'kinetics(label={0!r}, kinetics={1!r})'.format(reaction.label, reaction.kinetics)
rxn_str = 'kinetics(label={0!r},\n kinetics={1!r})'.format(reaction.label, reaction.kinetics)
f.write('{0}\n\n'.format(prettify(rxn_str)))

f.close()
Expand Down
11 changes: 5 additions & 6 deletions arkane/pdep.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,12 +527,11 @@ def save(self, output_file):
f.write('=========== ' * Pcount)
f.write('\n')

string = 'pdepreaction(reactants={0!r}, products={1!r}, kinetics={2!r})'.format(
[reactant.label for reactant in reaction.reactants],
[product.label for product in reaction.products],
reaction.kinetics,
)
pdep_function = '{0}\n\n'.format(prettify(string))
string = 'pdepreaction(reactants={0!r},\n products={1!r},' \
'\n kinetics={2!r})'.format([reactant.label for reactant in reaction.reactants],
[product.label for product in reaction.products],
reaction.kinetics)
pdep_function = prettify(string) + '\n\n'
if duplicate:
# add comments to the start of the string
pdep_function = '# ' + pdep_function.replace('\n', '\n# ')
Expand Down
15 changes: 1 addition & 14 deletions arkane/statmech.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,20 +694,7 @@ def write_output(self, output_directory):
y = coordinates[i, 1]
z = coordinates[i, 2]
f.write('# {0} {1:9.4f} {2:9.4f} {3:9.4f}\n'.format(symbol_by_number[number[i]], x, y, z))

result = 'conformer(label={0!r}, E0={1!r}, modes={2!r}, spin_multiplicity={3:d}, optical_isomers={4:d}'.format(
self.species.label,
conformer.E0,
conformer.modes,
conformer.spin_multiplicity,
conformer.optical_isomers,
)
try:
result += ', frequency={0!r}'.format(self.species.frequency)
except AttributeError:
pass
result += ')'
f.write('{0}\n\n'.format(prettify(result)))
f.write(f'\n\n# Conformer for {self.species.label}:\n{prettify(self.species.conformer.as_dict())}\n\n\n')
f.close()

def create_hindered_rotor_figure(self, angle, v_list, cosine_rotor, fourier_rotor, rotor, rotor_index):
Expand Down
2 changes: 1 addition & 1 deletion arkane/thermo.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def write_output(self, output_directory):
logging.debug("Valid thermo for {0} is outside range for temperature {1}".format(species, T))
f.write('# =========== =========== =========== =========== ===========\n')

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

def write_chemkin(self, output_directory):
Expand Down

0 comments on commit 0d298b7

Please sign in to comment.