-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
arraygood first issueClearly described and easy to accomplish. Good for beginners to the project.Clearly described and easy to accomplish. Good for beginners to the project.
Description
As of the current git head:
>>>> a = da.arange(2, chunks=2)
>>>> idx = np.array(0)
>>>> a[idx]
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
<ipython-input-4-013759abffed> in <module>()
3 a = da.arange(2, chunks=2)
4 idx = np.array(0)
----> 5 a[idx]
~/anaconda3/lib/python3.6/site-packages/dask/array/core.py in __getitem__(self, index)
1306
1307 out = 'getitem-' + tokenize(self, index2)
-> 1308 dsk, chunks = slice_array(out, self.name, self.chunks, index2)
1309
1310 dsk2 = sharedict.merge(self.dask, (out, dsk))
~/anaconda3/lib/python3.6/site-packages/dask/array/slicing.py in slice_array(out_name, in_name, blockdims, index)
155
156 # Pass down to next function
--> 157 dsk_out, bd_out = slice_with_newaxes(out_name, in_name, blockdims, index)
158
159 bd_out = tuple(map(tuple, bd_out))
~/anaconda3/lib/python3.6/site-packages/dask/array/slicing.py in slice_with_newaxes(out_name, in_name, blockdims, index)
177
178 # Pass down and do work
--> 179 dsk, blockdims2 = slice_wrap_lists(out_name, in_name, blockdims, index2)
180
181 if where_none:
~/anaconda3/lib/python3.6/site-packages/dask/array/slicing.py in slice_wrap_lists(out_name, in_name, blockdims, index)
232 # No lists, hooray! just use slice_slices_and_integers
233 if not where_list:
--> 234 return slice_slices_and_integers(out_name, in_name, blockdims, index)
235
236 # Replace all lists with full slices [3, 1, 0] -> slice(None, None, None)
~/anaconda3/lib/python3.6/site-packages/dask/array/slicing.py in slice_slices_and_integers(out_name, in_name, blockdims, index)
279 raise ValueError("Arrays chunk sizes are unknown: %s", shape)
280
--> 281 assert all(isinstance(ind, (slice, Integral)) for ind in index)
282 assert len(index) == len(blockdims)
283
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
arraygood first issueClearly described and easy to accomplish. Good for beginners to the project.Clearly described and easy to accomplish. Good for beginners to the project.