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 in #6)
How do we alter this nested structure/cast wrapped types? (covered here)
Note: this issue is mostly relevant to array types higher on DAG, as they are the ones handling the respective interactions.
Specific Goals
Improve the situation of altering nested array structures over the manual deconstruction/reconstruction that is required
Current State
Xarray has limited support (downcasting contained data to ndarray with as_numpy), but other libraries have none or next to none. https://github.com/pydata/xarray/issues/3245 (which may have been mistakenly/prematurely closed) as many different ideas on how to handle other minimally nested cases. Otherwise, it is entirely up to the user to break apart and reconstruct the nested array structures.
Suggested Paths Forward
This is admittedly a poorly described issue, so perhaps a good idea would be to collect use cases/user stories in which we need to be able to cast wrapped types between each other in multiply nested arrays, and then see if any ideas for common interfaces emerge.
In many use cases, we can have "multiply nested" duck arrays rather than just two interacting duck array types. This creates a couple issues:
Note: this issue is mostly relevant to array types higher on DAG, as they are the ones handling the respective interactions.
Specific Goals
Current State
Xarray has limited support (downcasting contained data to ndarray with
as_numpy
), but other libraries have none or next to none. https://github.com/pydata/xarray/issues/3245 (which may have been mistakenly/prematurely closed) as many different ideas on how to handle other minimally nested cases. Otherwise, it is entirely up to the user to break apart and reconstruct the nested array structures.Suggested Paths Forward
This is admittedly a poorly described issue, so perhaps a good idea would be to collect use cases/user stories in which we need to be able to cast wrapped types between each other in multiply nested arrays, and then see if any ideas for common interfaces emerge.