zarr.abc.numcodec#

Classes#

Numcodec

A protocol that models the numcodecs.abc.Codec interface.

Module Contents#

class zarr.abc.numcodec.Numcodec[source]#

Bases: typing_extensions.Protocol

A protocol that models the numcodecs.abc.Codec interface.

This protocol should be considered experimental. Expect the type annotations for buf and out to narrow in the future.

decode(buf: Any, out: Any | None = None) Any[source]#

Decode data in buf.

Parameters:
bufAny

Encoded data.

outAny

Writeable buffer to store decoded data. If provided, this buffer must be exactly the right size to store the decoded data.

Returns:
decAny

Decoded data.

encode(buf: Any) Any[source]#

Encode data from buf.

Parameters:
bufAny

Data to be encoded.

Returns:
enc: Any

Encoded data.

classmethod from_config(config: Any) Self[source]#

Instantiate a codec from a configuration dictionary.

Parameters:
configAny

A configuration dictionary for this codec.

get_config() Any[source]#

Return a JSON-serializable configuration dictionary for this codec. Must include an 'id' field with the codec identifier.

codec_id: str#