pypowsybl.network.Network.reduce_by_ids_and_depths

Network.reduce_by_ids_and_depths(vl_depths, with_boundary_lines=False, with_dangling_lines=None)[source]

Reduce to a smaller network (keeping the specified voltage levels with all respective neighbours at most at the specified depth).

Parameters:
  • vl_depths (List[tuple[str, int]]) – list of the voltage level ids that should be kept in the reduced network

  • with_boundary_lines (bool) – whether boundary lines should be created to replace lines cut at the boundary of reduction

  • with_dangling_lines (bool | None) – deprecated, use with_boundary_lines instead

Return type:

None

Example

network.reduce_by_ids_and_depths(vl_depths=[("VL1", 1), ("VL25", 3)])

will only keep voltage levels VL1 and its neighbours, and VL25 with all elements around it with at most 3 connections between them.