Skip to content

Commit 89c546e

Browse files
committed
improved solution to #233
1 parent 525c68f commit 89c546e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

thermosteam/reaction/_reaction.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ def __call__(self, material):
548548
values, config, original = as_material_array(
549549
material, self._basis, self._phases, self.chemicals
550550
)
551-
if values.ndim == 2 and not isinstance(self._reactant_index, tuple):
551+
if values.ndim == 2 and len(self._phases) == 1:
552552
for i, j in zip(values, material): self._reaction(i, j)
553553
else:
554554
self._reaction(values, material)
@@ -1772,9 +1772,10 @@ class ReactionSystem:
17721772
__slots__ = ('_reactions',
17731773
'_basis',
17741774
'_chemicals',
1775-
'_phases')
1775+
'_phases',
1776+
'_reactant_index')
1777+
17761778

1777-
_reactant_index = ()
17781779

17791780
def __init__(self, *reactions, basis=None):
17801781
if not reactions: raise ValueError('Reactions cannot be empty')
@@ -1785,7 +1786,7 @@ def __init__(self, *reactions, basis=None):
17851786
except: raise ValueError('all reactions must have the same chemicals')
17861787
self._chemicals = chemicals
17871788
try: self._basis, = set([i._basis for i in reactions])
1788-
except: raise ValueError('all reactions must have the same basis')
1789+
except: raise ValueError('all reactions must have the same basis')
17891790

17901791
force_reaction = Reaction.force_reaction
17911792
adiabatic_reaction = Reaction.adiabatic_reaction

0 commit comments

Comments
 (0)