Skip to content

Using numcodecs in V3 #2398

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
normanrz opened this issue Oct 18, 2024 · 0 comments
Closed

Using numcodecs in V3 #2398

normanrz opened this issue Oct 18, 2024 · 0 comments
Milestone

Comments

@normanrz
Copy link
Member

We should allow users to set filters and compressor in zarr.open etc. for v3 arrays for backwards compatilibility.
The way I would do it is to mark both kwargs as deprecated while transforming the input into the new v3 metadata format. As codec implementations, the new numcodecs wrappers from zarr-developers/numcodecs#524 would be used.

As an example

from numcodecs import Blosc, Delta
filters = [Delta(dtype='i4')]
compressor = Blosc(cname='zstd', clevel=1, shuffle=Blosc.SHUFFLE)

would be turned into

"codecs": [
  {
    "name": "numcodecs.delta",
    "configuration": { "dtype": "i4" }
  }, {
    "name": "bytes",
    "configuration": { "endian": "little" }
  }, {
    "name": "blosc",
    "configuration": {
      "cname": "zstd",
      "clevel": 1,
      "shuffle": "shuffle",
      "typesize": 4,
      "blocksize": 0
  }
]

with the following warning

The use of `filters` and `compressor` is deprecated for Zarr version 3 arrays and may be removed in future releases of zarr-python. 
Your configuration has been transformed to match the new codec configuration. 
Please use the following codec configuration in the future:
codecs=[numcodecs.zarr3.Delta(dtype="i4"), zarr.codecs.Bytes(), zarr.codecs.Blosc(cname="zstd", clevel=1, shuffle="shuffle", typesize=4, blocksize=0)] 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

3 participants