From bb331dbb464173e928eee41d0c71f2e60f26dc5a Mon Sep 17 00:00:00 2001 From: cwasicki <126617870+cwasicki@users.noreply.github.com> Date: Fri, 20 Mar 2026 20:50:18 +0100 Subject: [PATCH] Remove default formula for active power and energy With support for formulas derived from the component graph via assets API, this should not be used anymore to not silently default to a wrong formula. Signed-off-by: cwasicki <126617870+cwasicki@users.noreply.github.com> --- RELEASE_NOTES.md | 1 + src/frequenz/gridpool/_microgrid_config.py | 13 ------------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 850beb8..6b276fa 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -8,6 +8,7 @@ explicitly configured. ## Upgrading * Update assets client to v0.3.0. +* Default formulas for AC active power and energy are removed. ## New Features diff --git a/src/frequenz/gridpool/_microgrid_config.py b/src/frequenz/gridpool/_microgrid_config.py index 2afae01..836d380 100644 --- a/src/frequenz/gridpool/_microgrid_config.py +++ b/src/frequenz/gridpool/_microgrid_config.py @@ -51,19 +51,6 @@ def __post_init__(self) -> None: "please use 'AC_POWER_ACTIVE' instead." ) - defaults = { - "AC_POWER_ACTIVE", - "AC_ENERGY_ACTIVE", - "AC_ENERGY_ACTIVE_CONSUMED", - "AC_ENERGY_ACTIVE_DELIVERED", - } - - for metric in defaults: - if metric not in self.formula: - self.formula[metric] = "+".join( - [f"#{cid}" for cid in self._default_cids()] - ) - def cids(self, metric: str = "") -> list[int]: """Get component IDs for this component.