Skip to content

Commit 94e7c10

Browse files
committed
Allow chemkin parser to read SITE/SURF1/ type definitions.
Now that we name the surface (for compatibility with Cantera 3.1) we need to be able to read these chemkin files ourself.
1 parent f1631fa commit 94e7c10

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

rmgpy/chemkin.pyx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,8 +1180,8 @@ def read_species_block(f, species_dict, species_aliases, species_list):
11801180
tokens_upper = line.upper().split()
11811181
first_token = tokens.pop(0)
11821182
first_token = tokens_upper.pop(0) # pop from both lists
1183-
assert first_token in ['SPECIES', 'SPEC', 'SITE'] # should be first token in first line
1184-
# Build list of species identifiers
1183+
assert first_token.startswith('SPEC') or first_token.startswith('SITE'), f"'{line}' should begin with SPECIES or SITE statement."
1184+
# Build list of species identifiers
11851185
while 'END' not in tokens_upper:
11861186
line = f.readline()
11871187
# If the line contains only one species, and also contains
@@ -1206,6 +1206,8 @@ def read_species_block(f, species_dict, species_aliases, species_list):
12061206
token_upper = token.upper()
12071207
if token_upper in ['SPECIES', 'SPEC', 'SITE']:
12081208
continue # there may be more than one SPECIES statement
1209+
if re.match(r'^SITE/', token_upper):
1210+
continue # could be a named surface like SITE/SURF1/
12091211
if token_upper == 'END':
12101212
break
12111213

0 commit comments

Comments
 (0)