Skip to content

Commit f720979

Browse files
Remove PV_ARRAY component category
The PV_ARRAY component category is from the early MicrogridData days and it is no longer. Signed-off-by: Daniel Zullo <[email protected]>
1 parent 08bb756 commit f720979

File tree

4 files changed

+1
-31
lines changed

4 files changed

+1
-31
lines changed

src/frequenz/sdk/microgrid/_graph.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,6 @@ def _validate_leaf_components(self) -> None:
896896
component_category={
897897
ComponentCategory.BATTERY,
898898
ComponentCategory.EV_CHARGER,
899-
ComponentCategory.PV_ARRAY,
900899
}
901900
)
902901
)

src/frequenz/sdk/microgrid/component/_component.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,6 @@ class ComponentCategory(Enum):
9797
CHP = components_pb.ComponentCategory.COMPONENT_CATEGORY_CHP
9898
"""CHP component."""
9999

100-
# Types not yet supported by the API but which can be inferred
101-
# from available graph info.
102-
PV_ARRAY = 1000001
103-
"""PV array component."""
104-
105100

106101
def _component_category_from_protobuf(
107102
component_category: components_pb.ComponentCategory.ValueType,

tests/microgrid/test_graph.py

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,13 +1286,6 @@ def test__validate_leaf_components(self) -> None:
12861286
):
12871287
graph._validate_leaf_components()
12881288

1289-
graph._graph.clear()
1290-
graph._graph.add_node(5, **asdict(Component(5, ComponentCategory.PV_ARRAY)))
1291-
with pytest.raises(
1292-
gr.InvalidGraphError, match="Leaf components without graph predecessors"
1293-
):
1294-
graph._validate_leaf_components()
1295-
12961289
# successors present for at least one leaf node
12971290
graph._graph.clear()
12981291
graph._graph.add_nodes_from(
@@ -1323,20 +1316,6 @@ def test__validate_leaf_components(self) -> None:
13231316
):
13241317
graph._validate_leaf_components()
13251318

1326-
graph._graph.clear()
1327-
graph._graph.add_nodes_from(
1328-
[
1329-
(1, asdict(Component(1, ComponentCategory.GRID))),
1330-
(4, asdict(Component(4, ComponentCategory.EV_CHARGER))),
1331-
(5, asdict(Component(5, ComponentCategory.PV_ARRAY))),
1332-
]
1333-
)
1334-
graph._graph.add_edges_from([(1, 5), (5, 4)])
1335-
with pytest.raises(
1336-
gr.InvalidGraphError, match="Leaf components with graph successors"
1337-
):
1338-
graph._validate_leaf_components()
1339-
13401319
# all leaf nodes have at least one predecessor
13411320
# and no successors
13421321
graph._graph.clear()
@@ -1346,10 +1325,9 @@ def test__validate_leaf_components(self) -> None:
13461325
(2, asdict(Component(2, ComponentCategory.METER))),
13471326
(3, asdict(Component(3, ComponentCategory.BATTERY))),
13481327
(4, asdict(Component(4, ComponentCategory.EV_CHARGER))),
1349-
(5, asdict(Component(5, ComponentCategory.PV_ARRAY))),
13501328
]
13511329
)
1352-
graph._graph.add_edges_from([(1, 2), (1, 3), (1, 4), (1, 5)])
1330+
graph._graph.add_edges_from([(1, 2), (1, 3), (1, 4)])
13531331
graph._validate_leaf_components()
13541332

13551333
def test_graph_correction(self) -> None:

tests/microgrid/test_microgrid_api.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ def components(self) -> List[List[Component]]:
3535
Component(1, ComponentCategory.GRID),
3636
Component(4, ComponentCategory.METER),
3737
Component(5, ComponentCategory.METER),
38-
Component(6, ComponentCategory.PV_ARRAY),
3938
Component(7, ComponentCategory.METER),
4039
Component(8, ComponentCategory.INVERTER),
4140
Component(9, ComponentCategory.BATTERY),
@@ -68,7 +67,6 @@ def connections(self) -> List[List[Connection]]:
6867
[
6968
Connection(1, 4),
7069
Connection(1, 5),
71-
Connection(5, 6),
7270
Connection(1, 7),
7371
Connection(7, 8),
7472
Connection(8, 9),

0 commit comments

Comments
 (0)