From 5ca49efff1b99b258741038679fde59afb452530 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Wed, 29 Oct 2014 23:32:04 +0000 Subject: [PATCH] [ck2cti] Adjust number of species per line dynamically --- interfaces/cython/cantera/ck2cti.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/interfaces/cython/cantera/ck2cti.py b/interfaces/cython/cantera/ck2cti.py index 1bf24e5c1..008960213 100644 --- a/interfaces/cython/cantera/ck2cti.py +++ b/interfaces/cython/cantera/ck2cti.py @@ -1731,8 +1731,10 @@ class Parser(object): raise InputParseError('Undefined elements: ' + str(missingElements)) speciesNames = [''] + speciesPerLine = max(int((80-21)/(speciesNameLength + 2)), 1) + for i,s in enumerate(self.speciesList): - if i and not i % 5: + if i and not i % speciesPerLine: speciesNames.append(' '*21) speciesNames[-1] += '{0:{1}s}'.format(s.label, speciesNameLength+2)