RFC: specify multi-indexing behavior? #410
Labels
Duplicate
This issue or pull request already exists.
Needs Discussion
Needs further discussion.
RFC
Request for comments. Feature requests and proposed changes.
topic: Indexing
Array indexing.
As far as I can tell, the array API doesn't specify how multi-indexing (e.g.
arr[[1, 8, 9]]
) works, either for single axis or multiple axes. I presume this is because different libraries have settled on different behaviour here, and it is hard to find community consensus on whether vectorised indexing (NumPy style) or orthogonal indexing (I think xarray? Maybe others?) should be used. My personal view is that we should all just use vector indexing by default but, failing that, it would still be very useful to settle on.vindex
and.oindex
properties for the API. I think these are either available or already do the "obviously" right thing on different array implementations.Having a consistent API for vector indexing is extremely high value for napari, where we want to be compatible with any array input and need to write into arrays using fancy indexing (e.g. to annotate with a circular brush). Other libraries like scikit-image would certainly also benefit.
The text was updated successfully, but these errors were encountered: