From d76b67f5fbba8d67a031b7d09fe9c64dd5fa9f34 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Fri, 5 Dec 2014 23:33:20 +0000 Subject: [PATCH] [ck2cti] Check for formatting errors in elemental composition Formatting errors (e.g. values in incorrect columns) result in an empty elemental composition. Raise an exception if this occurs. --- interfaces/cython/cantera/ck2cti.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/interfaces/cython/cantera/ck2cti.py b/interfaces/cython/cantera/ck2cti.py index 008960213..a5d58a808 100644 --- a/interfaces/cython/cantera/ck2cti.py +++ b/interfaces/cython/cantera/ck2cti.py @@ -952,6 +952,11 @@ class Parser(object): composition2 = self.parseComposition(elements, len(elements)//10, 10) composition.update(composition2) + if not composition: + raise InputParseError("Error parsing elemental composition for " + "species '{0}'".format(species)) + + # Construct and return the thermodynamics model thermo = MultiNASA( polynomials=[