Skip to content

Commit

Permalink
minor speef improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
cortespea committed Dec 15, 2023
1 parent c44dd76 commit f9efa0b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion thermosteam/base/sparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f9efa0b

Please sign in to comment.