pypowsybl.network.Network.get_switches#
- Network.get_switches(all_attributes=False, attributes=None, **kwargs)[source]#
Get a dataframe of switches.
- Parameters:
all_attributes (bool) – flag for including all attributes in the dataframe, default is false
attributes (List[str] | None) – attributes to include in the dataframe. The 2 parameters are mutually exclusive. If no parameter is specified, the dataframe will include the default attributes.
kwargs (_SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]) – the data to be selected, as named arguments.
- Returns:
A dataframe of switches.
- Return type:
Notes
The resulting dataframe, depending on the parameters, will include the following columns:
kind: the kind of switch
open: the open status of the switch
retained: the retain status of the switch
voltage_level_id: at which substation the switch is connected
bus_breaker_bus1_id (optional): bus where this switch is connected on side 1, in bus-breaker voltage levels
bus_breaker_bus1_id (optional): bus where this switch is connected on side 1, in bus-breaker voltage levels
node1 (optional): node where this switch is connected on side 1, in node-breaker voltage levels
node2 (optional): node where this switch is connected on side 2, in node-breaker voltage levels
fictitious (optional):
True
if the switch is part of the model and not of the actual network
This dataframe is indexed by the id of the switches
Examples
net = pp.network.create_four_substations_node_breaker_network() net.get_switches()
will output something like:
kind
open
retained
voltage_level_id
id
S1VL1_BBS_LD1_DISCONNECTOR
DISCONNECTOR
False
False
S1VL1
S1VL1_LD1_BREAKER
BREAKER
False
True
S1VL1
S1VL1_BBS_TWT_DISCONNECTOR
DISCONNECTOR
False
False
S1VL1
S1VL1_TWT_BREAKER
BREAKER
False
True
S1VL1
S1VL2_BBS1_TWT_DISCONNECTOR
DISCONNECTOR
False
False
S1VL2
S1VL2_BBS2_TWT_DISCONNECTOR
DISCONNECTOR
True
False
S1VL2
S1VL2_TWT_BREAKER
BREAKER
False
True
S1VL2
S1VL2_BBS1_VSC1_DISCONNECTOR
DISCONNECTOR
True
False
S1VL2
…
…
…
…
…
net = pp.network.create_four_substations_node_breaker_network() net.get_switches(all_attributes=True)
will output something like:
kind
open
retained
voltage_level_id
id
S1VL1_BBS_LD1_DISCONNECTOR
DISCONNECTOR
False
False
S1VL1
S1VL1_LD1_BREAKER
BREAKER
False
True
S1VL1
S1VL1_BBS_TWT_DISCONNECTOR
DISCONNECTOR
False
False
S1VL1
S1VL1_TWT_BREAKER
BREAKER
False
True
S1VL1
S1VL2_BBS1_TWT_DISCONNECTOR
DISCONNECTOR
False
False
S1VL2
S1VL2_BBS2_TWT_DISCONNECTOR
DISCONNECTOR
True
False
S1VL2
S1VL2_TWT_BREAKER
BREAKER
False
True
S1VL2
S1VL2_BBS1_VSC1_DISCONNECTOR
DISCONNECTOR
True
False
S1VL2
…
…
…
…
…
net = pp.network.create_four_substations_node_breaker_network() net.get_switches(attributes=['kind','open','nominal_v','voltage_level_id'])
will output something like:
kind
open
voltage_level_id
id
S1VL1_BBS_LD1_DISCONNECTOR
DISCONNECTOR
False
S1VL1
S1VL1_LD1_BREAKER
BREAKER
False
S1VL1
S1VL1_BBS_TWT_DISCONNECTOR
DISCONNECTOR
False
S1VL1
S1VL1_TWT_BREAKER
BREAKER
False
S1VL1
S1VL2_BBS1_TWT_DISCONNECTOR
DISCONNECTOR
False
S1VL2
S1VL2_BBS2_TWT_DISCONNECTOR
DISCONNECTOR
True
S1VL2
S1VL2_TWT_BREAKER
BREAKER
False
S1VL2
S1VL2_BBS1_VSC1_DISCONNECTOR
DISCONNECTOR
True
S1VL2
…
…
…
…