Skip to content

numcodecs codecs do not get dictified in metadata.to_dict() #2952

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

Open
d-v-b opened this issue Apr 3, 2025 · 0 comments
Open

numcodecs codecs do not get dictified in metadata.to_dict() #2952

d-v-b opened this issue Apr 3, 2025 · 0 comments

Comments

@d-v-b
Copy link
Contributor

d-v-b commented Apr 3, 2025

# /// script
# requires-python = ">=3.11"
# dependencies = [
#     "zarr",
# ]
# ///


import zarr
import numcodecs

array = zarr.create_array(
    {}, 
    shape=(10,), 
    zarr_format=2, 
    compressors = (numcodecs.LZMA()),
    dtype='uint8')
print(array.metadata.to_dict()["compressor"])
# LZMA(format=1, check=-1, preset=None, filters=None)
# should be {"id": "lzma", ...}

IMO the best fix is to rethink how we handle in-house vs numcodecs codecs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant