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:

is_loadable

Check if a file is a loadable network.

load

Load a network from a file.

load_from_string

Load a network from a string.

load_from_binary_buffer

Load a network from a binary buffer.

load_from_binary_buffers

Load a network from a list of binary buffers.

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_more_generators_network

Create an instance of example 1 network of Eurostag tutorial, with a second generator

create_eurostag_tutorial_example1_with_power_limits_network

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

create_eurostag_tutorial_example1_with_tie_lines_and_areas

Create an instance of example 1 network of Eurostag tutorial with tie lines and areas

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

create_metrix_tutorial_six_buses_network

Create an instance of metrix tutorial six buses 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.per_unit

Defines if the network data should be used in per-unit.

Network.nominal_apparent_power

The nominal power to per unit the network (kVA)

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_areas

Get a dataframe of areas.

Network.get_areas_boundaries

Get a dataframe of areas boundaries.

Network.get_areas_voltage_levels

Get a dataframe of areas voltage levels.

Network.get_batteries

Get a dataframe of batteries.

Network.get_branches

Get a dataframe of branches

Network.get_busbar_sections

Get a dataframe of busbar sections.

Network.get_buses

Get a dataframe of buses from the bus view.

Network.get_bus_breaker_view_buses

Get a dataframe of buses from the bus/breaker view.

Network.get_boundary_lines

Get a dataframe of boundary lines.

Network.get_dangling_lines

Network.get_boundary_lines_generation

Get a dataframe of boundary lines generation part.

Network.get_dangling_lines_generation

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_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.get_tie_lines

Get a dataframe of tie lines.

Network.get_grounds

Get a dataframe of grounds.

Network.get_sub_networks

Get a dataframe of sub networks

Network.get_sub_network

Get a sub network from its parent network.

Network.detach

Detach a sub network from its parent network.

Network.get_dc_nodes

Get a dataframe of dc nodes.

Network.get_dc_lines

Get a dataframe of DC lines

Network.get_voltage_source_converters

Get a dataframe of voltage source converters.

Network.get_dc_grounds

Get a dataframe of dc grounds.

Network.get_dc_buses

Get a dataframe of dc buses.

Bus/Breaker or Node/Breaker topology description of a given voltage level can be retrieved using the following getters:

Network.get_bus_breaker_topology

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

Network.get_node_breaker_topology

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

These getters return an object of the following classes:

BusBreakerTopology

Bus-breaker representation of the topology of a voltage level.

NodeBreakerTopology

Node-breaker representation of the topology of a voltage level.

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_3_windings_transformers

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

Network.update_areas

Update areas 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_branches

Update branches 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_busbar_sections

Update bus bar sections with a Pandas dataframe.

Network.update_boundary_lines

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

Network.update_dangling_lines

Network.update_boundary_lines_generation

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

Network.update_dangling_lines_generation

Network.update_generators

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

Network.update_grounds

Update grounds 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_injections

Update injections 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_operational_limits

Update operational limits values 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_phase_tap_changer_steps

Update phase tap changer steps 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_ratio_tap_changer_steps

Update ratio tap changer steps 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_terminals

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

Network.update_tie_lines

Update tie lines 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.update_dc_nodes

Update dc nodes with data provided as a dataframe or as named arguments.

Network.update_dc_lines

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

Network.update_voltage_source_converters

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

Network.update_dc_grounds

Update dc grounds with data provided as a dataframe or as named arguments.

Network.update_dc_buses

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

Network.get_elements_properties

Get a dataframe of properties of all network elements.

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

Replaces the "input" values used for load flow calculation by their solved values returned by the load flow calculation.

Network.apply_solved_tap_position_and_section_count_values

Replaces the "input" values used for load flow calculation by their solved values returned by the load flow calculation, only for tap position and section count.

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_3_windings_transformers

Creates three-winding transformers.

Network.create_areas

Create areas.

Network.create_areas_voltage_levels

Associate voltage levels to (existing) areas.

Network.create_areas_boundaries

Define boundaries of (existing) areas.

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_boundary_lines

Creates boundary lines.

Network.create_dangling_lines

Network.create_generators

Creates generators.

Network.create_grounds

Create grounds.

Network.create_hvdc_lines

Creates HVDC lines.

Network.create_internal_connections

Creates internal connections.

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

Creates tie lines from two boundary lines.

Network.create_dc_nodes

Creates DC nodes.

Network.create_dc_lines

Creates DC lines.

Network.create_voltage_source_converters

Creates voltage source converter.

Network.create_dc_grounds

Creates DC grounds.

Network.remove_elements

Removes elements from the network.

Network.remove_internal_connections

Removes internal connections.

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

Reduce to a smaller network (only keeping voltage levels whose id is in the specified list)

Network.reduce_by_voltage_range

Reduce to a smaller network (only keeping all elements whose nominal voltage is in the specified voltage range)

Network.reduce_by_ids_and_depths

Reduce to a smaller network (keeping the specified voltage levels with all respective neighbours at most at the specified depth).

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_matrix_multi_substation_single_line_diagram

Create a single line diagram from multiple substations

Network.write_matrix_multi_substation_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

Network.write_network_area_diagram

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

Network.get_network_area_diagram_displayed_voltage_levels

Gathers the name of the displayed voltage levels of a network-area diagram in a list, according to the input voltage level(s) and the depth of the diagram.

Network.get_default_nad_profile

Creates a default NadProfile for branch labels, twt labels, injection labels, bus descriptions, and VL descriptions.

Network.disconnect

Disconnects a connectable element's terminal or terminals.

Network.connect

Connects a connectable element's terminal or terminals.

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.

load_from_binary_buffer

Load a network from a binary buffer.

load_from_binary_buffers

Load a network from a list of binary buffers.

Network.update_from_file

Updates a network by loading information from a file.

Network.update_from_binary_buffer

Update a network from a binary buffer.

Network.update_from_binary_buffers

Update a network from a list of binary buffers.

Network.dump

Network.dump_to_string

get_import_formats

Get list of supported import formats

get_import_parameters

Supported import parameters for a given format.

get_import_post_processors

Get list of supported import post processors

get_export_formats

Get list of supported export formats

get_export_parameters

Get supported export parameters infos for a given format

Network.save

Save a network to a file using the specified format.

Network.save_to_string

Save a network to a string using a specified format.

Network.save_to_binary_buffer

Save a network to a binary buffer using a specified format.

Advanced network modifications

create_2_windings_transformer_bays

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

create_line_bays

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

create_load_bay

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

create_battery_bay

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

create_boundary_line_bay

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

create_dangling_line_bay

create_generator_bay

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

create_shunt_compensator_bay

Creates a shunt compensator, connects it to the network on a given bus or 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 bus or 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 bus or 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 bus or 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.

create_voltage_level_topology

Creates the topology of a given symmetrical voltage level, containing a given number of busbar with a given number of sections.

create_coupling_device

Creates a coupling device on the network between two busbar sections of a same voltage level.

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.

Scalable network modifications

These network modifications can be created to apply active power change across one or multiple injections

Scalable.scale

Apply the active power scaling to a given network.

InjectionScalable

Scalable based on a single injection.

StackScalable

Scalable that applies the asked modification on a list of underlying scalables, using them in order.

StackScalable.from_injections

Create a StackScalable from a list of injection ids.

StackScalable.from_scalables

Create a StackScalable from a list of underlying Scalable.

ProportionalScalable

Scalable based on a proportional repartition of power change between underlying elements.

ProportionalScalable.from_injections_and_percentages

Create a ProportionalScalable from a list of injection IDs and their corresponding percentage of power repartition.

ProportionalScalable.from_scalables_and_percentages

Create a ProportionalScalable from a list of Scalable and their corresponding percentage of power repartition.

ProportionalScalable.from_injections_and_distribution_mode

Create a ProportionalScalable from a list of injection IDs, computing their respective percentage of power repartition according to a given distribution mode.

UpDownScalable

Scalable based on two others : one used when scaling the power up and one to scale the power down

UpDownScalable.from_injections

Create an UpDownScalable from two injection ids.

UpDownScalable.from_scalables

Create an UpDownScalable from two Scalable.

The scale method is parametrized by a ScalingParameters object :

ScalingParameters

Parameters to modify active power with a Scalable.