Skip to content

Commit 940aba7

Browse files
Update microgrid config (#30)
This pull request updates the microgrid configuration to rename the metric key from AC_ACTIVE_POWER to AC_POWER_ACTIVE, aligning with changes in the client-reporting library version 0.20.0.
2 parents 895dc7a + a30d6f4 commit 940aba7

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<!-- Here goes a general summary of what this release is about -->
66

77
## Upgrading
8-
8+
* Microgrid_config is updated from AC_ACTIVE_POWER to AC_POWER_ACTIVE in accordance with the update in client-reporting - v0.20.0
99
<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->
1010

1111
## New Features

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)