Skip to content

Commit 3d894fd

Browse files
chore: order
Signed-off-by: Jaap Schouten <jaap.schouten@alliander.com>
1 parent 6cec22c commit 3d894fd

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

  • src/power_grid_model_ds/_core/model/grids

src/power_grid_model_ds/_core/model/grids/_search.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -78,22 +78,6 @@ def get_downstream_nodes(grid: "Grid", node_id: int, inclusive: bool = False):
7878
)
7979

8080

81-
def _get_branches(grid: "Grid", from_node: int, to_node: int) -> BranchArray:
82-
"""Return active branch records and an index filtered to the requested path nodes."""
83-
84-
active_branches = grid.branches.filter(from_status=1, to_status=1).filter(
85-
from_node=from_node, to_node=to_node, mode_="AND"
86-
)
87-
if grid.three_winding_transformer.size:
88-
three_winding_active = grid.three_winding_transformer.as_branches().filter(
89-
from_status=1, to_status=1, from_node=from_node, to_node=to_node, mode_="AND"
90-
)
91-
if three_winding_active.size:
92-
active_branches = fp.concatenate(active_branches, three_winding_active)
93-
94-
return active_branches
95-
96-
9781
def iter_branches_in_shortest_path(
9882
grid: "Grid", from_node_id: int, to_node_id: int
9983
) -> Iterator[BranchArray | Branch3Array]:
@@ -115,6 +99,22 @@ def iter_branches_in_shortest_path(
11599
yield typed_branches
116100

117101

102+
def _get_branches(grid: "Grid", from_node: int, to_node: int) -> BranchArray:
103+
"""Return active branch records and an index filtered to the requested path nodes."""
104+
105+
active_branches = grid.branches.filter(from_status=1, to_status=1).filter(
106+
from_node=from_node, to_node=to_node, mode_="AND"
107+
)
108+
if grid.three_winding_transformer.size:
109+
three_winding_active = grid.three_winding_transformer.as_branches().filter(
110+
from_status=1, to_status=1, from_node=from_node, to_node=to_node, mode_="AND"
111+
)
112+
if three_winding_active.size:
113+
active_branches = fp.concatenate(active_branches, three_winding_active)
114+
115+
return active_branches
116+
117+
118118
def find_differences_between_grids(
119119
grid1: "Grid", grid2: "Grid", print_diff: bool = False
120120
) -> dict[str, dict[str, object]]:

0 commit comments

Comments
 (0)