Aggregation

Time Series Aggregation Module

This module provides a flexible framework for aggregating time series data using Polars.

Aggregation functions are implemented as subclasses of AggregationFunction and can be registered and instantiated by name, class, or instance. They provide Polars expressions but do not orchestrate execution.

Execution is handled by two concrete pipeline classes:

  • StandardAggregationPipeline: groups data by fixed periods using group_by_dynamic.

  • RollingAggregationPipeline: slides a window over the data using rolling.

Both share a common abstract base class AggregationPipeline.

Aggregation functions

AngularMean

An aggregation class to calculate the angular mean (average angle) of values within each aggregation period.

ConditionalCount

An aggregation class to count values that meet a given condition within each aggregation period.

Max

An aggregation class to find the maximum of values within each aggregation period.

Mean

An aggregation class to calculate the mean (average) of values within each aggregation period.

MeanSum

An aggregation class to calculate the mean sum (averaged total) of values within each aggregation period.

Min

An aggregation class to find the minimum of values within each aggregation period.

PeaksOverThreshold

Percentile

An aggregation class to find the nth percentile of values within each aggregation period.

StDev

An aggregation class to calculate the standard deviation of values within each aggregation period.

Sum

An aggregation class to calculate the sum (total) of values within each aggregation period.

Pipeline

AggregationPipeline

Abstract base class for aggregation pipelines.