Skip to content

Add meter names - #338

Open
Mohammad-Tayyab-Frequenz wants to merge 3 commits into
frequenz-floss:v0.x.xfrom
Mohammad-Tayyab-Frequenz:add-meter-names
Open

Add meter names#338
Mohammad-Tayyab-Frequenz wants to merge 3 commits into
frequenz-floss:v0.x.xfrom
Mohammad-Tayyab-Frequenz:add-meter-names

Conversation

@Mohammad-Tayyab-Frequenz

Copy link
Copy Markdown
Contributor

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.

@Mohammad-Tayyab-Frequenz
Mohammad-Tayyab-Frequenz requested a review from a team as a code owner July 20, 2026 18:31
@github-actions github-actions Bot added part:docs Affects the documentation part:tests Affects the unit, integration and performance (benchmarks) tests labels Jul 20, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 accompanying ComponentMetadata (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 via ComponentMetadata. 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.

Comment thread src/frequenz/lib/notebooks/reporting/utils/helpers.py Outdated
Comment thread src/frequenz/lib/notebooks/reporting/data_processing.py Outdated
Comment thread src/frequenz/lib/notebooks/reporting/data_processing.py Outdated
@Mohammad-Tayyab-Frequenz
Mohammad-Tayyab-Frequenz force-pushed the add-meter-names branch 3 times, most recently from 6653a42 to 7b62c32 Compare July 21, 2026 09:20
…isplay name from assets api

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>
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