|
2 | 2 | # |
3 | 3 | # SPDX-License-Identifier: MPL-2.0 |
4 | 4 |
|
5 | | -import warnings |
6 | 5 | from abc import ABC, abstractmethod |
7 | 6 | from contextlib import contextmanager |
8 | 7 | from typing import TYPE_CHECKING, Generator |
@@ -253,23 +252,16 @@ def get_all_paths(self, ext_start_node_id: int, ext_end_node_id: int) -> list[li |
253 | 252 |
|
254 | 253 | return [self._internals_to_externals(path) for path in internal_paths] |
255 | 254 |
|
256 | | - def get_components(self, substation_nodes: list[int] | None = None) -> list[list[int]]: |
257 | | - """Returns all separate components when the substation_nodes are removed of the graph as lists""" |
258 | | - if substation_nodes: |
259 | | - warnings.warn( |
260 | | - message=""" |
261 | | -get_components: substation_nodes argument is deprecated and will be removed in a future release. |
262 | | -The functionality is still available with the use of the `tmp_remove_nodes` context manager. |
263 | | -
|
264 | | -Example: |
265 | | ->>> with graph.tmp_remove_nodes(substation_nodes): |
266 | | ->>> components = graph.get_components() |
267 | | -""", |
268 | | - category=DeprecationWarning, |
269 | | - stacklevel=2, |
270 | | - ) |
271 | | - with self.tmp_remove_nodes(substation_nodes or []): |
272 | | - internal_components = self._get_components() |
| 255 | + def get_components(self) -> list[list[int]]: |
| 256 | + """Returns all separate components when the substation_nodes are removed of the graph as lists |
| 257 | +
|
| 258 | + If you want to get the components of the graph without certain nodes, use the `tmp_remove_nodes` context manager. |
| 259 | +
|
| 260 | + Example: |
| 261 | + >>> with graph.tmp_remove_nodes(substation_nodes): |
| 262 | + >>> components = graph.get_components() |
| 263 | + """ |
| 264 | + internal_components = self._get_components() |
273 | 265 | return [self._internals_to_externals(component) for component in internal_components] |
274 | 266 |
|
275 | 267 | def get_connected( |
|
0 commit comments