8000 Feature Request: Advanced indexing without oindex and vindex · Issue #926 · zarr-developers/zarr-python · GitHub
[go: up one dir, main page]

Skip to content
Feature Request: Advanced indexing without oindex and vindex #926
Closed
@Ha5hBr0wn

Description

@Ha5hBr0wn

Hi,

I have just begun to use zarr and it is great thank you!

The one thing I find mildly annoying is having to write oindex and vindex when doing advanced slicing. This is because I am writing functions that can handle either an in memory numpy array or a zarr.core.Array. So a lot of code ends up looking like

if type(x) == zarr.core.Array:
    # slice with oindex or vindex

else:
    # slice with numpy 

whenever the slice involves advanced indexing.

It seems like all the support is already there just hiding behind different names. It would be great if such checks were not necessary and if slicing matched numpy API, both semantically and syntactically. It looks to me that the semantic part is already done, part of oindex functionality is even beyond that of numpy slicing, doing something that I typically use two slices for, but that could just stay as part of oindex.

Exact correspondence with numpy slicing could be a great selling point for zarr I think, and doesn't seem like a huge lift given that the semantics are already supported and the change seems like it would be backwards compatible (Although of course I could be very wrong about that as I don't know all the intricacies involved)

Also as far as I can tell oindex support boolean indexing as well but that is not documented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0