Skip to content

Generalize handling of chunked array types - #7019

Merged
dcherian merged 189 commits into
pydata:mainfrom
TomNicholas:cubed_integration
May 18, 2023
Merged

Generalize handling of chunked array types#7019
dcherian merged 189 commits into
pydata:mainfrom
TomNicholas:cubed_integration

Conversation

@TomNicholas

@TomNicholasTomNicholas commented Sep 10, 2022

Copy link
Copy Markdown
Member

Initial attempt to get cubed working within xarray, as an alternative to dask.

I've added a manager kwarg to the .chunk methods so you can do da.chunk(manager="cubed") to convert to a chunked cubed.CoreArray, with the default still being da.chunk(manager="dask"). (I couldn't think of a better name than "manager", as "backend" and "executor" are already taken.)

At the moment it should work except for an import error that I don't understand, see below.

Fro cubed to work at all with this PR we would also need:

To-dos for me on this PR:

  • Re-route xarray.apply_ufunc through cubed.apply_gufunc instead of dask's apply_gufunc when appropriate,
  • Add from_array_kwargs to opening functions, e.g. open_zarr, and open_dataset,
  • Add from_array_kwargs to creation functions, such as full_like,
  • Add store_kwargs as a way to propagate cubed-specific kwargs when saving to_zarr.

To complete this project more generally we should also:

cc @tomwhite

Comment threadxarray/core/pycompat.py Outdated
@TomNicholasTomNicholas added topic-arrays related to flexible array support and removed topic-typing labels Sep 10, 2022
@github-actionsgithub-actionsBot added topic-typing and removed topic-arrays related to flexible array support labels Sep 10, 2022
Comment threadxarray/core/dataarray.py Outdated
Comment threadxarray/core/types.py Outdated

@dcheriandcherian left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Comment threadxarray/core/dataarray.py Outdated
Comment threadxarray/core/variable.py Outdated
Comment threadxarray/core/variable.py Outdated
Comment threadxarray/core/variable.py Outdated
@TomNicholas

Copy link
Copy Markdown
MemberAuthor

@Illviljan thanks for all your comments!

Would you (or @keewis?) be willing to approve this PR now? I would really like to merge this so that I can release a version of xarray that I can use as a dependency for cubed-xarray.

Comment threadxarray/core/daskmanager.py Outdated
@dcherian

Copy link
Copy Markdown
Contributor

Thanks @TomNicholas Big change!

@dcherian
dcherian merged commit 6cd6122 into pydata:mainMay 18, 2023
@TomNicholas

Copy link
Copy Markdown
MemberAuthor

Woooo thanks @dcherian !

@jhamman

Copy link
Copy Markdown
Member

👏 Congrats @TomNicholas on getting this in! Such an important contribution. 👏

@TomNicholasTomNicholas mentioned this pull request May 18, 2023
4 tasks
@tomwhite

Copy link
Copy Markdown
Contributor

Thanks for all your hard work on this @TomNicholas!

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

Labels

API designCIContinuous Integration toolsdependenciesPull requests that update a dependency fileenhancementioneeds reviewrun-benchmarkRun the ASV benchmark workflowtopic-arraysrelated to flexible array supporttopic-backendstopic-CF conventionstopic-dasktopic-indexingtopic-rollingtopic-typingtopic-zarrRelated to zarr storage library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Alternative parallel execution frameworks in xarray

9 participants

@TomNicholas@tomwhite@dcherian@headtr1ck@jhamman@shoyer@max-sixty@Illviljan@keewis