ess.reduce.streaming.Accumulator#
- class ess.reduce.streaming.Accumulator(preprocess=<function maybe_hist>)[source]#
Abstract base class for accumulators.
Accumulators are used to accumulate values over multiple chunks.
Methods
__init__
([preprocess])clear
()Clear the accumulator, resetting it to its initial state.
push
(value)Push a value to the accumulator.
Attributes
- property is_empty: bool#
Check if the accumulator is empty.
- Returns:
True if the accumulator is empty, False otherwise.
- property value: T#
Get the accumulated value.
- Returns:
Accumulated value.
- Raises:
ValueError – If the accumulator is empty.