Skip to content

Commit b1e7bc5

Browse files
committed
Remove deprecated add_branch3
Signed-off-by: Thijs Baaijen <[email protected]>
1 parent 0bd7417 commit b1e7bc5

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

src/power_grid_model_ds/_core/model/graphs/container.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"""Stores the GraphContainer class"""
66

77
import dataclasses
8-
import warnings
98
from dataclasses import dataclass
109
from typing import TYPE_CHECKING, Generator
1110

@@ -75,15 +74,6 @@ def add_branch3_array(self, branch3_array: Branch3Array) -> None:
7574
graph = getattr(self, field.name)
7675
graph.add_branch3_array(branch3_array=branch3_array)
7776

78-
def add_branch3(self, branch: Branch3Array) -> None:
79-
"""Add a branch to all graphs"""
80-
warnings.warn(
81-
"add_branch3 is deprecated and will be removed in a future release, use add_branch3_array instead",
82-
category=DeprecationWarning,
83-
stacklevel=2,
84-
)
85-
self.add_branch3_array(branch3_array=branch)
86-
8777
def delete_node(self, node: NodeArray) -> None:
8878
"""Remove a node from all graphs"""
8979
for field in dataclasses.fields(self):

src/power_grid_model_ds/_core/model/graphs/models/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@ def get_all_paths(self, ext_start_node_id: int, ext_end_node_id: int) -> list[li
255255
def get_components(self) -> list[list[int]]:
256256
"""Returns all separate components when the substation_nodes are removed of the graph as lists
257257
258-
If you want to get the components of the graph without certain nodes, use the `tmp_remove_nodes` context manager.
258+
If you want to get the components of the graph without certain nodes,
259+
use the `tmp_remove_nodes` context manager.
259260
260261
Example:
261262
>>> with graph.tmp_remove_nodes(substation_nodes):

tests/unit/model/graphs/test_container.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def three_winding_transformers():
5353
def test_add_branch3(
5454
graph_container_with_5_nodes: GraphContainer, three_winding_transformers: ThreeWindingTransformerArray
5555
):
56-
graph_container_with_5_nodes.add_branch3(three_winding_transformers)
56+
graph_container_with_5_nodes.add_branch3_array(three_winding_transformers)
5757
for from_node, to_node in [(1, 2), (1, 4), (1, 5), (4, 5)]:
5858
assert graph_container_with_5_nodes.active_graph.has_branch(from_node, to_node)
5959
assert graph_container_with_5_nodes.complete_graph.has_branch(from_node, to_node)
@@ -66,7 +66,7 @@ def test_add_branch3(
6666
def test_delete_branch3(
6767
graph_container_with_5_nodes: GraphContainer, three_winding_transformers: ThreeWindingTransformerArray
6868
):
69-
graph_container_with_5_nodes.add_branch3(three_winding_transformers)
69+
graph_container_with_5_nodes.add_branch3_array(three_winding_transformers)
7070
graph_container_with_5_nodes.delete_branch3(three_winding_transformers[0])
7171

7272
assert not graph_container_with_5_nodes.active_graph.has_branch(1, 2)

0 commit comments

Comments
 (0)