Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/power_grid_model_ds/_core/model/graphs/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,6 @@ def get_all_paths(self, ext_start_node_id: int, ext_end_node_id: int) -> list[li
target=self.external_to_internal(ext_end_node_id),
)

if internal_paths == []:
raise NoPathBetweenNodes(f"No path between nodes {ext_start_node_id} and {ext_end_node_id}")

return [self._internals_to_externals(path) for path in internal_paths]

def get_components(self, substation_nodes: NDArray[np.int32]) -> list[list[int]]:
Expand Down
5 changes: 3 additions & 2 deletions tests/unit/model/graphs/test_graph_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,9 @@ def test_all_paths_on_circular_network(self, graph_with_5_nodes: BaseGraphModel)
assert [1, 5, 4, 3] in paths

def test_all_paths_no_path(self, graph_with_5_nodes: BaseGraphModel):
with pytest.raises(NoPathBetweenNodes):
graph_with_5_nodes.get_all_paths(1, 2)
path = graph_with_5_nodes.get_all_paths(1, 2)

assert path == []


class TestFindFundamentalCycles:
Expand Down