Skip to content

Allow __getitem__ indices that have a to_dask_array method #677

@davidhassell

Description

@davidhassell

It would be useful to allow cf.Data and other objects (such as cf.DimensionCoordinate) to be used as indices within cf-python.

E.g. so we could do a northern hemisphere subspace like this:

>>> g = f[f.dimension_coordinate('Y') > 0, ...]

Note: you can already do this with g = f.subspace(Y=cf.gt(0)), but there's no reason to preculde the [] approach, which currently does not work (but did pre 3.14.0).

PR to follow.

Thanks to @sws06mas for bring this to my attention.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions