Skip to content

Architecture

euroflex_bess_lab is organized around six layers:

  1. config.py
  2. validates schema_version: 4
  3. resolves runtime paths
  4. treats the primary runtime object as a site with one or more assets

  5. markets/

  6. euroflex_bess_lab.markets is the public import surface
  7. markets/adapters/ contains Belgium and Netherlands implementations
  8. adapters own timing, settlement semantics, actual-data loading, and reserve-product availability

  9. forecasts/

  10. built-in operational forecast paths are persistence and csv
  11. custom_python is a stable integration point for trusted local model code
  12. perfect_foresight stays oracle-only
  13. walk-forward execution never lets the solver see data that was not visible at the decision timestamp

  14. optimization/

  15. Pyomo + HiGHS kernels for:
    • da_only
    • da_plus_fcr
    • Belgium-first da_plus_afrr
  16. portfolio kernels enforce shared POI constraints at the site level

  17. backtesting/

  18. walk-forward engine
  19. checkpoint-based schedule revision
  20. oracle reference path
  21. stable artifact writing
  22. reason-code assignment for site and asset outputs

  23. analytics/, validation.py, exports.py, and reconciliation.py

  24. reporting and rainflow diagnostics
  25. config/data/doctor checks
  26. downstream handoff payloads for site schedules and asset allocations
  27. baseline vs revision vs realized reconciliation

Portfolio mental model

v1.0.0 and v1.1.0 keep the first-class site/portfolio model and add Belgium-first aFRR plus schedule lineage on top:

  • a site owns shared POI limits
  • assets are currently battery-only
  • market data is site-level
  • optimization decisions are made per asset but constrained by site import/export limits
  • outputs are written at both the site and asset level
  • revision runs preserve a baseline plan, checkpoint revisions, and a final locked-realized trace

Revision mental model

schedule_revision is an execution wrapper:

  • workflow: schedule_revision turns on checkpoint re-optimization
  • revision.base_workflow selects the underlying market workflow
  • past intervals are locked
  • FCR and Belgium aFRR commitments remain locked in the current release line
  • only future unlocked energy intervals can change

Public import rule

New code should import through:

  • euroflex_bess_lab
  • euroflex_bess_lab.markets