Skip to content

Commit

Permalink
review Thijs
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Koppen <[email protected]>
  • Loading branch information
vincentkoppen committed Feb 1, 2025
1 parent 68adcd2 commit a40bedd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 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 @@ -6,7 +6,6 @@
from contextlib import contextmanager
from typing import Generator

import numpy as np
from numpy._typing import NDArray

from power_grid_model_ds._core.model.arrays.pgm_arrays import Branch3Array, BranchArray, NodeArray
Expand Down Expand Up @@ -183,7 +182,7 @@ def delete_branch3_array(self, branch_array: Branch3Array, raise_on_fail: bool =
self.delete_branch_array(branches, raise_on_fail=raise_on_fail)

@contextmanager
def tmp_remove_nodes(self, nodes: list[int] | NDArray[np.int32]) -> Generator:
def tmp_remove_nodes(self, nodes: list[int]) -> Generator:
"""Context manager that temporarily removes nodes and their branches from the graph.
Example:
>>> with graph.tmp_remove_nodes([1, 2, 3]):
Expand Down Expand Up @@ -248,7 +247,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, substation_nodes: NDArray[np.int32]) -> list[list[int]]:
def get_components(self, substation_nodes: list[int]) -> list[list[int]]:
"""Returns all separate components when the substation_nodes are removed of the graph as lists"""
with self.tmp_remove_nodes(substation_nodes):
internal_components = self._get_components()
Expand Down

0 comments on commit a40bedd

Please sign in to comment.