diff --git a/interfaces/cython/cantera/ck2cti.py b/interfaces/cython/cantera/ck2cti.py index 33085eaef..8d1182e01 100644 --- a/interfaces/cython/cantera/ck2cti.py +++ b/interfaces/cython/cantera/ck2cti.py @@ -1564,7 +1564,7 @@ class Parser(object): if tokens[0].upper().startswith('ELEM'): inHeader = False tokens = tokens[1:] - while line is not None and not contains(line, 'END'): + while line is not None and get_index(line, 'END') is None: # Grudging support for implicit end of section start = line.strip().upper().split() if start and start[0] in ('SPEC', 'SPECIES'): @@ -1588,7 +1588,7 @@ class Parser(object): # List of species identifiers tokens = tokens[1:] inHeader = False - while line is not None and not contains(line, 'END'): + while line is not None and get_index(line, 'END') is None: # Grudging support for implicit end of section start = line.strip().upper().split() if start and start[0] in ('REAC', 'REACTIONS', 'TRAN', @@ -1638,7 +1638,7 @@ class Parser(object): surf = self.surfaces[-1] inHeader = False - while line is not None and not contains(line, 'END'): + while line is not None and get_index(line, 'END') is None: # Grudging support for implicit end of section start = line.strip().upper().split() if start and start[0] in ('REAC', 'REACTIONS', 'THER', @@ -1678,7 +1678,7 @@ class Parser(object): inHeader = False entryLength = None entry = [] - while line is not None and not get_index(line, 'END') == 0: + while line is not None and get_index(line, 'END') != 0: # Grudging support for implicit end of section start = line.strip().upper().split() if start and start[0] in ('REAC', 'REACTIONS', 'TRAN', 'TRANSPORT'): @@ -1735,11 +1735,11 @@ class Parser(object): # List of thermodynamics (hopefully one per species!) inHeader = False line, comment = readline() - if line is not None and not contains(line, 'END'): + if line is not None and get_index(line, 'END') is None: TintDefault = float(line.split()[1]) thermo = [] current = [] - while line is not None and not contains(line, 'END'): + while line is not None and get_index(line, 'END') != 0: # Grudging support for implicit end of section start = line.strip().upper().split() if start and start[0] in ('REAC', 'REACTIONS', 'TRAN', 'TRANSPORT'): @@ -1831,7 +1831,7 @@ class Parser(object): reactions = self.surfaces[-1].reactions else: reactions = self.reactions - while line is not None and not contains(line, 'END'): + while line is not None and get_index(line, 'END') is None: # Grudging support for implicit end of section start = line.strip().upper().split() if start and start[0] in ('TRAN', 'TRANSPORT'): @@ -1893,7 +1893,7 @@ class Parser(object): inHeader = False line, comment = readline() transport_start_line = self.line_number - while line is not None and not contains(line, 'END'): + while line is not None and get_index(line, 'END') is None: # Grudging support for implicit end of section start = line.strip().upper().split() if start and start[0] in ('REAC', 'REACTIONS'): diff --git a/test/data/species-names.inp b/test/data/species-names.inp index 8371af2ab..1308c9efc 100644 --- a/test/data/species-names.inp +++ b/test/data/species-names.inp @@ -31,7 +31,7 @@ trans_butene C 1H 4 G 200.000 3500.000 1000.000 1 7.48514950E-02 1.33909467E-02-5.73285809E-06 1.22292535E-09-1.01815230E-13 2 -9.46834459E+03 1.84373180E+01 5.14987613E+00-1.36709788E-02 4.91800599E-05 3 -4.84743026E-08 1.66693956E-11-1.02466476E+04-4.64130376E+00 4 -plus+ C 1H 4 G 200.000 3500.000 1000.000 1 +plus+ nottheend C 1H 4 G 200.000 3500.000 1000.000 1 7.48514950E-02 1.33909467E-02-5.73285809E-06 1.22292535E-09-1.01815230E-13 2 -9.46834459E+03 1.84373180E+01 5.14987613E+00-1.36709788E-02 4.91800599E-05 3 -4.84743026E-08 1.66693956E-11-1.02466476E+04-4.64130376E+00 4