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.

__init__(preprocess=<function maybe_hist>)[source]#
Parameters:

preprocess (Callable[[TypeVar(T)], TypeVar(T)] | None, default: <function maybe_hist at 0x7f11f6ad51b0>) – Preprocessing function to be applied to pushed values prior to accumulation.

Methods

__init__([preprocess])

push(value)

Push a value to the accumulator.

Attributes

value

Get the accumulated value.

push(value)[source]#

Push a value to the accumulator.

Parameters:

value (TypeVar(T)) – Value to be pushed to the accumulator.

Return type:

None

abstract property value: T#

Get the accumulated value.

Returns:

Accumulated value.