-
Notifications
You must be signed in to change notification settings - Fork 8
Fill missing aggregated values #228
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: v0.x.x
Are you sure you want to change the base?
Fill missing aggregated values #228
Conversation
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.
Pull request overview
This pull request adds functionality to fill missing values in aggregated component columns by summing their corresponding individual component data. The implementation automatically backfills NaN values in aggregate columns (e.g., battery_power_flow, pv_asset_production) by computing sums from labeled component columns (e.g., Battery #1, PV #1).
Key changes:
- Introduces
fill_aggregated_component_columns()helper function with configurable component type filtering - Integrates the filling logic into the energy report DataFrame creation pipeline with an optional flag
- Adds comprehensive test coverage for both basic filling behavior and component type filtering
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/frequenz/lib/notebooks/reporting/utils/helpers.py |
Adds new fill_aggregated_component_columns() function that fills missing aggregate values by summing individual component columns |
src/frequenz/lib/notebooks/reporting/data_processing.py |
Integrates the new filling function into create_energy_report_df() with a fill_missing_values parameter (defaults to True) |
tests/test_helpers.py |
Adds two test cases validating the backfill logic and component type filtering behavior |
RELEASE_NOTES.md |
Documents the new feature in the release notes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Mohammad Tayyab <Mohammad.Tayyab@neustrom.de>
Signed-off-by: Mohammad Tayyab <Mohammad.Tayyab@neustrom.de>
Signed-off-by: Mohammad Tayyab <Mohammad.Tayyab@neustrom.de>
17501b5 to
29b038b
Compare
| DataFrame with missing aggregated component columns filled in by summing | ||
| the corresponding individual component columns. | ||
| """ | ||
| # Mapping configuration |
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.
This mapping is probably not specific to only this function, so should be passed in as an argument.
This pull request adds functionality to fill missing values in aggregated component columns by summing their corresponding individual component data. The implementation automatically backfills NaN values in aggregate columns (e.g., battery_power_flow, pv_asset_production) by computing sums from labeled component columns (e.g., Battery #1, PV #1).
Key changes: