pypowsybl.network.Network.get_loads#

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

Get a dataframe of loads.

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:

the loads dataframe

Return type:

DataFrame

Notes

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

  • type: type of load

  • p0: the active load consumption setpoint (MW)

  • q0: the reactive load consumption setpoint (MVAr)

  • p: the result active load consumption, it is NaN is not loadflow has been computed (MW)

  • q: the result reactive load consumption, it is NaN is not loadflow has been computed (MVAr)

  • i: the current on the load, NaN if no loadflow has been computed (in A)

  • voltage_level_id: at which substation this load is connected

  • bus_id: bus where this load is connected

  • bus_breaker_bus_id (optional): bus of the bus-breaker view where this load is connected

  • node (optional): node where this load is connected, in node-breaker voltage levels

  • connected: True if the load is connected to a bus

  • fictitious (optional): True if the load is part of the model and not of the actual network

This dataframe is indexed on the load ID.

Examples

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

will output something like:

type

p0

q0

p

q

voltage_level_id

bus_id

connected

id

B2-L

UNDEFINED

21.7

12.7

NaN

NaN

VL2

VL2_0

True

B3-L

UNDEFINED

94.2

19.0

NaN

NaN

VL3

VL3_0

True

B4-L

UNDEFINED

47.8

-3.9

NaN

NaN

VL4

VL4_0

True

B5-L

UNDEFINED

7.6

1.6

NaN

NaN

VL5

VL5_0

True

B6-L

UNDEFINED

11.2

7.5

NaN

NaN

VL6

VL6_0

True

B9-L

UNDEFINED

29.5

16.6

NaN

NaN

VL9

VL9_0

True

B10-L

UNDEFINED

9.0

5.8

NaN

NaN

VL10

VL10_0

True

B11-L

UNDEFINED

3.5

1.8

NaN

NaN

VL11

VL11_0

True

B12-L

UNDEFINED

6.1

1.6

NaN

NaN

VL12

VL12_0

True

B13-L

UNDEFINED

13.5

5.8

NaN

NaN

VL13

VL13_0

True

B14-L

UNDEFINED

14.9

5.0

NaN

NaN

VL14

VL14_0

True

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

will output something like:

type

p0

q0

p

q

voltage_level_id

bus_id

connected

id

B2-L

UNDEFINED

21.7

12.7

NaN

NaN

VL2

VL2_0

True

B3-L

UNDEFINED

94.2

19.0

NaN

NaN

VL3

VL3_0

True

B4-L

UNDEFINED

47.8

-3.9

NaN

NaN

VL4

VL4_0

True

B5-L

UNDEFINED

7.6

1.6

NaN

NaN

VL5

VL5_0

True

B6-L

UNDEFINED

11.2

7.5

NaN

NaN

VL6

VL6_0

True

B9-L

UNDEFINED

29.5

16.6

NaN

NaN

VL9

VL9_0

True

B10-L

UNDEFINED

9.0

5.8

NaN

NaN

VL10

VL10_0

True

B11-L

UNDEFINED

3.5

1.8

NaN

NaN

VL11

VL11_0

True

B12-L

UNDEFINED

6.1

1.6

NaN

NaN

VL12

VL12_0

True

B13-L

UNDEFINED

13.5

5.8

NaN

NaN

VL13

VL13_0

True

B14-L

UNDEFINED

14.9

5.0

NaN

NaN

VL14

VL14_0

True

net = pp.network.create_ieee14()
net.get_loads(attributes=['type','p','q','voltage_level_id','bus_id','connected'])

will output something like:

type

p

q

voltage_level_id

bus_id

connected

id

B2-L

UNDEFINED

NaN

NaN

VL2

VL2_0

True

B3-L

UNDEFINED

NaN

NaN

VL3

VL3_0

True

B4-L

UNDEFINED

NaN

NaN

VL4

VL4_0

True

B5-L

UNDEFINED

NaN

NaN

VL5

VL5_0

True

B6-L

UNDEFINED

NaN

NaN

VL6

VL6_0

True

B9-L

UNDEFINED

NaN

NaN

VL9

VL9_0

True

B10-L

UNDEFINED

NaN

NaN

VL10

VL10_0

True

B11-L

UNDEFINED

NaN

NaN

VL11

VL11_0

True

B12-L

UNDEFINED

NaN

NaN

VL12

VL12_0

True

B13-L

UNDEFINED

NaN

NaN

VL13

VL13_0

True

B14-L

UNDEFINED

NaN

NaN

VL14

VL14_0

True