diff --git a/src/power_grid_model_ds/_core/model/graphs/models/base.py b/src/power_grid_model_ds/_core/model/graphs/models/base.py index 801f568..30dcfc0 100644 --- a/src/power_grid_model_ds/_core/model/graphs/models/base.py +++ b/src/power_grid_model_ds/_core/model/graphs/models/base.py @@ -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 @@ -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. diff --git a/src/power_grid_model_ds/_core/model/graphs/models/rustworkx.py b/src/power_grid_model_ds/_core/model/graphs/models/rustworkx.py index f271fe7..07bd27c 100644 --- a/src/power_grid_model_ds/_core/model/graphs/models/rustworkx.py +++ b/src/power_grid_model_ds/_core/model/graphs/models/rustworkx.py @@ -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