diff --git a/thermosteam/base/sparse.py b/thermosteam/base/sparse.py index c043488b..d23074fb 100644 --- a/thermosteam/base/sparse.py +++ b/thermosteam/base/sparse.py @@ -819,7 +819,14 @@ def __setitem__(self, index, value): if m == open_slice: if n.__class__ is slice: if n == open_slice: - self[:] = value + if vd in (0, 1): + for i in rows: i[:] = value + elif vd == 2: + for i, j in zip(rows, value): i[:] = j # TODO: With python 3.10, use strict=True zip kwarg + else: + raise IndexError( + 'cannot set an array element with a sequence' + ) return else: n = default_range(n, self.vector_size)