Network

The Network class is the representation of a power network in pypowsybl, it provides methods to access and modify underlying network elements data.

class Network(handle)[source]
Parameters

handle (_pp.JavaHandle) –

Network creation

Following methods may be used to create a new network instance:

load

Load a network from a file.

load_from_string

Load a network from a string.

create_empty

Create an empty network.

create_ieee9

Create an instance of IEEE 9 bus network

create_ieee14

Create an instance of IEEE 14 bus network

create_ieee30

Create an instance of IEEE 30 bus network

create_ieee57

Create an instance of IEEE 57 bus network

create_ieee118

Create an instance of IEEE 118 bus network

create_ieee300

Create an instance of IEEE 300 bus network

create_eurostag_tutorial_example1_network

Create an instance of example 1 network of Eurostag tutorial

create_eurostag_tutorial_example1_with_power_limits_network

Create an instance of example 1 network of Eurostag tutorial with Power limits

create_four_substations_node_breaker_network

Create an instance of powsybl "4 substations" test case.

create_four_substations_node_breaker_network_with_extensions

Create an instance of powsybl "4 substations" test case with ConnectablePosition and BusbarSectionPosition extensions.

create_micro_grid_be_network

Create an instance of micro grid BE CGMES test case

create_micro_grid_nl_network

Create an instance of micro grid NL CGMES test case

Network properties

Network.id

ID of this network

Network.name

Name of this network

Network.source_format

Format of the source where this network came from.

Network.case_date

Date of this network case, in UTC timezone.

Network.forecast_distance

0 for a snapshot.

Network elements access

All network elements are accessible as dataframes, using the following getters.

Note

Once obtained, a dataframe has no more relation to the network it originated from. In particular, changing a dataframe will not change the underlying network. Also, in order to get up-to-date data, for example after a loadflow execution, you will need to call again the corresponding getter.

Network.get_2_windings_transformers

Get a dataframe of 2 windings transformers.

Network.get_3_windings_transformers

Get a dataframe of 3 windings transformers.

Network.get_aliases

Get a dataframe of aliases of all network elements.

Network.get_batteries

Get a dataframe of batteries.

Network.get_branches

Get a dataframe of branches

Network.get_bus_breaker_topology

Get the bus breaker description of the topology of a voltage level.

Network.get_busbar_sections

Get a dataframe of busbar sections.

Network.get_buses

Get a dataframe of buses.

Network.get_current_limits

Get the list of all current limits on the network paired with their branch id.

Network.get_dangling_lines

Get a dataframe of dangling lines.

Network.get_generators

Get a dataframe of generators.

Network.get_hvdc_lines

Get a dataframe of HVDC lines.

Network.get_identifiables

Get a dataframe of identifiables

Network.get_injections

Get a dataframe of injections

Network.get_lcc_converter_stations

Get a dataframe of LCC converter stations.

Network.get_lines

Get a dataframe of lines data.

Network.get_loads

Get a dataframe of loads.

Network.get_linear_shunt_compensator_sections

Get a dataframe of shunt compensators sections for linear model.

Network.get_node_breaker_topology

Get the node breaker description of the topology of a voltage level.

Network.get_non_linear_shunt_compensator_sections

Get a dataframe of shunt compensators sections for non linear model.

Network.get_operational_limits

Get the list of operational limits.

Network.get_phase_tap_changer_steps

Get a dataframe of phase tap changer steps.

Network.get_phase_tap_changers

Create a phase tap changers:class:~pandas.DataFrame.

Network.get_ratio_tap_changer_steps

Get a dataframe of ratio tap changer steps.

Network.get_ratio_tap_changers

Create a ratio tap changers:class:~pandas.DataFrame.

Network.get_reactive_capability_curve_points

Get a dataframe of reactive capability curve points.

Network.get_shunt_compensators

Get a dataframe of shunt compensators.

Network.get_static_var_compensators

Get a dataframe of static var compensators.

Network.get_substations

Get substations DataFrame.

Network.get_switches

Get a dataframe of switches.

Network.get_terminals

Get a dataframe of terminal

Network.get_voltage_levels

Get a dataframe of voltage levels.

Network.get_vsc_converter_stations

Get a dataframe of VSC converter stations.

Network elements update

Network elements can be modified using dataframes:

Network.update_2_windings_transformers

Update 2 windings transformers with data provided as a DataFrame or as named arguments.

Network.update_batteries

Update batteries with data provided as a DataFrame or as named arguments.

Network.update_buses

Update buses with data provided as a dataframe or as named arguments.

Network.update_dangling_lines

Update dangling lines with data provided as a DataFrame or as named arguments.

Network.update_generators

Update generators with data provided as a DataFrame or as named arguments.

Network.update_hvdc_lines

Update HVDC lines with data provided as a DataFrame or as named arguments.

Network.update_lcc_converter_stations

Update VSC converter stations with data provided as a DataFrame or as named arguments.

Network.update_linear_shunt_compensator_sections

Update shunt compensators with data provided as a DataFrame or as named arguments.

Network.update_lines

Update lines data with data provided as a DataFrame or as named arguments.

Network.update_loads

Update loads with data provided as a DataFrame or as named arguments.

Network.update_non_linear_shunt_compensator_sections

Update non linear shunt compensators sections with data provided as a DataFrame or as named arguments.

Network.update_phase_tap_changers

Update phase tap changers with data provided as a DataFrame or as named arguments.

Network.update_ratio_tap_changers

Update ratio tap changers with data provided as a DataFrame or as named arguments.

Network.update_shunt_compensators

Update shunt compensators with data provided as a DataFrame or as named arguments.

Network.update_static_var_compensators

Update static var compensators with data provided as a DataFrame or as named arguments.

Network.update_substations

Update substations with data provided as a DataFrame or as named arguments.

Network.update_switches

Update switches with data provided as a DataFrame or as named arguments.

Network.update_voltage_levels

Update voltage levels with data provided as a DataFrame or as named arguments.

Network.update_vsc_converter_stations

Update VSC converter stations with data provided as a DataFrame or as named arguments.

Network.add_elements_properties

Add properties to network elements, provided as a DataFrame or as named arguments.

Network.remove_elements_properties

Remove properties from a list of network elements

Network.add_aliases

Adds aliases to network elements.

Network.remove_aliases

Removes aliases of network elements.

Network elements creation and removal

Network elements can be created or removed using the following methods:

Network.create_2_windings_transformers

Creates 2 windings transformers.

Network.create_batteries

Creates batteries.

Network.create_busbar_sections

Creates bus bar sections.

Network.create_buses

Creates buses in bus-breaker voltage levels.

Network.create_curve_reactive_limits

Creates reactive limits as "curves".

Network.create_dangling_lines

Creates dangling lines.

Network.create_generators

Creates generators.

Network.create_hvdc_lines

Creates HVDC lines.

Network.create_lcc_converter_stations

Creates LCC converter stations.

Network.create_lines

Creates lines.

Network.create_loads

Create loads.

Network.create_minmax_reactive_limits

Creates reactive limits of type min/max.

Network.create_operational_limits

Creates operational limits.

Network.create_phase_tap_changers

Create phase tap changers on transformers.

Network.create_ratio_tap_changers

Create ratio tap changers on transformers.

Network.create_shunt_compensators

Create shunt compensators.

Network.create_static_var_compensators

Creates static var compensators.

Network.create_substations

Creates substations.

Network.create_switches

Creates switches.

Network.create_voltage_levels

Creates voltage levels.

Network.create_vsc_converter_stations

Creates VSC converter stations.

Network.remove_elements

Removes elements from the network.

Network variants management

Network variants may be used to manage multiple states of the network efficiently.

Network.get_working_variant_id

The current working variant ID.

Network.clone_variant

Creates a copy of the source variant

Network.set_working_variant

Changes the working variant.

Network.remove_variant

Removes a variant from the network.

Network.get_variant_ids

Get the list of existing variant IDs.

Network elements extensions

get_extensions_names

Get the list of available extensions.

get_extensions_information

Get more information about extensions

Network.get_extensions

Get an extension as a DataFrame for a specified extension name.

Network.create_extensions

create extensions of network elements with data provided as a DataFrame.

Network.update_extensions

Update extensions of network elements with data provided as a DataFrame.

Network.remove_extensions

Removes network elements extensions, given the extension's name.

Miscellaneous network functions

Network.reduce

Network.merge

Merges networks into this one.

Network.get_single_line_diagram

Create a single line diagram from a voltage level or a substation.

Network.write_single_line_diagram_svg

Create a single line diagram in SVG format from a voltage level or a substation and write to a file.

Network.get_network_area_diagram

Create a network area diagram.

Network.write_network_area_diagram_svg

Create a network area diagram in SVG format and write it to a file.

Network.disconnect

Network.connect

Network.open_switch

Network.close_switch

Network.get_validation_level

The network's validation level.

Network.validate

Validate the network.

Network.set_min_validation_level

Set the minimum validation level for the network.

I/O

load

Load a network from a file.

load_from_string

Load a network from a string.

Network.dump

Save a network to a file using the specified format.

Network.dump_to_string

Save a network to a string using a specified format.

get_import_formats

Get list of supported import formats

get_import_parameters

Supported import parameters for a given format.

get_export_formats

Get list of supported export formats

get_export_parameters

Get supported export parameters infos for a given format

Advanced network modifications

create_2_windings_transformer_bays

Creates a transformer and connects it to busbar sections through standard feeder bays.

create_line_bays

Creates a line and connects it to busbar sections through standard feeder bays.

create_load_bay

Creates a load, connects it to the network on a given busbar section and creates the associated topology.

create_battery_bay

Creates a battery, connects it to the network on a given busbar section and creates the associated topology.

create_dangling_line_bay

Creates a dangling line, connects it to the network on a given busbar section and creates the associated topology.

create_generator_bay

Creates a generator, connects it to the network on a given busbar section and creates the associated topology.

create_shunt_compensator_bay

Creates a shunt compensator, connects it to the network on a given busbar section and creates the associated topology.

create_static_var_compensator_bay

Creates a static var compensator, connects it to the network on a given busbar section and creates the associated topology.

create_lcc_converter_station_bay

Creates a lcc converter station, connects it to the network on a given busbar section and creates the associated topology.

create_vsc_converter_station_bay

Creates a vsc converter station, connects it to the network on a given busbar section and creates the associated topology.

create_line_on_line

Connects an existing voltage level to an existing line through a tee point.

revert_create_line_on_line

This method reverses the action done in the create_line_on_line method.

connect_voltage_level_on_line

Cuts an existing line in two lines and connects an existing voltage level between them.

revert_connect_voltage_level_on_line

This method reverses the action done in the connect_voltage_level_on_line method.

replace_tee_point_by_voltage_level_on_line

This method transforms the action done in the create_line_on_line function into the action done in the connect_voltage_level_on_line.

revert_connect_voltage_level_on_line

This method reverses the action done in the connect_voltage_level_on_line method.

Utility functions

get_connectables_order_positions

Gets the order positions of every connectable of a given voltage level in a dataframe.

get_unused_order_positions_before

Gets all the available order positions before a busbar section.

get_unused_order_positions_after

Gets all the available order positions after a busbar section.