Skip to content

Commit

Permalink
Make the name of an element in Python always lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanwweber committed Jan 22, 2016
1 parent 9276f56 commit f95f118
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion interfaces/cython/cantera/thermo.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit f95f118

Please sign in to comment.