Skip to content

abczarr.metadata.v3.extensions

Classes

TypedConfig

TypedConfig(*, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Metadata | JsonDict | Iterable[Any] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Metadata | JsonDict | Iterable[Any] | None] = FrozenDict({}))

Bases: Metadata

This class is the base for the configuration object of an extension point.

Methods:

Extension

Extension(*args, **kwargs)

Bases: Metadata

A Zarr v3 extension point: a named, configurable piece of metadata.

Codecs, data types, chunk grids and chunk key encodings are all shaped this way.

Attributes

name instance-attribute
name: str

The name identifying which extension applies.

configuration instance-attribute
configuration: TypedConfig

The extension's own parameters.

must_understand class-attribute instance-attribute
must_understand: bool = True

Whether a reader that does not recognize name must refuse to open the array instead of ignoring the extension.

Methods:

to_json
to_json() -> JsonDict

Serialize this extension to its JSON representation.

A default must_understand of True is left implicit in the result instead of written explicitly.

Returns:

Type Description
dict

The JSON-compatible representation of this extension.

MustUnderstandExtension

MustUnderstandExtension(name: str | bytes = '', configuration: TypedConfig | JsonDict = TypedConfig(extra_items=FrozenDict({})), must_understand: Literal[True] = True)

Bases: Extension

Represents an extension point that a reader may never silently ignore.

must_understand is pinned to True. The pin applies to extension points such as codecs, data types, chunk grids, and chunk key encodings, where an unrecognized value would make the array unreadable if skipped.

Attributes

must_understand class-attribute instance-attribute
must_understand: Literal[True] = field(repr=False)

Always True.

Methods:

ExtraField

ExtraField(name: str | bytes = '', configuration: TypedConfig | JsonDict = TypedConfig(extra_items=FrozenDict({})), must_understand: Literal[False] = False, *, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Metadata | JsonDict | Iterable[Any] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Metadata | JsonDict | Iterable[Any] | None] = FrozenDict({}))

Bases: Extension

Represents a top-level extension field that a reader may safely skip if unrecognized.

must_understand is pinned to False.

Attributes

must_understand instance-attribute
must_understand: Literal[False]

Always False.

Methods: