Infilling#

Time Series Infill Module

This module provides a flexible framework for filling missing values (infilling) in time series data using Polars and SciPy. Infill methods are implemented as subclasses of InfillMethod and can be registered and instantiated by name, class, or instance.

The infill pipeline handles:

  • Padding the time series to ensure consistent timestamps

  • Identifying gaps and their sizes

  • Applying constraints such as maximum gap size and observation intervals

  • Delegating to a specific infill method to fill missing values

Infilling methods#

AltData

Infills missing values using an alternative data source and optional correction factor.

AltDataDynamic

Infills missing values using an alternative data source and a dynamic correction factor derived from surrounding data.

AkimaInterpolation

Akima interpolation using scipy (good for avoiding oscillations).

BSplineInterpolation

B-spline interpolation using scipy make_interp_spline with configurable order.

CubicInterpolation

Cubic spline interpolation (Convenience wrapper around B-spline with order=3).

LinearInterpolation

Linear spline interpolation (Convenience wrapper around B-spline with order=1).

PchipInterpolation

PCHIP interpolation using scipy (preserves monotonicity).

QuadraticInterpolation

Quadratic spline interpolation (Convenience wrapper around B-spline with order=2).

Pipeline#

InfillMethodPipeline

Encapsulates the logic for the infill pipeline steps.