Skip to content

Conversation

@Mohammad-Tayyab-Frequenz
Copy link
Contributor

@Mohammad-Tayyab-Frequenz Mohammad-Tayyab-Frequenz commented Dec 22, 2025

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

@Mohammad-Tayyab-Frequenz Mohammad-Tayyab-Frequenz requested a review from a team as a code owner December 22, 2025 14:56
Copilot AI review requested due to automatic review settings December 22, 2025 14:56
@github-actions github-actions bot added part:docs Affects the documentation part:tests Affects the unit, integration and performance (benchmarks) tests labels Dec 22, 2025
Copy link

Copilot AI left a 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>
@Mohammad-Tayyab-Frequenz Mohammad-Tayyab-Frequenz force-pushed the fill-missing-aggregated-values branch from 17501b5 to 29b038b Compare December 22, 2025 15:05
DataFrame with missing aggregated component columns filled in by summing
the corresponding individual component columns.
"""
# Mapping configuration
Copy link
Contributor

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.

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

Labels

part:docs Affects the documentation part:tests Affects the unit, integration and performance (benchmarks) tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants