# ak16o7/de-power-forecast architecture

> Architecture diagram of the GitHub repository ak16o7/de-power-forecast, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ak16o7/de-power-forecast
- Repository: https://github.com/ak16o7/de-power-forecast

## Overview

DE Power Forecast collects German renewable-generation actuals, grid-operator forecasts, installed capacity and weather data into a versioned public dataset. Its scheduled record, daily-history and weather-backfill jobs feed that store; the central analysis workflow uses the recorded vintages to evaluate an intraday forecast model under point-in-time constraints. The README documents the scheduled jobs and dataset relationships; source excerpts show key fetch, storage, feature and vintage behavior, but not every internal call.

Main entry points: [`dpf/store.py`](https://github.com/ak16o7/de-power-forecast/blob/main/dpf/store.py) (Dataset store), [`dpf/record.py`](https://github.com/ak16o7/de-power-forecast/blob/main/dpf/record.py) (Quarter-hour recorder), [`dpf/backtest_pit.py`](https://github.com/ak16o7/de-power-forecast/blob/main/dpf/backtest_pit.py) (Point-in-time backtest), [`dpf/__main__.py`](https://github.com/ak16o7/de-power-forecast/blob/main/dpf/__main__.py) (Command dispatcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Data collection"]
  node_entsoe_api["ENTSO-E API"]
  node_entsoe_client["ENTSO-E client<br/>[entsoe.py]"]
  node_openmeteo_api["Open-Meteo API"]
  node_weather_client["Weather client<br/>[openmeteo.py]"]
  node_energy_charts["Energy-Charts API"]
  node_recorder["Quarter-hour recorder<br/>[record.py]"]
  node_daily["Daily history and capacity<br/>[daily.py]"]
  node_weather_backfill["Weather history backfill"]
end

subgraph group_persistence["Dataset and vintages"]
  node_store[("Dataset store<br/>[store.py]")]
  node_hf_dataset[("Public Hugging Face dataset")]
  node_vintage["Availability-time rules<br/>[vintage.py]"]
end

subgraph group_analysis["Forecast analysis"]
  node_baseline["Forecast baselines<br/>[baseline.py]"]
  node_features["Model features<br/>[features.py]"]
  node_intraday_model["Intraday model<br/>[model_id.py]"]
  node_pit_backtest["Point-in-time backtest<br/>[backtest_pit.py]"]
end

subgraph group_runtime["Runtime configuration"]
  node_cli["Command dispatcher<br/>[__main__.py]"]
  node_config["Collection config<br/>[config.py]"]
end

node_operator(("Scheduled jobs / user"))

node_operator -->|"runs commands"| node_cli
node_cli -->|"dispatches"| node_recorder
node_cli -->|"dispatches"| node_daily
node_cli -->|"dispatches"| node_weather_backfill
node_cli -->|"dispatches"| node_pit_backtest
node_recorder -->|"fetches actuals and forecasts"| node_entsoe_client
node_recorder -->|"fetches model runs"| node_weather_client
node_entsoe_client -->|"requests data"| node_entsoe_api
node_weather_client -->|"requests forecasts"| node_openmeteo_api
node_daily -->|"fetches history"| node_entsoe_client
node_daily -->|"fetches capacity"| node_energy_charts
node_weather_backfill -->|"fetches archives"| node_weather_client
node_recorder -->|"writes readings and vintages"| node_store
node_daily -->|"writes history and state"| node_store
node_weather_backfill -->|"reads queue and writes archives"| node_store
node_store -->|"commits dataset"| node_hf_dataset
node_operator -->|"loads published data"| node_hf_dataset
node_pit_backtest -->|"loads recorded data"| node_store
node_pit_backtest -->|"joins as of issue time"| node_vintage
node_pit_backtest -->|"evaluates point-in-time model"| node_intraday_model
node_intraday_model -->|"uses forecast rules"| node_baseline
node_intraday_model -->|"computes features"| node_features
node_intraday_model -->|"loads model inputs"| node_store
node_baseline -->|"loads forecast data"| node_store
node_pit_backtest -->|"compares baselines"| node_baseline
node_recorder -->|"tracks revisions"| node_vintage

click node_cli "https://github.com/ak16o7/de-power-forecast/blob/main/dpf/__main__.py"
click node_config "https://github.com/ak16o7/de-power-forecast/blob/main/dpf/config.py"
click node_entsoe_client "https://github.com/ak16o7/de-power-forecast/blob/main/dpf/entsoe.py"
click node_weather_client "https://github.com/ak16o7/de-power-forecast/blob/main/dpf/openmeteo.py"
click node_recorder "https://github.com/ak16o7/de-power-forecast/blob/main/dpf/record.py"
click node_daily "https://github.com/ak16o7/de-power-forecast/blob/main/dpf/daily.py"
click node_weather_backfill "https://github.com/ak16o7/de-power-forecast/blob/main/dpf/weather_backfill.py"
click node_store "https://github.com/ak16o7/de-power-forecast/blob/main/dpf/store.py"
click node_vintage "https://github.com/ak16o7/de-power-forecast/blob/main/dpf/vintage.py"
click node_baseline "https://github.com/ak16o7/de-power-forecast/blob/main/dpf/baseline.py"
click node_features "https://github.com/ak16o7/de-power-forecast/blob/main/dpf/features.py"
click node_intraday_model "https://github.com/ak16o7/de-power-forecast/blob/main/dpf/model_id.py"
click node_pit_backtest "https://github.com/ak16o7/de-power-forecast/blob/main/dpf/backtest_pit.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entsoe_api,node_entsoe_client,node_openmeteo_api,node_weather_client,node_energy_charts,node_recorder,node_daily,node_weather_backfill,node_operator toneBlue
class node_store,node_hf_dataset,node_vintage toneAmber
class node_baseline,node_features,node_intraday_model,node_pit_backtest toneMint
class node_cli,node_config toneRose
```

## Components

### Data collection

- **ENTSO-E API**
- [ENTSO-E client](https://github.com/ak16o7/de-power-forecast/blob/main/dpf/entsoe.py): `dpf/entsoe.py`
- **Open-Meteo API**
- [Weather client](https://github.com/ak16o7/de-power-forecast/blob/main/dpf/openmeteo.py): `dpf/openmeteo.py`
- **Energy-Charts API**
- [Quarter-hour recorder](https://github.com/ak16o7/de-power-forecast/blob/main/dpf/record.py): `dpf/record.py`
- [Daily history and capacity](https://github.com/ak16o7/de-power-forecast/blob/main/dpf/daily.py): `dpf/daily.py`
- [Weather history backfill](https://github.com/ak16o7/de-power-forecast/blob/main/dpf/weather_backfill.py): `dpf/weather_backfill.py`

### Dataset and vintages

- [Dataset store](https://github.com/ak16o7/de-power-forecast/blob/main/dpf/store.py): `dpf/store.py`
- **Public Hugging Face dataset**
- [Availability-time rules](https://github.com/ak16o7/de-power-forecast/blob/main/dpf/vintage.py): `dpf/vintage.py`

### Forecast analysis

- [Forecast baselines](https://github.com/ak16o7/de-power-forecast/blob/main/dpf/baseline.py): `dpf/baseline.py`
- [Model features](https://github.com/ak16o7/de-power-forecast/blob/main/dpf/features.py): `dpf/features.py`
- [Intraday model](https://github.com/ak16o7/de-power-forecast/blob/main/dpf/model_id.py): `dpf/model_id.py`
- [Point-in-time backtest](https://github.com/ak16o7/de-power-forecast/blob/main/dpf/backtest_pit.py): `dpf/backtest_pit.py`

### Runtime configuration

- [Command dispatcher](https://github.com/ak16o7/de-power-forecast/blob/main/dpf/__main__.py): `dpf/__main__.py`
- [Collection config](https://github.com/ak16o7/de-power-forecast/blob/main/dpf/config.py): `dpf/config.py`

### Other components

- **Scheduled jobs / user**

## Connections

- Scheduled jobs / user → Command dispatcher: runs commands (evidence: `dpf/__main__.py`)
- Command dispatcher → Quarter-hour recorder: dispatches (evidence: `dpf/__main__.py`)
- Command dispatcher → Daily history and capacity: dispatches (evidence: `dpf/__main__.py`)
- Command dispatcher → Weather history backfill: dispatches (evidence: `dpf/__main__.py`)
- Command dispatcher → Point-in-time backtest: dispatches (evidence: `dpf/__main__.py`)
- Quarter-hour recorder → ENTSO-E client: fetches actuals and forecasts (evidence: `dpf/record.py`)
- Quarter-hour recorder → Weather client: fetches model runs (evidence: `dpf/record.py`)
- ENTSO-E client → ENTSO-E API: requests data (evidence: `dpf/entsoe.py`)
- Weather client → Open-Meteo API: requests forecasts (evidence: `dpf/openmeteo.py`)
- Daily history and capacity → ENTSO-E client: fetches history (evidence: `dpf/daily.py`)
- Daily history and capacity → Energy-Charts API: fetches capacity (evidence: `dpf/daily.py`)
- Weather history backfill → Weather client: fetches archives (evidence: `dpf/weather_backfill.py`)
- Quarter-hour recorder → Dataset store: writes readings and vintages (evidence: `dpf/record.py`)
- Daily history and capacity → Dataset store: writes history and state (evidence: `dpf/daily.py`)
- Weather history backfill → Dataset store: reads queue and writes archives (evidence: `dpf/weather_backfill.py`)
- Dataset store → Public Hugging Face dataset: commits dataset (evidence: `README.md`)
- Scheduled jobs / user → Public Hugging Face dataset: loads published data (evidence: `README.md`)
- Point-in-time backtest → Dataset store: loads recorded data (evidence: `dpf/backtest_pit.py`)
- Point-in-time backtest → Availability-time rules: joins as of issue time (evidence: `dpf/backtest_pit.py`)
- Point-in-time backtest → Intraday model: evaluates point-in-time model (evidence: `dpf/backtest_pit.py`)
- Intraday model → Forecast baselines: uses forecast rules (evidence: `dpf/model_id.py`)
- Intraday model → Model features: computes features (evidence: `dpf/model_id.py`)
- Intraday model → Dataset store: loads model inputs (evidence: `dpf/model_id.py`)
- Forecast baselines → Dataset store: loads forecast data (evidence: `dpf/baseline.py`)
- Point-in-time backtest → Forecast baselines: compares baselines (evidence: `dpf/backtest_pit.py`)
- Quarter-hour recorder → Availability-time rules: tracks revisions (evidence: `README.md`)
