Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make ck2cti more deterministic in it's output #497

Merged
merged 2 commits into from
Jan 24, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions interfaces/cython/cantera/ck2cti.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def __str__(self):
def to_cti(self, indent=0):
lines = []
atoms = ' '.join('{0}:{1}'.format(*a)
for a in self.composition.items())
for a in sorted(self.composition.items()))

prefix = ' '*(indent+8)

Expand Down Expand Up @@ -309,7 +309,7 @@ def to_cti(self, indent=0):

if self.fwdOrders:
order = ' '.join('{0}:{1}'.format(k,v)
for (k,v) in self.fwdOrders.items())
for (k,v) in sorted(self.fwdOrders.items()))
kinstr = kinstr[:-1] + ",\n{0}order='{1}')".format(k_indent, order)

if self.ID:
Expand Down Expand Up @@ -379,7 +379,7 @@ def options(self):

def efficiencyString(self):
return ' '.join('{0}:{1}'.format(mol, eff)
for mol, eff in self.efficiencies.items())
for mol, eff in sorted(self.efficiencies.items()))


class KineticsData(KineticsModel):
Expand Down Expand Up @@ -2079,7 +2079,7 @@ def writeCTI(self, header=None, name='gas', transportModel='Mix',
lines.append('# Element data')
lines.append(delimiterLine)
lines.append('')
for name, weight in self.element_weights.items():
for name, weight in sorted(self.element_weights.items()):
lines.append('element(symbol={0!r}, atomic_mass={1})'.format(name, weight))

# Write the individual species data
Expand Down