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

FlexMeasures / flexmeasures / 23790681427
78%

Build:
DEFAULT BRANCH: main
Ran 31 Mar 2026 09:47AM UTC
Jobs 1
Files 162
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

31 Mar 2026 09:36AM UTC coverage: 77.702% (+0.05%) from 77.652%
23790681427

push

github

web-flow
Feat: `save_to_db` no longer attempts to save duplicate beliefs (#2059)

* fix: prevent duplicate belief constraint violations with automatic deduplication
Add a new remove_existing_beliefs() utility function to the time_series module
that proactively removes beliefs already in the database before saving.
This function compares (event_start, belief_horizon, event_value) tuples to
identify duplicates and filters them out, preventing unique constraint violations
when forecasters are run multiple times with identical data.
The deduplication is now transparently integrated into save_to_db(), meaning all
forecasters automatically benefit from this protection without needing to call it
explicitly. Forecasters can simply call save_to_db(bdf) and know that duplicate
beliefs will be handled.
Key improvements:
- Prevents IntegrityError when re-running forecasts with unchanged data
- Works with most_recent_beliefs_only=False for processing all historical beliefs
- Handles edge cases (empty DataFrames, multiple belief times)
- Centralized deduplication logic in FlexMeasures core
Signed-off-by: F.N. Claessen <claessen@seita.nl>

* revert: redundant part of the fix

Signed-off-by: F.N. Claessen <claessen@seita.nl>

* refactor: reuse bdf_db (no need to query again)

Signed-off-by: F.N. Claessen <claessen@seita.nl>

* refactor: prevent call to remove_existing_beliefs in lower level groupby statement

Signed-off-by: F.N. Claessen <claessen@seita.nl>

* chore: minimize diff

Signed-off-by: F.N. Claessen <claessen@seita.nl>

* style: RST docstrings

Signed-off-by: F.N. Claessen <claessen@seita.nl>

* feat: add tests for saving both deterministic and probabilistic beliefs

Signed-off-by: F.N. Claessen <claessen@seita.nl>

* docs: changelog entry

Signed-off-by: F.N. Claessen <claessen@seita.nl>

* fix: use separate test fixture for new tests

Signed-off-by: F.N. Claessen <claessen@seita.nl>

---------

Signed-off-by: F.N. Claessen <claessen@seita.nl>
Signed-off-by: Nicol... (continued)

33 of 33 new or added lines in 2 files covered. (100.0%)

11496 of 14795 relevant lines covered (77.7%)

0.78 hits per line

Jobs
ID Job ID Ran Files Coverage
1 23790681427.1 31 Mar 2026 09:47AM UTC 162
77.7
GitHub Action Run
Source Files on build 23790681427
  • Tree
  • List 162
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #23790681427
  • 7976140b on github
  • Prev Build on main (#23770100047)
  • Next Build on main (#23806253080)
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