From 2e8b860ccd9a6d23662c9e46c7d6fbb15a47bffd Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Fri, 21 Jun 2019 17:07:23 -0400 Subject: [PATCH] [Input] Check for reactions with multiple sets of parameters --- interfaces/cython/cantera/ck2yaml.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/interfaces/cython/cantera/ck2yaml.py b/interfaces/cython/cantera/ck2yaml.py index 8575eb2b4..975029775 100644 --- a/interfaces/cython/cantera/ck2yaml.py +++ b/interfaces/cython/cantera/ck2yaml.py @@ -1268,8 +1268,14 @@ class Parser: if not parsed: raise InputError('Unparsable line:\n"""\n{}\n"""', line) - # Decide which kinetics to keep and store them on the reaction object - # Only one of these should be true at a time! + # Decide which kinetics to keep and store them on the reaction object. + # At most one of the special cases should be true + tests = [cheb_coeffs, pdep_arrhenius, low_rate, high_rate, third_body, + surface] + if sum(bool(t) for t in tests) > 1: + raise InputError('Reaction entry contains parameters for more than ' + 'one reaction type.') + if cheb_coeffs: if Tmin is None or Tmax is None: raise InputError('Missing TCHEB line for reaction {}', reaction)