Skip to content

Commit 70396d6

Browse files
committed
Use chemical formula if species label not present in getSpeciesIdentifier function
1 parent dd84c08 commit 70396d6

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

rmgpy/chemkin.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,6 +1175,11 @@ def getSpeciesIdentifier(species):
11751175
else:
11761176
logging.warning('Species label is longer than 15 characters and will break CHEMKIN 2.0')
11771177
return species.label
1178+
else:
1179+
# try the chemical formula if the species label is not present
1180+
if len(species.molecule) > 0:
1181+
# Try the chemical formula
1182+
return '{0}'.format(species.molecule[0].getFormula())
11781183
else:
11791184

11801185
# Index present - the index will be included in the identifier

0 commit comments

Comments
 (0)