Skip to content

Fix drop_unchanged prior-belief selection regression#2086

Open
Ragnar-the-mighty wants to merge 1 commit intoFlexMeasures:mainfrom
Ragnar-the-mighty:repro-drop-unchanged-latest-prior
Open

Fix drop_unchanged prior-belief selection regression#2086
Ragnar-the-mighty wants to merge 1 commit intoFlexMeasures:mainfrom
Ragnar-the-mighty:repro-drop-unchanged-latest-prior

Conversation

@Ragnar-the-mighty
Copy link
Copy Markdown
Contributor

Description

  • Fix _drop_unchanged_beliefs_compared_to_db so it always compares against the latest prior belief time, independent of belief-time ordering.
  • Add regression tests covering helper-level descending-order behavior and save_to_db(..., save_changed_beliefs_only=True) integration behavior.
  • Added changelog item in documentation/changelog.rst

Look & Feel

N/A

How to test

  • Run pytest flexmeasures/data/tests/test_time_series_services.py -k drop_unchanged
  • Verify the new tests pass:
    • test_drop_unchanged_compares_against_latest_prior_belief
    • test_drop_unchanged_helper_uses_wrong_prior_when_belief_times_descending

Further Improvements

  • Consider adding a small utility for selecting latest prior belief time to centralize this logic.

Related Items


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

Made with Cursor

When prior beliefs are ordered descending by belief_time, _drop_unchanged_beliefs_compared_to_db could compare against an older prior belief and incorrectly drop a changed candidate belief. Select the latest prior belief strictly earlier than the candidate and add regression tests covering helper-level and save_to_db behavior.
@read-the-docs-community
Copy link
Copy Markdown

Documentation build overview

📚 flexmeasures | 🛠️ Build #32101031 | 📁 Comparing 72a6cda against latest (1ce87c1)

  🔍 Preview build  

Show files changed (1 files in total): 📝 1 modified | ➕ 0 added | ➖ 0 deleted
File Status
api/v3_0.html 📝 modified

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

_drop_unchanged_beliefs_compared_to_db can drop changed belief when prior beliefs are descending

1 participant