Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,6 @@ website:
contents:
- text: "task_safe_demo"
file: docs/reference/tasks.task_safe_demo.qmd
- text: "task_safe_n_to_1_with_covariates_and_dataframe"
file: docs/reference/tasks.task_safe_n_to_1_with_covariates_and_dataframe.qmd

- section: "Processing Guides"
contents:
Expand Down Expand Up @@ -791,4 +789,3 @@ quartodoc:
Executable tasks for demonstration and production pipelines.
contents:
- tasks.task_safe_demo
- tasks.task_safe_n_to_1_with_covariates_and_dataframe
221 changes: 38 additions & 183 deletions docs/reference/configurator.config_entsoe.ConfigEntsoe.qmd

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions docs/reference/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -292,5 +292,4 @@ Executable tasks for demonstration and production pipelines.

| | |
| --- | --- |
| [tasks.task_safe_demo](tasks.task_safe_demo.qmd#spotforecast2_safe.tasks.task_safe_demo) | Task demo: compare baseline, covariate, and custom LightGBM forecasts against ground truth. |
| [tasks.task_safe_n_to_1_with_covariates_and_dataframe](tasks.task_safe_n_to_1_with_covariates_and_dataframe.qmd#spotforecast2_safe.tasks.task_safe_n_to_1_with_covariates_and_dataframe) | Thin ConfigMulti-driven entry point for N-to-1 forecasting. |
| [tasks.task_safe_demo](tasks.task_safe_demo.qmd#spotforecast2_safe.tasks.task_safe_demo) | Task demo: compare baseline, covariate, and custom LightGBM forecasts against ground truth. |

This file was deleted.

6 changes: 3 additions & 3 deletions docs/safe/spotforecast2-safe.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ In safety-critical environments, reducing the "dead code" and unnecessary depend
---

## Positive List (Retained Components)
The following files are essential for the execution of the primary workflows: `task_safe_demo.py` and `task_safe_n_to_1_with_covariates_and_dataframe.py`.
The following files are essential for the execution of the primary workflow `task_safe_demo.py`. (The `task_safe_n_to_1_with_covariates_and_dataframe.py` console task was removed in 20.0.0; the `multitask` pipeline it wrapped — `BaseTask`/`MultiTask`/`runner.run` — is retained as public API and is exercised by the downstream `spotforecast2` package.)

### Orchestration & Pipelines
- `src/spotforecast2_safe/processing/n2n_predict_with_covariates.py`
Expand Down Expand Up @@ -74,13 +74,13 @@ To maintain a green build and avoid import errors, the following non-essential t
The resulting `spotforecast2_safe` project is a hardened version of the original, with $0$ unreachable code paths for the specified tasks and $100\%$ test coverage on the remaining logic.

## Essential Classes and Functions (Positive List)
The following classes and functions (including internal helpers) are strictly required for the execution of `task_safe_demo.py` and `task_safe_n_to_1_with_covariates_and_dataframe.py`:
The following classes and functions (including internal helpers) are strictly required for the execution of `task_safe_demo.py` and the public `multitask` pipeline:

### Orchestration & Processing
- `agg_predict` (Function)
- `n2n_predict` (Function)
- `n2n_predict_with_covariates` (Function) — used by `task_safe_demo`
- `run_pipeline` (Function, `task_safe_n_to_1_with_covariates_and_dataframe`) — delegates to `multitask.runner.run`
- `run` (Function, `multitask.runner`) — public single-call pipeline entry point

### Multitask Pipeline (n-to-1 task)
- `BaseTask` (Class) — shared prepare/detect/impute/exog steps
Expand Down
62 changes: 0 additions & 62 deletions docs/tasks/tasks.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
| Command | Description |
|---------|-------------|
| `spotforecast-safe-demo` | Demo task comparing baseline, covariate, and custom LightGBM forecasts |
| `spotforecast-safe-n2o1-cov-df` | N-to-1 forecasting with exogenous covariates and DataFrame input |

---

Expand Down Expand Up @@ -49,63 +48,6 @@ uv run spotforecast-safe-demo --logging true

---

## N-to-1 with Covariates and DataFrame

The `spotforecast-safe-n2o1-cov-df` command runs the `ConfigMulti`-driven
multitask pipeline. It delegates to `spotforecast2_safe.multitask.runner.run`
with `task="lazy"`. All pipeline parameters are centralised in a `ConfigMulti`
object; aggregation weights come from `ConfigMulti.agg_weights` (replacing the
former hard-coded `DEFAULT_WEIGHTS` constant).

See the `run_pipeline` and `_build_config_from_cli` API reference for a full
description of the pipeline stages and `ConfigMulti` field mappings.

### Features

- `ConfigMulti` as single source of truth — horizon, training window, outlier
policy, feature flags, and aggregation weights in one object.
- Multitask pipeline stages: prepare_data, detect_outliers, impute,
build_exogenous_features, run(task="lazy").
- Model persistence: fitted models are saved under `cache_home/models/` and
can be reloaded with `task="predict"`.

### Usage

```bash
# Run with custom settings (a ConfigMulti and explicit data path are required)
uv run spotforecast-safe-n2o1-cov-df

# Custom forecast horizon
uv run spotforecast-safe-n2o1-cov-df --forecast_horizon 48

# Enable holiday features and verbose output
uv run spotforecast-safe-n2o1-cov-df --include_holiday_features true --verbose true

# Custom aggregation weights
uv run spotforecast-safe-n2o1-cov-df --weights 1.0 1.0 -1.0

# Specify cache directory for models and logs
uv run spotforecast-safe-n2o1-cov-df --log_dir ~/my_cache
```

### Parameters

| Parameter | Default | Description |
|-----------|---------|-------------|
| `--forecast_horizon` | 24 | Number of steps ahead to forecast (`predict_size`) |
| `--lags` | 24 | Lag depth N; expands to `lags_consider=range(1, N+1)` |
| `--train_ratio` | 0.8 | Fraction of data used for training |
| `--contamination` | 0.01 | Outlier contamination parameter |
| `--window_size` | 72 | Rolling window size for imputation (hours) |
| `--include_holiday_features` | false | Enable holiday indicator features |
| `--include_holiday_adjacency_features` | false | Enable Brückentag features |
| `--poly_features_degree` | 1 | Polynomial interaction degree (1 = off) |
| `--weights` | None | Space-separated aggregation weights (`agg_weights`) |
| `--verbose` | false | Enable detailed output |
| `--log_dir` | None | Cache directory for models and logs (`cache_home`) |

---

## Configuration

All tasks use sensible defaults but can be customized via:
Expand All @@ -117,7 +59,6 @@ All tasks use sensible defaults but can be customized via:
```bash
# View available options for any command
uv run spotforecast-safe-demo --help
uv run spotforecast-safe-n2o1-cov-df --help
```

---
Expand All @@ -142,9 +83,6 @@ Safety-critical tasks support comprehensive logging:
```bash
# Enable logging to default directory
uv run spotforecast-safe-demo --logging true

# Specify custom log directory
uv run spotforecast-safe-n2o1-cov-df --log_dir /var/log/spotforecast
```

Log files include:
Expand Down
10 changes: 5 additions & 5 deletions docs/tutorials/n2n_predict_with_covariates_explained.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -714,11 +714,11 @@ convention is used with the eleven-element vector
aggregation in which the first, second, fifth, seventh, eighth, ninth, and
eleventh columns are added and the remaining columns are subtracted.

The n2n pipeline remains available and is used by `task_safe_demo`. The n-to-1
task (`tasks/task_safe_n_to_1_with_covariates_and_dataframe.py`) now runs on
`spotforecast2_safe.multitask`; see the
[API reference](../reference/tasks.task_safe_n_to_1_with_covariates_and_dataframe.qmd)
for its `ConfigMulti`-driven workflow and `agg_weights` configuration.
The n2n pipeline remains available and is used by `task_safe_demo`. The
`ConfigMulti`-driven, `agg_weights`-configurable n-to-1 workflow it describes now
runs directly on `spotforecast2_safe.multitask` (`MultiTask` /
`multitask.runner.run`); the former `spotforecast-safe-n2o1-cov-df` console task
was removed in 20.0.0.

```{python}
from spotforecast2_safe.processing.agg_predict import agg_predict
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ dev = [

[project.scripts]
spotforecast-safe-demo = "spotforecast2_safe.tasks.task_safe_demo:main"
spotforecast-safe-n2o1-cov-df = "spotforecast2_safe.tasks.task_safe_n_to_1_with_covariates_and_dataframe:main"

[tool.uv]
# Force uv lock to resolve dependencies for every platform we ship on,
Expand Down
Loading
Loading