Skip to content

How to get default serializer? #4162

Description

@JeppeKlitgaard

I am not sure if this is a bug or intended behaviour, but

serializer : dict[str, JSON] | ArrayBytesCodec or "auto" or "keep", optional
Array-to-bytes codec to use for encoding the array data.
Zarr format 3 only. Zarr format 2 arrays use implicit array-to-bytes conversion.
Following values are supported:
- dict[str, JSON]: A dict representation of an ``ArrayBytesCodec``.
- ArrayBytesCodec: An instance of ``ArrayBytesCodec``.
- "auto": a default serializer will be used. These defaults can be changed by modifying the value of
``array.v3_default_serializer`` in [`zarr.config`][zarr.config].
- "keep": Retain the serializer of the input array if it is a zarr Array.
seems to suggest that the default serializer can be modified (and I assumed, wrongly, also obtained) via the zarr.config. (These defaults can be changed by modifying the value of array.v3_default_serializer in [zarr.config][zarr.config].)

However, running:

zarr.config.get("array.v3_default_serializer")

Gives:

KeyError: 'v3_default_serializer'

As an aside:

I am looking into compressibility of some data, and would like to have an uncompressed baseline of my data as a zarr array as well. It seems like the default serializer is BytesCodec, am I correct to assume this is effectively no compression through the serializer? Similarly, the default compressors seem to be (ZstdCodec(),), am I correct that the "no-op" here would just be an empty iterable?

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