Skip to content

Feat: change toy tutorial to kW units#2223

Open
BelhsanHmida wants to merge 12 commits into
mainfrom
feat/change-toy-tutorial-to-kw-units
Open

Feat: change toy tutorial to kW units#2223
BelhsanHmida wants to merge 12 commits into
mainfrom
feat/change-toy-tutorial-to-kw-units

Conversation

@BelhsanHmida
Copy link
Copy Markdown
Contributor

@BelhsanHmida BelhsanHmida commented Jun 5, 2026

Description

  • Change flexmeasures add toy-account to create kW-scale tutorial power sensors.
  • Change the toy account day-ahead price sensor from EUR/MWh to EUR/kWh.
  • Keep tutorial price CSV values in EUR/MWh and load them with --unit EUR/MWh to demonstrate unit conversion.
  • Change toy power flow sensors and schedules from MW-scale to kW-scale.
  • Keep the toy site and battery physical power capacities in 500 kVA.
  • Change the reporter tutorial grid connection capacity from 0.5 MW to 500 kW.
  • Update toy tutorial docs, runnable tutorial scripts, and CI tutorial inputs for the new units.
  • Add regression coverage for battery and reporter toy-account units.
  • Added changelog item in documentation/changelog.rst

Look & Feel

CLI examples now show kW-scale toy assets and schedules, for example:

Created <Sensor 2: discharging, unit: kW res.: 0:15:00>
Created <Sensor 7: grid connection capacity, unit: kW res.: P1Y>

The rerun toy tutorial plots showed kW labels such as 500kW, 0kW, -500kW, and reporter headroom values around 300kW to 500kW.

Simplified schedule output:

Beliefs for Sensor 'discharging' (ID 2).
Data spans 12 hours and starts at 2026-06-05 07:00:00+01:00.
The time resolution (x-axis) is 15 minutes.

  500kW |        /\                         /\
        |       /  \                       /  \
    0kW |------/----\---------------------/----\-----
        |     /      \                   /      \
 -500kW |____/        \_________________/        \___
             06:00        09:00        12:00        15:00
             discharging (toy-battery)

Simplified reporter output:

Beliefs for Sensor 'headroom' (ID 8).
Data spans a day and starts at 2026-06-05 00:00:00+01:00.
The time resolution (x-axis) is 15 minutes.

  500kW |--------\                              /--------
  400kW |         \____                  ____/
  300kW |              \________________/
             00:00        06:00        12:00        18:00
             headroom (toy-battery)

How to test

run the Docker tutorial scripts in order against a fresh isolated stack:

./documentation/tut/scripts/run-tutorial-in-docker.sh fm1139-server-1
./documentation/tut/scripts/run-tutorial2-in-docker.sh fm1139-server-1
./documentation/tut/scripts/run-tutorial3-in-docker.sh fm1139-server-1
./documentation/tut/scripts/run-tutorial4-in-docker.sh fm1139-server-1
./documentation/tut/scripts/run-tutorial5-in-docker.sh fm1139-server-1

Further Improvements

  • Regenerate and upload the external UI screenshots in the separate FlexMeasures/screenshots repository.

Related Items

Closes #1139.


Sign-off

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on code under GPL or other license that is incompatible with FlexMeasures

Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
@Flix6x Flix6x changed the title Feat: change toy tutorial to kw units Feat: change toy tutorial to kW units Jun 5, 2026
Copy link
Copy Markdown
Member

@Flix6x Flix6x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, my two main comments are:

  • to actually not change the toy battery and site power capacities from 500 kVA to 500 kW, and
  • to keep the example price data in EUR/MWh, but just scale it to the EUR/kWh sensor unit by explicitly setting the --unit EUR/MWh CLI option of flexmeasures add beliefs.

Also a question: are there screenshots that would need to be updated in https://github.com/FlexMeasures/screenshots (maybe making FlexMeasures/screenshots#8 obsolete by now)?

Comment thread documentation/tut/scripts/run-tutorial-in-docker.sh Outdated
Comment thread .github/workflows/build.yml Outdated
Comment thread documentation/tut/toy-example-setup.rst
Comment thread flexmeasures/cli/data_add.py Outdated
Comment thread flexmeasures/cli/tests/test_data_add_fresh_db.py
@Flix6x Flix6x added documentation Improvements or additions to documentation Units Deals with unit conversion labels Jun 5, 2026
@Flix6x Flix6x added this to the 1.0.0 milestone Jun 5, 2026
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
@BelhsanHmida
Copy link
Copy Markdown
Contributor Author

Nice, my two main comments are:

  • to actually not change the toy battery and site power capacities from 500 kVA to 500 kW, and
  • to keep the example price data in EUR/MWh, but just scale it to the EUR/kWh sensor unit by explicitly setting the --unit EUR/MWh CLI option of flexmeasures add beliefs.

Also a question: are there screenshots that would need to be updated in https://github.com/FlexMeasures/screenshots (maybe making FlexMeasures/screenshots#8 obsolete by now)?

yes that pr is obsolete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation Units Deals with unit conversion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Redo the toy tutorial for scheduling a battery with kW and kWh units

2 participants