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]

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_four_substations_node_breaker_network

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

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_batteries

Get a dataframe of batteries.

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_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_non_linear_shunt_compensator_sections

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

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_voltage_level_topology

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

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_elements

Update network elements with data provided as a DataFrame or as named arguments.for a specified element type.

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_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_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_switches

Update switches 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 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.

Miscellaneous network functions

Network.reduce

Network.merge

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.disconnect

Network.connect

Network.open_switch

Network.close_switch

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 a 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