Skip to content

Avoid expensive casts to numpy arrays under the hood #2910

Description

@erikvansebille

When DataArray.data is called, the return is an Array-API compatible array (i.e., Numpy, but also dask). Since the ChunkCachedArray only implements a subset of the Array API, this would mean that direct calls to .data would trigger a very expensive cast to an Array API compatible array (i.e., a numpy array).

I think these casts should be avoided (in the codebase, but also importantly in interpolators) when running with CachedChunkArray's. I'm not sure what the fix would be at first glance

Originally posted by @VeckoTheGecko in #2908 (comment)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions