google / xarray-beam

Distributed Xarray with Apache Beam
https://xarray-beam.readthedocs.io
Apache License 2.0
125 stars 7 forks source link

Add xarray_beam.open_zarr & xarray_beam.make_template #52

Closed copybara-service[bot] closed 1 year ago

copybara-service[bot] commented 1 year ago

Add xarray_beam.open_zarr & xarray_beam.make_template

Fixes https://github.com/google/xarray-beam/issues/26

I've taken a more modular approach from the one suggested in the linked issue. Instead of returning a (transform, template, chunks) tuple, open_zarr returns a (dataset, chunks) tuple. The chunking transform can be obtained from DatasetToChunks, and a template can be obtained from the new xarray_beam.make_template().

I've also updated the Xarray-Beam documentation & examples to use these helper functions, and filled out the documentation page on writing aggregation transformations.