Skip to content

feat(examples): add custom benchmark examples for BEAM#821

Merged
egordm merged 7 commits intorelease/v4.0.0from
chore/example-custom-baseline-benchmark
Mar 27, 2026
Merged

feat(examples): add custom benchmark examples for BEAM#821
egordm merged 7 commits intorelease/v4.0.0from
chore/example-custom-baseline-benchmark

Conversation

@egordm
Copy link
Copy Markdown
Collaborator

@egordm egordm commented Mar 4, 2026

Summary

Adds end-to-end examples showing how to create and run custom BEAM benchmarks, plus a Windows compatibility fix.

Custom Benchmark Examples

File Purpose
example_baseline.py Minimal forecaster implementing BacktestForecasterMixin — predicts a constant median
example_benchmark.py Custom target provider extending SimpleTargetProvider with metrics and pipeline assembly
run_liander2024_benchmark.py Runs the example baseline + GBLinear on the built-in Liander 2024 dataset
run_benchmark.py Runs the example baseline + GBLinear using the custom benchmark pipeline
README.md Beginner-friendly guide with setup, usage, and "create your own" instructions

All files include inline comments explaining concepts for newcomers (quantiles, RestrictedHorizonVersionedTimeSeries, config parameters, metrics, etc.).

Windows Compatibility Fix

AvailableAt.__str__() now produces D-1T0600 instead of D-1T06:00. Colons are illegal in Windows file/directory names, which broke benchmark output paths like benchmark_results/analysis/mv_feeder/OS Edam/D-1T06:00/.

  • from_string() accepts both D-1T06:00 (legacy) and D-1T0600 (new) for backward compatibility
  • All existing unit tests pass (core + beam)

@egordm egordm changed the base branch from main to release/v4.0.0 March 4, 2026 10:44
egordm added 5 commits March 26, 2026 12:51
…mments

- example_baseline.py: minimal forecaster (constant median) implementing BacktestForecasterMixin
- example_benchmark.py: custom target provider extending SimpleTargetProvider
- run_liander2024_benchmark.py: run example baseline + GBLinear on Liander 2024
- run_benchmark.py: run example baseline + GBLinear using custom benchmark pipeline
- README.md: beginner-friendly guide with setup and usage instructions

Signed-off-by: Egor Dmitriev <egor.dmitriev@alliander.com>
Allows users to inject their own forecast predictions and run only
evaluation + analysis, skipping the backtesting step entirely.
Includes format_predictions() helper and a stub forecaster factory.

Signed-off-by: Egor Dmitriev <egor.dmitriev@alliander.com>
…erConfig

- Correct import paths for BacktestForecasterMixin and RestrictedHorizonVersionedTimeSeries
- Add missing required fields to BacktestForecasterConfig in stub
- Verified: pipeline correctly skips backtesting and runs eval + analysis

Signed-off-by: Egor Dmitriev <egor.dmitriev@alliander.com>
… data format

- Rename evaluate_forecasts.py → evaluate_existing_forecasts.py
- Remove format_predictions() helper and save loop (step 1)
- Just point LocalBenchmarkStorage at existing parquets
- Use DummyForecaster instead of custom _QuantileStub
- Add README section: directory layout, parquet format table, example rows
- Add LeadTime to evaluation config in example_benchmark.py

Signed-off-by: Egor Dmitriev <egor.dmitriev@alliander.com>
Add compare_liander2024_results.py and compare_custom_results.py
that generate side-by-side comparison plots across benchmark runs
using BenchmarkComparisonPipeline. Update README with comparison section.

Signed-off-by: Egor Dmitriev <egor.dmitriev@alliander.com>
@egordm egordm force-pushed the chore/example-custom-baseline-benchmark branch from faed530 to 2c68f9a Compare March 26, 2026 13:03
@egordm egordm marked this pull request as ready for review March 26, 2026 13:05
@egordm egordm requested a review from a team March 26, 2026 13:05
@egordm egordm force-pushed the chore/example-custom-baseline-benchmark branch from 2c68f9a to b742df8 Compare March 26, 2026 13:15
egordm added 2 commits March 26, 2026 14:36
Baselines are no longer re-exported from the package __init__.py.
Import directly from openstef_beam.benchmarking.baselines.openstef4.
Also fix improper Path import from openstef_core.base_model.

Signed-off-by: Egor Dmitriev <egor.dmitriev@alliander.com>
Signed-off-by: Egor Dmitriev <egor.dmitriev@alliander.com>
Signed-off-by: Egor Dmitriev <egor.dmitriev@alliander.com>
Add missing __init__.py files so examples can be run with python -m.
Use re-exported StrictExecutionCallback from openstef_beam.benchmarking.

Signed-off-by: Egor Dmitriev <egor.dmitriev@alliander.com>
Signed-off-by: Egor Dmitriev <egor.dmitriev@alliander.com>
Signed-off-by: Egor Dmitriev <egor.dmitriev@alliander.com>
@egordm egordm force-pushed the chore/example-custom-baseline-benchmark branch from b742df8 to c4e0283 Compare March 26, 2026 13:37
@sonarqubecloud
Copy link
Copy Markdown

@egordm egordm merged commit 173d8a7 into release/v4.0.0 Mar 27, 2026
4 checks passed
@egordm egordm deleted the chore/example-custom-baseline-benchmark branch March 27, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants