Skip to content

Commit 9c7d23c

Browse files
committed
Allow component graph to be a DAG instead of a tree
Certain scenarios, like a battery connected to 2 inverters are not a tree graph, but still a directed acyclic graph which we allow. Signed-off-by: Mathias L. Baumann <[email protected]>
1 parent 284b403 commit 9c7d23c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/frequenz/sdk/microgrid/_graph.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ def _validate_graph(self) -> None:
761761
if self._graph.number_of_edges() == 0:
762762
raise InvalidGraphError("No connections in component graph!")
763763

764-
if not nx.is_tree(self._graph):
764+
if not nx.is_directed_acyclic_graph(self._graph):
765765
raise InvalidGraphError("Component graph is not a tree!")
766766

767767
# node[0] is required by the graph definition

0 commit comments

Comments
 (0)