pypowsybl.network.Network.get_lines#

Network.get_lines(all_attributes=False, attributes=None, **kwargs)[source]#

Get a dataframe of lines data.

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 lines data.

Return type:

DataFrame

Notes

The resulting dataframe, depending on the parameters, will include the following columns:

  • r: the resistance of the line (in Ohm)

  • x: the reactance of the line (in Ohm)

  • g1: the conductance of line at its “1” side (in Siemens)

  • b1: the susceptance of line at its “1” side (in Siemens)

  • g2: the conductance of line at its “2” side (in Siemens)

  • b2: the susceptance of line at its “2” side (in Siemens)

  • p1: the active flow on the line at its “1” side, NaN if no loadflow has been computed (in MW)

  • q1: the reactive flow on the line at its “1” side, NaN if no loadflow has been computed (in MVAr)

  • i1: the current on the line at its “1” side, NaN if no loadflow has been computed (in A)

  • p2: the active flow on the line at its “2” side, NaN if no loadflow has been computed (in MW)

  • q2: the reactive flow on the line at its “2” side, NaN if no loadflow has been computed (in MVAr)

  • i2: the current on the line at its “2” side, NaN if no loadflow has been computed (in A)

  • voltage_level1_id: voltage level where the line is connected, on side 1

  • voltage_level2_id: voltage level where the line is connected, on side 2

  • bus1_id: bus where this line is connected, on side 1

  • bus2_id: bus where this line is connected, on side 2

  • bus_breaker_bus1_id (optional): bus of the bus-breaker view where this line is connected, on side 1

  • bus_breaker_bus2_id (optional): bus of the bus-breaker view where this line is connected, on side 2

  • node1 (optional): node where this line is connected on side 1, in node-breaker voltage levels

  • node2 (optional): node where this line is connected on side 2, in node-breaker voltage levels

  • connected1: True if the side “1” of the line is connected to a bus

  • connected2: True if the side “2” of the line is connected to a bus - fictitious (optional): True if the line is part of the model and not of the actual network

This dataframe is indexed by the id of the lines.

Examples

net = pp.network.create_ieee14()
net.get_lines()

will output something like:

r

x

g1

b1

g2

b2

p1

q1

i1

p2

q2

i2

voltage_level1_id

voltage_level2_id

bus1_id

bus2_id

connected1

connected2

id

L1-2-1

0.000194

0.000592

0.0

2.64

0.0

2.64

NaN

NaN

NaN

NaN

NaN

NaN

VL1

VL2

VL1_0

VL2_0

True

True

L1-5-1

0.000540

0.002230

0.0

2.46

0.0

2.46

NaN

NaN

NaN

NaN

NaN

NaN

VL1

VL5

VL1_0

VL5_0

True

True

net = pp.network.create_ieee14()
net.get_lines(all_attributes=True)

will output something like:

r

x

g1

b1

g2

b2

p1

q1

i1

p2

q2

i2

voltage_level1_id

voltage_level2_id

bus1_id

bus2_id

connected1

connected2

id

L1-2-1

0.000194

0.000592

0.0

2.64

0.0

2.64

NaN

NaN

NaN

NaN

NaN

NaN

VL1

VL2

VL1_0

VL2_0

True

True

L1-5-1

0.000540

0.002230

0.0

2.46

0.0

2.46

NaN

NaN

NaN

NaN

NaN

NaN

VL1

VL5

VL1_0

VL5_0

True

True

net = pp.network.create_ieee14()
net.get_lines(attributes=['p1','q1','i1','p2','q2','i2','voltage_level1_id','voltage_level2_id','bus1_id','bus2_id','connected1','connected2'])

will output something like:

p1

q1

i1

p2

q2

i2

voltage_level1_id

voltage_level2_id

bus1_id

bus2_id

connected1

connected2

id

L1-2-1

NaN

NaN

NaN

NaN

NaN

NaN

VL1

VL2

VL1_0

VL2_0

True

True

L1-5-1

NaN

NaN

NaN

NaN

NaN

NaN

VL1

VL5

VL1_0

VL5_0

True

True