Skip to content

Commit 728fdea

Browse files
fix: update ac active power to ac power active
Signed-off-by: Mohammad Tayyab <Mohammad.Tayyab@neustrom.de>
1 parent 895dc7a commit 728fdea

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/frequenz/gridpool/_microgrid_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ class ComponentTypeConfig:
4141
def __post_init__(self) -> None:
4242
"""Set the default formula if none is provided."""
4343
self.formula = self.formula or {}
44-
if "AC_ACTIVE_POWER" not in self.formula:
45-
self.formula["AC_ACTIVE_POWER"] = "+".join(
44+
if "AC_POWER_ACTIVE" not in self.formula:
45+
self.formula["AC_POWER_ACTIVE"] = "+".join(
4646
[f"#{cid}" for cid in self._default_cids()]
4747
)
4848

tests/test_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"1": {
1717
"meta": {"name": "Test Grid", "gid": 1, "microgrid_id": 1},
1818
"ctype": {
19-
"pv": {"meter": [101, 102], "formula": {"AC_ACTIVE_POWER": "#12+#23"}},
19+
"pv": {"meter": [101, 102], "formula": {"AC_POWER_ACTIVE": "#12+#23"}},
2020
"battery": {
2121
"inverter": [201, 202, 203],
2222
"component": [301, 302, 303, 304, 305, 306],
@@ -104,7 +104,7 @@ def test_microgrid_config_component_type_ids(
104104

105105
def test_microgrid_config_formula(valid_microgrid_config: MicrogridConfig) -> None:
106106
"""Test retrieval of formula for a given component type and metric."""
107-
assert valid_microgrid_config.formula("pv", "AC_ACTIVE_POWER") == "#12+#23"
107+
assert valid_microgrid_config.formula("pv", "AC_POWER_ACTIVE") == "#12+#23"
108108

109109
with pytest.raises(ValueError):
110110
valid_microgrid_config.formula("pv", "INVALID_METRIC")

0 commit comments

Comments
 (0)