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

FlexMeasures / flexmeasures / 22913751043
78%

Build:
DEFAULT BRANCH: main
Ran 10 Mar 2026 05:01PM UTC
Jobs 1
Files 172
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

10 Mar 2026 04:46PM UTC coverage: 78.068% (+0.03%) from 78.04%
22913751043

push

github

web-flow
Support saving state-of-charge schedules to sensors with % unit (#1996)

* Initial plan

* feat: support saving SOC schedules to sensors with '%' unit

- Add _build_soc_schedule() helper in StorageScheduler to handle % unit
  conversion using soc-max as capacity; skip with warning if soc-max is
  missing or zero
- Add additional_sensor_units parameter to VariableQuantityField to allow
  sensors with extra units (e.g. %) beyond to_unit-compatible ones
- Allow % sensors for state_of_charge field in StorageFlexModelSchema and
  DBStorageFlexModelSchema
- Fix _validate_energy_fields in DBStorageFlexModelSchema to accept %
  sensors for state_of_charge
- Update STATE_OF_CHARGE metadata description to document % unit support
- Add test_save_state_of_charge_percent_sensor covering both save and skip
- Add changelog entry

Co-authored-by: Flix6x <30658763+Flix6x@users.noreply.github.com>

* refactor: address coordinator review feedback

- Make _build_soc_schedule a @staticmethod (no instance state used)
- Add defensive isinstance(soc_max, Sensor) guard against future
  VariableQuantityField usage for soc-max
- Improve additional_sensor_units docstring to clarify intended use

Co-authored-by: Flix6x <30658763+Flix6x@users.noreply.github.com>

* fix: address review feedback on PR #1996

- Fix PR number in changelog (2002 → 1996)
- Regenerate openapi-specs.json to include updated STATE_OF_CHARGE
  field description
- Redesign test_save_state_of_charge_percent_sensor to verify specific
  SOC percentage values: starting full with 50% storage efficiency gives
  idle-decay pattern 100→50→25→12.5%, plus soc-minima at t+60min=8%
  forces charging and confirms the conversion math
- Split into two focused test functions: positive case with value
  assertions and a separate skip-when-zero-soc-max case
- Drop redundant resolution=timedelta(0) from search_beliefs() call
  (sensor has event_resolution=0, so no resampling occurs either way)

Co-authored-by: Flix6x <30658763+... (continued)

1656 of 2174 branches covered (76.17%)

Branch coverage included in aggregate %.

25 of 28 new or added lines in 3 files covered. (89.29%)

11315 of 14441 relevant lines covered (78.35%)

1.57 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
89.8
0.22% flexmeasures/data/models/planning/storage.py
1
93.46
-0.38% flexmeasures/data/schemas/scheduling/storage.py
1
85.46
0.08% flexmeasures/data/schemas/sensors.py
Jobs
ID Job ID Ran Files Coverage
1 22913751043.1 10 Mar 2026 05:01PM UTC 334
78.2
GitHub Action Run
Source Files on build 22913751043
  • Tree
  • List 172
  • Changed 134
  • Source Changed 4
  • Coverage Changed 133
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #22913751043
  • b2726041 on github
  • Prev Build on main (#22896846706)
  • Next Build on main (#22922101541)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc