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

FlexMeasures / flexmeasures / 26845067286
81%

Build:
DEFAULT BRANCH: main
Ran 02 Jun 2026 08:20PM UTC
Jobs 1
Files 166
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

02 Jun 2026 08:08PM UTC coverage: 80.755% (+0.1%) from 80.643%
26845067286

push

github

web-flow
feat: support source filters in sensor references for flex-model and flex-context (#2209)

* feat: add source filters to sensor references in flex-model/flex-context (issue #1807)

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

* tests/schemas: add source-filter deserialization tests for SensorReference

Add 8 tests covering:
- backward compatibility: plain {sensor: id} still yields a Sensor
- source-types deserialization → SensorReference with source_types set
- exclude-source-types deserialization → SensorReference with exclude_source_types set
- sources list deserialization → SensorReference with DataSource objects resolved
- 4 parametrized invalid-payload cases (ValidationError expected)

Fix: test_sensor_reference_with_sources adds db fixture and calls
db.session.flush() to ensure DataSources created by setup_sources
(which never commits) get DB-assigned primary keys before the test
accesses seita_source.id.

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

* tests/planning: add integration tests for SensorReference source filters

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

* feat/sensors: add source-account filter to SensorReference

- Add `source_account: list[Account] | None` field to the SensorReference dataclass
- Import Account from flexmeasures.data.models.user and AccountIdField from
  flexmeasures.data.schemas.account in sensors.py
- Add `source_account` field (data_key="source-account") to SensorReferenceSchema
- Extend `_SOURCE_FILTER_KEYS` with "source-account" so the backward-compat
  plain-Sensor path is preserved when no filter keys are present
- Extract source-filter deserialization into `_deserialize_source_filters` helper
  to keep `_deserialize_dict` within the C901 complexity limit (≤13)

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

* feat/planning/utils: forward source_account_ids from SensorReference to TimedBelief.search

Pass `source_accoun... (continued)

133 of 139 new or added lines in 6 files covered. (95.68%)

13121 of 16248 relevant lines covered (80.75%)

0.81 hits per line

Uncovered Changes

Lines Coverage ∆ File
4
87.8
0.07% flexmeasures/data/models/planning/storage.py
1
86.63
-0.04% flexmeasures/data/models/planning/utils.py
1
87.29
2.22% flexmeasures/data/schemas/sensors.py
Jobs
ID Job ID Ran Files Coverage
1 26845067286.1 02 Jun 2026 08:20PM UTC 166
80.75
GitHub Action Run
Source Files on build 26845067286
  • Tree
  • List 166
  • Changed 6
  • Source Changed 6
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #26845067286
  • 56cfa676 on github
  • Prev Build on main (#26812406840)
  • Next Build on main (#26869143547)
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