Skip to content

Commit cdcde17

Browse files
authored
patch _join.py
1 parent 449e053 commit cdcde17

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

WrightTools/data/_join.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,13 @@ def combine(data, out, item_name, new_idx, transpose, slice_):
209209
vals[:] = 0
210210
# Use advanced indexing to populate vals, a temporary array with same shape as out
211211
valid_index = tuple(wt_kit.valid_index(new_idx, new.shape))
212-
vals[valid_index] = old[:].transpose(transpose)[slice_]
212+
# temp patch--numpy now doesn't let you write array element with sequence of length 1
213+
try:
214+
vals[valid_index] = old[:].transpose(transpose)[slice_]
215+
except ValueError as e:
216+
if all([isinstance(i, int) for i in valid_index]): # temp patch: setting element to array of size 1 used to work
217+
valid_index = [[i] for i in valid_index]
218+
vals[valid_index] = old[:].transpose(transpose)[slice_]
213219

214220
# Overlap methods are accomplished by adding the existing array with the one added
215221
# for this particular data. Thus locations which should be set, but conflict by

0 commit comments

Comments
 (0)