Hooks¶
Hooks and hookables represent callback functions and their respective call sites within HermesPy’s processing pipeline. They are deployed to report the results of different signal processing stages to trigger additional caching and post-processing steps.
- class Hook(hookable, callback)[source]¶
-
Hook for a callback to be called after a specific DSP layer was called.
- Parameters:
- class Hookable[source]¶
-
Base class of DSP layers that can be hooked into by callbacks.
- add_callback(callback)[source]¶
Add a callback to be called after processing the DSP layer.
Instantiates a new
Hook
object representing the provided callback function. Note that eachHook
instance should notify theHookable
by calling itsHook.remove()
method once the represented callback is no longer required.- Parameters:
callback (Callable[[_RT], None]) – Function to called after processing the DSP layer. The DSP layer’s output is passed as the only argument.
- Return type:
Returns: The added callback hook.
- class _RT¶
Type of operation result.
alias of TypeVar(‘_RT’)