Index
frequenz.lib.notebooks.reporting ¤
Initialise the reporting related modules.
Functions:¤
frequenz.lib.notebooks.reporting.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",
fill_missing_values: bool = True,
aggregated_component_config: (
AggregatedComponentConfig | None
) = None,
component_display_names: dict[str, str] | None = None,
battery_soc_df: DataFrame | None = None
) -> 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:
|
fill_missing_values
|
Whether to fill missing aggregate component columns from per-component sums (default: True).
TYPE:
|
aggregated_component_config
|
Optional mapping of component types to aggregated
column metadata used when filling missing aggregates. Defaults to the shared
TYPE:
|
component_display_names
|
Optional mapping from numeric component IDs to
display names fetched from the Assets API, typically passed in from
notebook code after awaiting |
battery_soc_df
|
Optional SOC data returned by
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().
Source code in src/frequenz/lib/notebooks/reporting/data_processing.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | |