Add meter names - #338
Open
Mohammad-Tayyab-Frequenz wants to merge 3 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends the reporting pipeline to support component-level analysis based on canonical component IDs from the microgrid configuration, and enriches outputs with human-readable meter display names fetched from the Assets API (or provided explicitly). It also introduces a typed ComponentMetadata container that carries display-name mappings and per-type ID groupings alongside the energy report DataFrame.
Changes:
- Preserve canonical numeric per-component columns in
create_energy_report_df()and return accompanyingComponentMetadata(IDs grouped by component type + display names). - Add Assets API integration (
get_meter_display_names()) and config-driven component ID resolution (including meter/inverter/component group support). - Update component analysis helpers to support canonical IDs, display-name rendering, and optional ID-source filtering (meter/inverter/component).
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_reporting_nb_functions.py | Adds coverage for canonical ID component analysis, display-name rendering, and ID-source filtering. |
| tests/test_reporting_data_processing.py | Updates/extends tests for new create_energy_report_df() return type and metadata behavior. |
| tests/test_helpers.py | Adds tests for get_meter_display_names() behavior inside an active event loop and explicit component column aggregation. |
| src/frequenz/lib/notebooks/reporting/utils/reporting_nb_functions.py | Adds canonical-ID aware component selection/formatting plus ID-source filtering support. |
| src/frequenz/lib/notebooks/reporting/utils/helpers.py | Adds component ID resolution helpers, Assets API meter-name fetching, and explicit canonical component aggregation support. |
| src/frequenz/lib/notebooks/reporting/utils/component_metadata.py | Introduces ComponentMetadata dataclass for display names and IDs-by-type. |
| src/frequenz/lib/notebooks/reporting/data_processing.py | Returns ComponentMetadata from create_energy_report_df() and uses canonical component IDs for downstream column selection/fill-ins. |
| RELEASE_NOTES.md | Documents the new component-level reporting + meter display-name enrichment. |
Comments suppressed due to low confidence (1)
src/frequenz/lib/notebooks/reporting/data_processing.py:198
- The
create_energy_report_df()docstring still says it "renames numeric component IDs to labeled names", but the function now preserves canonical numeric component columns and returns display names separately viaComponentMetadata. This mismatch can confuse callers about what columns they should expect.
Makes a copy of the input, converts the timestamp column to the configured
timezone, renames standard columns to unified names, adds the net import
column, renames numeric component IDs to labeled names, and returns a
reduced DataFrame containing only relevant columns.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Mohammad-Tayyab-Frequenz
force-pushed
the
add-meter-names
branch
3 times, most recently
from
July 21, 2026 09:20
6653a42 to
7b62c32
Compare
…isplay name from assets api Signed-off-by: Mohammad Tayyab <Mohammad.Tayyab@neustrom.de>
Mohammad-Tayyab-Frequenz
force-pushed
the
add-meter-names
branch
from
July 21, 2026 11:13
7b62c32 to
cf04b29
Compare
Signed-off-by: Mohammad Tayyab <Mohammad.Tayyab@neustrom.de>
Signed-off-by: Mohammad Tayyab <Mohammad.Tayyab@neustrom.de>
Mohammad-Tayyab-Frequenz
force-pushed
the
add-meter-names
branch
from
July 21, 2026 14:43
cf04b29 to
2c95d82
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds component-level reporting support for configured meters, inverters, and other assets, using canonical component IDs from the microgrid configuration.
It also enriches reporting outputs with meter display names from the Assets API, making component selections, plots, and downstream analysis easier to read and work with.