Skip to content

Support negative step size in indexing #637

Open
@tomwhite

Description

@tomwhite

From @dcherian in #636 (comment)

https://github.com/pydata/xarray/blob/99ee8c6ca54057a9b994d7685f36236f2d5a69d9/xarray/core/indexing.py#L1084 and friends. We rewrite the query to normal slice with +ve stride, then reverse in-memory after read :)

This is one of Xarray's magic tricks that very few people know about. We guarantee consistent indexing API over any array for the most part.

In pydata/xarray#8667, I suggested reusing this machinery for cubed.

EDIT: actually my comment is here: pydata/xarray#8834 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions