numcodecs_observers

numcodecs_observers

Observe encoding and decoding in the numcodecs buffer compression API.

The following observers, implementing the CodecObserver class are provided:

Modules:

  • abc

    This module defines the CodecObserver base class, which allows observing a Codec's encode and decode calls.

  • bytesize

    This module defines the BytesizeObserver class, which measures the byte size of the data before and after encoding / decoding.

  • hash

    This module defines the HashableCodec helper class, which wraps an existing Codec and makes it hashable.

  • walltime

    This module defines the WalltimeObserver class, which measures the walltime it takes to encode / decode.

Functions:

  • observe

    Context manager to wrap the provided codec such that the observers

observe

observe(codec: Codec, observers: Sequence[CodecObserver])

Context manager to wrap the provided codec such that the observers observe every encode and decode call.

Parameters:
Returns: