numcodecs_observers
numcodecs_observers
Observe encoding and decoding in the numcodecs buffer
compression API.
The following observers, implementing the
CodecObserver class are provided:
BytesizeObserver: measure the byte size of the data before and after encoding / decodingWalltimeObserver: measure the walltime it takes to encode / decode
Modules:
-
abc–This module defines the
CodecObserverbase class, which allows observing aCodec's encode and decode calls. -
bytesize–This module defines the
BytesizeObserverclass, which measures the byte size of the data before and after encoding / decoding. -
hash–This module defines the
HashableCodechelper class, which wraps an existingCodecand makes ithashable. -
walltime–This module defines the
WalltimeObserverclass, which measures the walltime it takes to encode / decode.
Functions:
-
observe–Context manager to wrap the provided
codecsuch that theobservers
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: |
|
|---|