You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Because `chunk_selection_as_slices` contains only slices, certain types of vindex-ing are not going to be able to be processed by the zarrs pipeline.
178
+
# Thus we get the shapes of the input selector and the the converted-to-slices selector to check if they differ.
179
+
# If they differ, then the indexing operation is not supported because it is not describe-able as slices.
f"the size of the chunk subset {shape_chunk_selection} and input/output subset {shape} are incompatible"
198
+
)
199
+
io_array_shape=list(shape)
200
+
out_selection_expanded=out_selection_as_slices
201
+
# We need to have io_array_shape and out_selection_expanded with dimensionalities matching that of the underlying array.
202
+
# `drop_axes`` is only triggered via fancy outer-indexing because applying `chunk_selection_as_slices` to the chunk array would not drop a dimension that the out-array thinks should be dropped, thus that dimension needs to be indicated.
203
+
# However, other indexing operations can silently drop a dimension on input to match the output, like `z[1, ...]`.
204
+
# In other words, applying the `chunk_selection_as_slices` to a chunk array would drop a dimension, but `out_selection` already encodes this dropped dimension because zarr-python constructs the out-array missing the dimension.
205
+
# So if we detect that a dimension has been dropped silently like this after converting to slices, we update to handle the dropped dimension.
206
+
scs_iter=iter(shape_chunk_selection)
207
+
scs_current=next(scs_iter, None)
208
+
foridx_shape, shape_chunk_from_slicesinenumerate(
209
+
shape_chunk_selection_slices
210
+
):
211
+
# Detect if this dimension has been dropped on the io_array i.e., shape_chunk_selection has been exhausted so there is an extra 1-sized dimension at the end or has a mismatch with the "full" chunk shape `shape_chunk_selection_slices`.
0 commit comments