Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 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 @@ -29,12 +29,12 @@ def __init__(self, active_only=False) -> None:

@property
@abstractmethod
def nr_nodes(self):
def nr_nodes(self) -> int:
"""Returns the number of nodes in the graph"""

@property
@abstractmethod
def nr_branches(self):
def nr_branches(self) -> int:
"""Returns the number of branches in the graph"""

@property
Expand Down Expand Up @@ -251,7 +251,7 @@ def get_all_paths(self, ext_start_node_id: int, ext_end_node_id: int) -> list[li
return [self._internals_to_externals(path) for path in internal_paths]

def get_components(self) -> list[list[int]]:
"""Returns all separate components when the substation_nodes are removed of the graph as lists
"""Returns all separate components of the graph as lists
If you want to get the components of the graph without certain nodes,
use the `tmp_remove_nodes` context manager.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ def __init__(self, active_only=False) -> None:
self._external_to_internal: dict[int, int] = {}

@property
def nr_nodes(self):
def nr_nodes(self) -> int:
return self._graph.num_nodes()

@property
def nr_branches(self):
def nr_branches(self) -> int:
return self._graph.num_edges()

@property
Expand Down