Description
What is your issue?
Hi
I'm been trying to set zarr encoding options from xarray. (zarr3)
Figuring out how to do this isn't straightforward. It wasn't too hard to get this working for most zarr compressors, but getting it working for array-to-bytes codecs - ZFPY and PCodec was rather harder. (the 2 ArrayBytesCodecs). It turned out the issue is that array bytes codecs need specifying as serialisers, rather than as compressors in the encoding object.
Anyway - to cut to the chase, I think some better documentation of the format of the encoding object would be useful. - I've not been able to find any, and resorted to source code reading to find the above parameter.
I'm happy to help write this if useful, but could use a pointer for the best place to put the doc. (I'm new to making xarray changes).
should say though - the fact this works at all just a few days after zarr3 release is great!
Thanks
Format strings that seem to be working for me are as follows (arguably maybe the details of codec naming belong more in zarr land, but at least the serializer keyword is as far as I can see a xarray invention, so should be documented in xarray):
For ArrayBytesCodecs:
encoding = {"serializer": numcodecs.zarr3.()}
For ArrayBytesCodecs:
if in numcodecs:
encoding = {"compressor": numcodecs.zarr3.()}
and if native zarr3:
(note different codec name format)
encoding = {"compressor": zarr.codecs.ZstdCodec()}