Skip to content

Commit

Permalink
Minor formatting updates to SolutionArray
Browse files Browse the repository at this point in the history
  • Loading branch information
sin-ha committed Jul 2, 2020
1 parent 494a714 commit 1f907ca
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions interfaces/cython/cantera/composite.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,21 +543,21 @@ def __init__(self, phase, shape=(0,), states=None, extra=None, meta=None):
elif len(v) == self._shape or np.array(v).shape == self._shape:
self._extra[name] = np.array(v)
else:
raise ValueError("Unable to map extra SolutionArray"
raise ValueError("Unable to map extra SolutionArray "
"input for named {!r}".format(name))

elif extra is not None:
try:
iterator = iter(extra)
iter_extra = iter(extra)
except TypeError :
raise ValueError(
"Extra properties can be created by passing an iterable"
" of names for the properties, if the SolutionArray is not initially"
" empty. If you want to supply initial values for the properties, use"
" a dictionary whose keys are the names of the properties and values "
" are the initial values.") from None
"Extra properties can be created by passing an iterable "
"of names for the properties, if the SolutionArray is not initially "
"empty. If you want to supply initial values for the properties, use "
"a dictionary whose keys are the names of the properties and values "
"are the initial values.") from None

for name in extra:
for name in iter_extra:
if isinstance(name, str):
if name in reserved:
raise ValueError(
Expand All @@ -566,7 +566,7 @@ def __init__(self, phase, shape=(0,), states=None, extra=None, meta=None):
self._extra[name] = np.empty(self._shape)

else:
raise ValueError(
raise TypeError(
"Unable to create extra column, passed value {}: "
"is not a string".format(name))

Expand Down

0 comments on commit 1f907ca

Please sign in to comment.