From f95f118515ba8e0e8dd9d52194f666c94f761d75 Mon Sep 17 00:00:00 2001 From: "Bryan W. Weber" Date: Fri, 22 Jan 2016 13:59:22 -0500 Subject: [PATCH] Make the name of an element in Python always lowercase --- interfaces/cython/cantera/thermo.pyx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/interfaces/cython/cantera/thermo.pyx b/interfaces/cython/cantera/thermo.pyx index 55e7226353..decc8846a0 100644 --- a/interfaces/cython/cantera/thermo.pyx +++ b/interfaces/cython/cantera/thermo.pyx @@ -1326,10 +1326,12 @@ class Element(object): def __init__(self, arg): if isinstance(arg, (str, unicode, bytes)): try: + # Assume the argument is the element symbol and try to get the name self._name = getElementName(stringify(arg)) except RuntimeError: + # If getting the name failed, the argument must be the name self._symbol = getElementSymbol(stringify(arg)) - self._name = arg + self._name = arg.lower() else: self._symbol = arg