From cee19f67a69f8908c8397667714212707758bdd9 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Fri, 30 Mar 2012 23:47:01 +0000 Subject: [PATCH] Fixed handling of reaction delimiters --- interfaces/python/ck2cti.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/interfaces/python/ck2cti.py b/interfaces/python/ck2cti.py index 8031b61cd..49824ea6e 100644 --- a/interfaces/python/ck2cti.py +++ b/interfaces/python/ck2cti.py @@ -979,11 +979,18 @@ def readKineticsEntry(entry, speciesDict, energyUnits, moleculeUnits): thirdBody = False # Split the reaction equation into reactants and products - reversible = True - reactants, products = reaction.split('=') - if '=>' in reaction: - products = products[1:] + if '<=>' in reaction: + reversible = True + reactants, products = reaction.split('<=>') + elif '=>' in reaction: reversible = False + reactants, products = reaction.split('=>') + elif '=' in reaction: + reversible = True + reactants, products = reaction.split('=') + else: + raise ChemkinError("Failed to find reactant/product delimiter in reaction string.") + if '(+M)' in reactants: reactants = reactants.replace('(+M)','') if '(+m)' in reactants: reactants = reactants.replace('(+m)','') if '(+M)' in products: products = products.replace('(+M)','')