• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

FlexMeasures / flexmeasures / 42307474381
88%

Build:
DEFAULT BRANCH: main
Ran 06 Nov 2026 10:58PM UTC
Jobs 1
Files 195
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

06 Nov 2026 10:48PM UTC coverage: 87.878% (-0.05%) from 87.928%
42307474381

push

github

web-flow
Speed up scheduling problem preparation for flex-models with many devices (#2516)

* Read each commitment's constant columns once, while splitting them

The scheduling problem carries commitments as DataFrames whose name, class,
commodity and deviation prices are the same value repeated down every row.
Building the model read those back one `df[column].iloc[0]` at a time:
pandas constructs a Series and positionally indexes it for each, costing a
few microseconds where a dict lookup costs a tenth of one.

That is cheap until the flex-model has a device per charging session. A site
with 20 charge points of 2 EVSEs each produces roughly 7,400 sub-commitments
per schedule, because a commitment is split into one sub-commitment per
group and each time step is usually its own group. The reads then run into
the tens of thousands per solve.

The constants are now gathered in convert_commitments_to_subcommitments,
which already has the parent frame in hand, and carried on SchedulingProblem
as `commitment_scalars`. Gathering them there rather than from the split
result is the point: the parent is read once, not once per time step, and
the group prices come from one vectorized `groupby.first()` instead of a
lookup per group.

Measured on a week of EV charging (20 charge points of 2 EVSEs each, PV,
building and battery), profiled, one simulated day:

  _validate_commitments_are_enforceable   1.79s -> 0.02s
  _price_of (59,176 calls)                2.64s -> 0.01s
  aggregate_commodity_costs               0.98s -> 0.00s
  convert_commitments_to_subcommitments   2.10s -> 2.39s  (now builds them)
  prepare_scheduling_problem             11.11s -> 9.77s
  pandas self-time                       26.73s -> 20.25s

Unprofiled, that is 24.6s -> 20.8s for a simulated day and 172s -> 138s for
the week, with the resulting schedules unchanged.

_identify_commitment and aggregate_commodity_costs now take the gathered
constants. aggregate_commodity_costs still accepts frames, whi... (continued)

143 of 166 new or added lines in 3 files covered. (86.14%)

2 existing lines in 1 file now uncovered.

23271 of 26481 relevant lines covered (87.88%)

0.88 hits per line

Uncovered Changes

Lines Coverage ∆ File
22
90.07
-4.39% flexmeasures/data/models/planning/scheduling_problem.py
1
97.69
-0.04% flexmeasures/data/models/planning/highspy_optimization.py

Coverage Regressions

Lines Coverage ∆ File
2
90.07
-4.39% flexmeasures/data/models/planning/scheduling_problem.py
Jobs
ID Job ID Ran Files Coverage
1 42307474381.1 06 Nov 2026 10:58PM UTC 195
87.88
GitHub Action Run
Source Files on build 42307474381
  • Tree
  • List 195
  • Changed 3
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #42307474381
  • 48948a18 on github
  • Prev Build on main (#42305793744)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc