data_processing
frequenz.lib.notebooks.reporting.data_processing ¤
Microgrid Reporting DataFrame Construction.
This module constructs normalized energy-report DataFrames from raw microgrid telemetry by harmonizing timestamps and column naming, enriching PV flows, adding grid KPIs, and surfacing component-specific metrics used downstream for dashboards.
Functions:¤
- Energy Report DataFrame Construction
- :func:
create_energy_report_df: Builds a normalized energy report table with unified naming, timezone conversion, grid import calculation, and component renaming based on a MicrogridConfig.
Usage:¤
Use create_energy_report_df() inside reporting pipelines or notebooks to transform raw microgrid exports into localized, labeled, and analysis-ready tables for KPIs, dashboards, and stakeholder reporting.
Classes¤
Functions¤
frequenz.lib.notebooks.reporting.data_processing.create_energy_report_df ¤
create_energy_report_df(
df: DataFrame,
component_types: list[str],
mcfg: MicrogridConfig,
mapper: ColumnMapper,
*,
tz_name: str = "Europe/Berlin",
assume_tz: str = "UTC"
) -> DataFrame
Create a normalized Energy Report DataFrame with selected columns.
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.
| PARAMETER | DESCRIPTION |
|---|---|
df
|
Raw input table containing energy data.
TYPE:
|
component_types
|
Component types to include in the Energy Report DataFrame
(e.g., |
mcfg
|
Configuration object used to resolve component IDs.
TYPE:
|
mapper
|
Column Mapper object to standardize the column names.
TYPE:
|
tz_name
|
Target timezone name for timestamp conversion (default: "Europe/Berlin").
TYPE:
|
assume_tz
|
Timezone to assume for naive datetimes before conversion (default: "UTC").
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
DataFrame
|
The Energy Report DataFrame with standardized and selected columns. |
Notes
Component IDs are renamed to labeled names via label_component_columns().