Skip to content

What should define a "duck Dask Array"? #6385

@jthielen

Description

@jthielen

As a part of supporting units with Dask in xarray, work is being undertaken to implement the Dask collections interface on Pint Quantities to allow them to act as a "duck Dask Array" or "Dask Array-like" so that xarray can perform all its usual Dask-related functionality with a Pint Quantity in-between the xarray data structure and Dask Array (since, in the generally accepted typecasting heirachy, xarray wraps Pint and Pint wraps Dask, which allows for unit calculation at the construction rather than compute step).

Given that most if not all of xarray's current Dask support is special cased based on checking for instances of Dask Arrays, the question that has arisen is how should xarray check for a duck Dask Array? @crusaderky suggested asking the Dask team for a formalized answer that xarray (and really any other library that would have types above Dask Array on the type casting hierarchy) could implement, so I wish to do so here.

Ideas that have been brought up in pydata/xarray#4208 and other past xarray/pint issues include

xref pydata/xarray#4208

cc @shoyer, @crusaderky, @keewis, @rpmanser

Metadata

Metadata

Assignees

No one assigned

    Labels

    arraydiscussionDiscussing a topic with no specific actions yetneeds attentionIt's been a while since this was pushed on. Needs attention from the owner or a maintainer.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions