From e633bb80e962c73ee2e24911a2205a24c68fcc91 Mon Sep 17 00:00:00 2001 From: Nick Date: Tue, 23 Jan 2018 16:46:07 -0500 Subject: [PATCH 1/2] make ck2cti more deterministic in it's output --- interfaces/cython/cantera/ck2cti.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/interfaces/cython/cantera/ck2cti.py b/interfaces/cython/cantera/ck2cti.py index aad028c861..440f093034 100644 --- a/interfaces/cython/cantera/ck2cti.py +++ b/interfaces/cython/cantera/ck2cti.py @@ -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) @@ -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: @@ -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): @@ -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 From aa10e583fb104b7b1535ef16fa914b426e9a480f Mon Sep 17 00:00:00 2001 From: Nick Date: Tue, 23 Jan 2018 17:10:05 -0500 Subject: [PATCH 2/2] missing parenthesis --- interfaces/cython/cantera/ck2cti.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interfaces/cython/cantera/ck2cti.py b/interfaces/cython/cantera/ck2cti.py index 440f093034..0264b7dc28 100644 --- a/interfaces/cython/cantera/ck2cti.py +++ b/interfaces/cython/cantera/ck2cti.py @@ -117,7 +117,7 @@ def __str__(self): def to_cti(self, indent=0): lines = [] atoms = ' '.join('{0}:{1}'.format(*a) - for a in sorted(self.composition.items()) + for a in sorted(self.composition.items())) prefix = ' '*(indent+8)