OpenSTEF Workshop: Forecasting Energy for a Solar Park#

This workshop follows one normalized solar park near Oosterwolde through a complete OpenSTEF workflow. We use the same target and forecast period while exploring the modular layers of OpenSTEF:

  1. Explore real grid data: measurements, weather forecasts, profiles, and prices

  2. Train a default XGBoost model and inspect the forecast, preprocessing and explainability.

  3. Train an XGBoost + GBLinear ensemble with openstef-meta and compare its predictions

  4. Forecast with Chronos-2 through openstef-foundation-models

  5. Compare the output of the ensemble with Chronos-2

  6. Run an optional short openstef-beam backtest

There are questions throughout the workshop to encourage active learning. Try to answer these as you go through the workshop.

Step 1 - Download the Benchmark Dataset#

Download the files for one target through load_liander_dataset. The loader also fetches the shared profiles and prices, then caches everything in its default ./liander_dataset directory.

# Load the selected benchmark files and cache them locally.
# Define the target path used by the dataset loader.
DATASET_DIR = Path("./liander_dataset")
TARGET_GROUP = "solar_park"
TARGET_NAME = "Within 15 kilometers of Oosterwolde_normalized"
TARGET_PATH = f"{TARGET_GROUP}/{TARGET_NAME}"

# Download only the selected target and required metadata.
dataset = load_liander_dataset(target=TARGET_PATH, extra_files=["liander2024_targets.yaml"])

Step 2 - Explore the Dataset#

2.1 Meet Our Target: Solar Park near Oosterwolde#

The target provider reads the benchmark metadata and target-specific files from the downloaded snapshot. We select one normalized solar park so every later comparison uses the same target.

# Select the solar-park target used throughout the workshop.
# Load target metadata from the benchmark snapshot.
from openstef_beam.benchmarking.benchmarks.liander2024 import Liander2024TargetProvider

target_provider = Liander2024TargetProvider(data_dir=DATASET_DIR)
# Resolve the named target for all later data requests.
targets = target_provider.get_targets()
target = next(item for item in targets if item.name == TARGET_NAME and item.group_name == TARGET_GROUP)

print(f"Target: {target.name}")
print(f"Location: ({target.latitude:.3f}°N, {target.longitude:.3f}°E)")
print(f"Description: {target.description}")
print(f"Category: {target.group_name}")
print(f"Capacity limits: {target.lower_limit:.3f} MW to {target.upper_limit:.3f} MW")
print(f"Training starts: {target.train_start.date()}")
print(f"Benchmark period: {target.benchmark_start.date()} to {target.benchmark_end.date()}")
Target: Within 15 kilometers of Oosterwolde_normalized
Location: (52.988°N, 6.295°E)
Description: Solar park within 15 kilometers of Oosterwolde (Normalized load)
Category: solar_park
Capacity limits: -0.853 MW to 0.003 MW
Training starts: 2024-02-01
Benchmark period: 2024-03-01 to 2024-12-31

2.2 Load Measurements#

Active power is measured every 15 minutes. The measurements show the target’s daily and weather-driven variability.

  • Q2.2.1 What daily, seasonal, and event-driven patterns can you see?

  • Q2.2.2 Where would a forecast error matter most operationally?

  • Q2.2.3 If you zoom in, can you find unexpected deviations or anomalies in the measurements?

Hide code cell source

# Inspect the measured active-power signal and capacity limits.
# Load the target measurements and resolve their single version.
load_dataset = target_provider.get_measurements_for_target(target)
load_df = load_dataset.select_version().data

# Summarize the measurement coverage before plotting it.
print(f"Shape: {load_df.shape[0]:,} rows x {load_df.shape[1]} columns")
print(f"Period: {load_df.index.min()} to {load_df.index.max()}")
print(f"Columns: {list(load_df.columns)}")

# Plot the measurements with the target capacity limits.
fig = px.line(
    load_df,
    y="load",
    title=f"Active Power: {TARGET_NAME}",
    labels={"load": "Active Power (MW)", "index": "Time (UTC)"},
    template="plotly_white",
)
fig.add_hline(y=target.upper_limit, line_dash="dash", line_color="red", annotation_text="Upper capacity limit")
fig.add_hline(y=target.lower_limit, line_dash="dash", line_color="red", annotation_text="Lower capacity limit")
fig.update_layout(height=450, showlegend=False)
fig.show()
Shape: 32,160 rows x 1 columns
Period: 2024-02-01 00:00:00+00:00 to 2024-12-31 23:45:00+00:00
Columns: ['load']