Skip to content

lazy points and bounds in Coord.cell #5723

@fnattino

Description

@fnattino

Currently, calling the .cell method on a coordinate with lazy data will trigger loading/realisation of the coordinate data to compute the cell point/bound.

Here is a minimum reproducible example:

import dask.array as da
from iris.coords import AuxCoord

aux_coord = AuxCoord(da.arange(0, 100, 10))

# the following triggers realisation of the coordinate
aux_coord.cell(0)
# Cell(point=0, bound=None)

Would it make sense to make it such that the cell points and bounds are computed lazily if the underlying data is also lazy? This would avoid e.g. triggering data loading when the cube is read from disk.

Happy to contribute with a PR, if you think it makes sense to make the Coord.cell method fully lazy.

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