energy_performance_indicator
energy_performance_indicator ¤
EnergyPerformanceIndicatorEvents ¤
EnergyPerformanceIndicatorEvents(
dataframe: DataFrame,
*,
event_uuid: str = "energy:enpi",
time_column: str = "systime",
uuid_column: str = "uuid"
)
Bases: Base
Energy: Performance Indicator (EnPI) per ISO 50001
Calculate energy consumed per unit of production output (EnPI = kWh/unit). Tracks EnPI against a rolling baseline and identifies improvement/degradation trends. Supports comparison across multiple meters / production areas.
Supports two data models via constructor parameters:
-
Standard (ts-shape default)::
EnergyPerformanceIndicatorEvents(df)
expects: systime | uuid | value_double | value_integer¤
-
Raw CSV::
EnergyPerformanceIndicatorEvents(df, time_column="time", uuid_column="id")
Methods: - enpi_by_window: EnPI (energy / units) per time window. - enpi_vs_baseline: EnPI vs rolling baseline with anomaly flags. - enpi_by_hierarchy: EnPI across multiple meters for area comparison.
enpi_by_window ¤
enpi_by_window(
meter_uuid: str,
counter_uuid: str,
*,
energy_column: str = "value_double",
counter_column: str = "value_integer",
window: str = "1D"
) -> pd.DataFrame
Calculate energy per unit produced (EnPI) for each time window.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
meter_uuid
|
str
|
Identifier of the energy meter signal. |
required |
counter_uuid
|
str
|
Identifier of the production counter signal. |
required |
energy_column
|
str
|
Column containing energy readings. |
'value_double'
|
counter_column
|
str
|
Column containing counter readings. |
'value_integer'
|
window
|
str
|
Aggregation window (e.g. '1D', '1h', '1W'). |
'1D'
|
Returns:
| Name | Type | Description |
|---|---|---|
DataFrame |
DataFrame
|
start, uuid, source_uuid, is_delta, energy_kwh, units_produced, enpi |
enpi_vs_baseline ¤
enpi_vs_baseline(
meter_uuid: str,
counter_uuid: str,
*,
energy_column: str = "value_double",
counter_column: str = "value_integer",
window: str = "1D",
baseline_window: int = 30,
deviation_threshold: float = 0.1
) -> pd.DataFrame
Compare current EnPI against a rolling baseline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
meter_uuid
|
str
|
Identifier of the energy meter signal. |
required |
counter_uuid
|
str
|
Identifier of the production counter signal. |
required |
energy_column
|
str
|
Column containing energy readings. |
'value_double'
|
counter_column
|
str
|
Column containing counter readings. |
'value_integer'
|
window
|
str
|
Aggregation window. |
'1D'
|
baseline_window
|
int
|
Number of windows for rolling baseline. |
30
|
deviation_threshold
|
float
|
Fractional deviation to flag as anomaly (0.1 = 10%). |
0.1
|
Returns:
| Name | Type | Description |
|---|---|---|
DataFrame |
DataFrame
|
start, uuid, source_uuid, enpi, baseline_enpi, deviation_pct, is_anomaly, trend |
enpi_by_hierarchy ¤
enpi_by_hierarchy(
meter_uuids: list[str],
counter_uuid: str,
*,
energy_column: str = "value_double",
counter_column: str = "value_integer",
window: str = "1D"
) -> pd.DataFrame
Calculate EnPI per meter for cross-area comparison.
Useful for comparing energy intensity across production lines, buildings, or hierarchy levels. Combine with series metadata to map meter_uuid to label_lvl / hierarchy columns.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
meter_uuids
|
list[str]
|
List of energy meter identifiers. |
required |
counter_uuid
|
str
|
Shared production counter identifier. |
required |
energy_column
|
str
|
Column containing energy readings. |
'value_double'
|
counter_column
|
str
|
Column containing counter readings. |
'value_integer'
|
window
|
str
|
Aggregation window. |
'1D'
|
Returns:
| Name | Type | Description |
|---|---|---|
DataFrame |
DataFrame
|
start, meter_uuid, energy_kwh, units_produced, enpi |