pangeo-data / rechunker

Disk-to-disk chunk transformation for chunked arrays.
https://rechunker.readthedocs.io/
MIT License
163 stars 25 forks source link

Compressor options in the .encoding dictionaries of a source xr.Dataset are not exploited by the rechunker #95

Open ghiggi opened 3 years ago

ghiggi commented 3 years ago

I noticed that when a Zarr store is read into a xr.Dataset (with compressor options present in each DataArray.encoding), and the xr.Dataset is provided as source to the rechunker, the compressor options are discarded in favour of a default Blosc(cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=0). Would be useful if the existing compressor options are exploited when saving the new zarr arrays.

rabernat commented 2 years ago

Hi @ghiggi and thanks for the comment! Sorry it took so long to respond--several of us were on vacation in August.

I agree it would be useful to exploit xarray encoding options. We would welcome a PR to implement this.