abc
numcodecs_combinators.abc
This module defines the CodecCombinatorMixin mixin, a common interface for all codec combinator classes.
Classes:
-
CodecCombinatorMixin–Mixin class for combinators over
Codecs.
CodecCombinatorMixin
Bases: ABC
Mixin class for combinators over Codecs.
Methods:
-
map–Apply the
mapperto all codecs that are combined by this combinator.
map
abstractmethod
Apply the mapper to all codecs that are combined by this combinator.
This method should return a new instance of the combinator, where each
internal codec is replaced by its mapped codec.
The mapper should recursively apply itself to any inner codecs that
also implement the CodecCombinatorMixin
mixin. Implementors of this method can thus assume that the mapper
already handles the recursion on its own and can directly call
mapper(codec) in their implementations.
To automatically handle the recursive application as a caller, you can use
numcodecs_combinators.map_codec(codec, mapper)
| Parameters: |
|---|
| Returns: |
|
|---|