[CTI] Relax formatting requirements for third bodies in reaction strings

Allow 'A + B (+M)' in addition to 'A + B (+ M)'

Cherry-pick of trunk r2929.
This commit is contained in:
Ray Speth 2014-06-20 19:41:10 +00:00
parent 2ca0dc0ed1
commit aa8c73d252

View file

@ -392,6 +392,10 @@ def getReactionSpecies(s):
>>> {'CH3':1, 'H':3.7, 'O2':5.2}
"""
# Normalize formatting of falloff third bodies so that there is always a
# space following the '+', e.g. '(+M)' -> '(+ M)'
s = s.replace(' (+', ' (+ ')
# get rid of the '+' signs separating species. Only plus signs
# surrounded by spaces are replaced, so that plus signs may be
# used in species names (e.g. 'Ar3+')