spotforecast2-safe: Safety Profile

spotforecast2_safe provides deterministic forecasting components and a four-zone load demo for safety-conscious deployments. This page describes the package’s supported workflows and principal components.

Design Goals

  1. Explicit behavior: Validation and failure policies are configurable and observable.
  2. Reproducibility: Random seeds, compact model configurations, and single-threaded demo estimators make runs repeatable.
  3. Auditability: Focused interfaces, structured logging, and executable tests support review and verification.

Component Map

The following representative files support the zone-load demo and the public multitask pipeline (BaseTask/MultiTask/runner.run).

Orchestration & Pipelines

  • src/spotforecast2_safe/tasks/task_safe_zone_load_demo.py
  • src/spotforecast2_safe/multitask/base.py
  • src/spotforecast2_safe/multitask/multi.py
  • src/spotforecast2_safe/multitask/runner.py
  • src/spotforecast2_safe/processing/agg_predict.py

Data & Environmental Services

  • src/spotforecast2_safe/data/data_classes.py
  • src/spotforecast2_safe/data/fetch_data.py
  • src/spotforecast2_safe/weather/client.py
  • src/spotforecast2_safe/weather/features.py
  • src/spotforecast2_safe/calendar/holiday.py

Forecaster Engine

  • src/spotforecast2_safe/forecaster/base.py
  • src/spotforecast2_safe/forecaster/recursive/_forecaster_recursive.py
  • src/spotforecast2_safe/forecaster/recursive/_forecaster_equivalent_date.py
  • src/spotforecast2_safe/forecaster/recursive/_warnings.py
  • src/spotforecast2_safe/forecaster/utils.py

Preprocessing & Signal Cleaning

  • src/spotforecast2_safe/preprocessing/curate_data.py
  • src/spotforecast2_safe/preprocessing/imputation.py
  • src/spotforecast2_safe/preprocessing/outlier.py
  • src/spotforecast2_safe/splitter/split.py
  • src/spotforecast2_safe/preprocessing/rolling.py
  • src/spotforecast2_safe/preprocessing/_differentiator.py
  • src/spotforecast2_safe/preprocessing/_binner.py
  • src/spotforecast2_safe/preprocessing/_common.py

Core Utilities

  • src/spotforecast2_safe/preprocessing/checking.py
  • src/spotforecast2_safe/preprocessing/data_transform.py
  • src/spotforecast2_safe/preprocessing/forecaster_config.py
  • src/spotforecast2_safe/utils/convert_to_utc.py
  • src/spotforecast2_safe/exceptions.py

Representative Public Building Blocks

The following classes and functions support the zone-load demo and public multitask pipeline.

Orchestration & Processing

  • agg_predict (Function)
  • task_safe_zone_load_demo.main (Function) — console demo
  • task_safe_zone_load_demo.cli (Function) — installed command-line adapter
  • run (Function, multitask.runner) — public single-call pipeline entry point

Multitask Pipeline (n-to-1 task)

  • BaseTask (Class) — shared prepare/detect/impute/exog steps
  • MultiTask (Class) — task dispatcher
  • LazyTask (Class) — lazy fitting with optional cached tuning
  • DefaultsTask (Class) — deterministic defaults baseline
  • PredictTask (Class) — prediction from saved models
  • CleanTask (Class) — cache removal
  • agg_predictor (Function) — weighted aggregation of per-target packages
  • default_lgbm_forecaster_factory (Function) — LightGBM forecaster factory
  • runner.run (Function) — one-call pipeline entry point

Data & Environmental Services

  • fetch_data (Function)
  • fetch_holiday_data (Function)
  • fetch_weather_data (Function)
  • WeatherClient (Class)
  • create_holiday_df (Function)
  • convert_to_utc (Function)

Forecasting Engine

  • ForecasterRecursive (Class)
  • ForecasterEquivalentDate (Class)
  • ForecasterBase (Class)
  • predict_multivariate (Function)
  • initialize_lags (Function)
  • initialize_weights (Function)
  • initialize_estimator (Function)
  • initialize_window_features (Function)

Preprocessing & Validation

  • agg_and_resample_data (Function)
  • basic_ts_checks (Function)
  • curate_holidays (Function)
  • curate_weather (Function)
  • get_start_end (Function)
  • outlier_mask (Function)
  • mark_outliers (Function)
  • manual_outlier_removal (Function)
  • get_outliers (Function)
  • get_missing_weights (Function)
  • split_rel_train_val_test (Function)
  • check_y (Function)
  • check_exog (Function)
  • check_predict_input (Function)
  • check_interval (Function)
  • input_to_frame (Function)
  • expand_index (Function)
  • transform_dataframe (Function)
  • check_extract_values_and_index (Function)

Feature Engineering

  • RollingFeatures (Class)
  • TimeSeriesDifferentiator (Class)
  • QuantileBinner (Class)

Maintaining the Inventory

The generated API reference is the authoritative inventory of the public surface. The test suite and coverage report provide executable evidence for the components described here.