Skip to content

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

Open
@d-v-b

Description

@d-v-b
# /// 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions