pydata / xarray

N-D labeled arrays and datasets in Python
https://xarray.dev
Apache License 2.0
3.63k stars 1.09k forks source link

support `chunks` in `open_groups` and `open_datatree` #9660

Closed keewis closed 4 weeks ago

keewis commented 1 month ago

In trying to support chunks the way we do for open_dataset I had to add a lot of parameters to the top-level open_datatree and open_groups functions.

I'm also still looking for the equivalent of _protect_dataset_variables_inplace, and finally _dataset_from_backend_dataset has been the place to call set_close, while #9651 pushed this to the backends for datatree.

No tests yet, and I also want to improve the docstrings before merging.

(the chunked array methods – chunk, load, compute, and persist – should be a separate PR)

cc @TomNicholas, @shoyer

sjperkins commented 1 month ago

Thanks for doing this @keewis!

keewis commented 4 weeks ago

I've copied over the docstring of open_dataset to open_groups and open_datatree and changed the code of _datatree_from_backend_datatree to both copy over _close and to protect the data against modifications. Which means this should be ready for another round of reviews and possibly merging.

TomNicholas commented 4 weeks ago

I'm happy to merge this @keewis ?

keewis commented 4 weeks ago

I'm happy to merge this @keewis ?

me too! Feel free to go ahead and merge.