Skip to content

RFC: specify multi-indexing behavior? #410

Closed as not planned
Closed as not planned
@jni

Description

@jni

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateThis issue or pull request already exists.Needs DiscussionNeeds further discussion.RFCRequest for comments. Feature requests and proposed changes.topic: IndexingArray indexing.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions