-
Notifications
You must be signed in to change notification settings - Fork 1
Description
In many use cases, we can have "multiply nested" duck arrays rather than just two interacting duck array types. This creates a couple issues:
- How do we "carry through" type-specific operations to wrapped types? (covered here)
- How do we alter this nested structure/cast wrapped types? (covered in Addition/removal of layers in a nested duck array #5)
Note: this issue is mostly relevant to array types higher on DAG, as they are the ones handling the respective interactions.
Current State
Many of the libraries higher on the DAG (e.g., xarray and pint) have some form of attribute fallback to their wrapped data. However, more complex methods/operations often require direct handling (such as rechunking an underlying dask array contained in an xarray data structure) that each library has to implement itself. This approach quickly becomes impractical as many array types become involved (e.g., how can xarray do all of pint, dask, and CuPy operations on a xarray(pint(dask(cupy)))
nested array?), especially if there is not a standard way of carrying through these operations "down the stack."
Specific Goals
- Be able to seamlessly (or as seamlessly as possible) perform wrapped-type-specific operations on wrapper arrays
- e.g., dask-specific things on a
xarray(pint(dask(numpy)))
nested array, or sparse-specific things on apint(dask(sparse))
nested array
- e.g., dask-specific things on a
Suggested Paths Forward
Discussion
- Is there guidance (or is there the prospect of some kind of standardization/"best practice" document) on how to perform operations specific to a wrapped array type through a wrapper array type in a way that nests well?