-
Notifications
You must be signed in to change notification settings - Fork 46
feat: upload allows gaps in data #1918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Documentation build overview
Show files changed (2 files in total): 📝 2 modified | ➕ 0 added | ➖ 0 deleted
|
nhoening
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this successfully.
Thanks for the detailed PR description. However, the 2nd example (which is supposed to pass) has the same input data as the first (which is failing). Please adjust.
I tested a PT1H sensor with the data below:
datetime, value
2026-01-21T08:00:00, 4
2026-01-21T09:00:00, 5
2026-01-21T10:00:00, 6
2026-01-21T13:00:00, 7
2026-01-21T14:00:00, 8
2026-01-21T15:00:00, 8
2026-01-21T17:00:00, 10
2026-01-21T18:00:00, 11
2026-01-21T20:00:00, 12
And then with this even smaller set (no 3 consecutive measurements):
datetime, value
2026-01-21T09:00:00, 5
2026-01-21T10:00:00, 6
2026-01-21T13:00:00, 7
2026-01-21T14:00:00, 8
2026-01-21T17:00:00, 10
2026-01-21T18:00:00, 11
2026-01-21T20:00:00, 12
|
Next to a changelog entry, this PR should also upgrade the TB requirement once that PR is merged and a new version is released. |
I added change-log entry. and yes this pr should wait for the tb pr to be merged and then i will update tb version in requirements. |
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: F.N. Claessen <felix@seita.nl>
|
Thanks! I might still have some changes which could go in this PR, or another one.
But we also will fix a UI problem with it, too (toasts are not shown) |
…ged beliefs Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Summary
This PR updates CSV upload handling to allow gaps in the input data, as long as the
gap duration is an integer multiple of the intended base resolution.
Changes
SensorDataFileSchema.post_loadto infer the input event resolution usingmost_common_event_frequencyinstead ofevent_frequency.Rationale
event_frequencyis strict and becomesNonewhen data contains gaps, even if theunderlying resolution is still clear. For CSV uploads, we need to infer the intended
base resolution rather than require perfectly regular timestamps.
This change aligns FlexMeasures with the improved frequency handling in timely-beliefs
and allows valid real-world CSV uploads without affecting existing behavior.
How to test:
Automated tests (timely-beliefs)
Run the unit tests that cover regular and gappy data:
These tests verify that:
Manual testing (CSV upload behavior)
Note:
install timely-beliefs from the PR branch instead of PyPI.
1. CSV with non sensor resolution multiple gaps (should fail):
2. CSV with gaps that are multiples of the resolution (should succeed):
BeliefsDataFrame.most_common_event_frequency. CI will fail until thatPR is merged and released.
Related work
Sign-off