progressbar.algorithms module

class progressbar.algorithms.DoubleExponentialMovingAverage(alpha: float = 0.5)[source]

Bases: SmoothingAlgorithm

The Double Exponential Moving Average (DEMA) is essentially an EMA of an EMA, which reduces the lag that’s typically associated with a simple EMA. It’s more responsive to recent changes in data.

update(new_value: float, elapsed: timedelta) float[source]

Updates the algorithm with a new value and returns the smoothed value.

class progressbar.algorithms.ExponentialMovingAverage(alpha: float = 0.5)[source]

Bases: SmoothingAlgorithm

The Exponential Moving Average (EMA) is an exponentially weighted moving average that reduces the lag that’s typically associated with a simple moving average. It’s more responsive to recent changes in data.

update(new_value: float, elapsed: timedelta) float[source]

Updates the algorithm with a new value and returns the smoothed value.

class progressbar.algorithms.SmoothingAlgorithm(**kwargs)[source]

Bases: ABC

abstract update(new_value: float, elapsed: timedelta) float[source]

Updates the algorithm with a new value and returns the smoothed value.