Skip to content

Commit

Permalink
Add documentation about Node/Breaker and Bus/Breaker topology
Browse files Browse the repository at this point in the history
Signed-off-by: Damien Jeandemange <damien.jeandemange@artelys.com>
  • Loading branch information
jeandemanged committed Sep 27, 2024
1 parent b4537e1 commit 58f7a8c
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 4 deletions.
25 changes: 23 additions & 2 deletions docs/reference/network.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ All network elements are accessible as dataframes, using the following getters.
Network.get_aliases
Network.get_batteries
Network.get_branches
Network.get_bus_breaker_topology
Network.get_busbar_sections
Network.get_buses
Network.get_current_limits
Expand All @@ -87,7 +86,6 @@ All network elements are accessible as dataframes, using the following getters.
Network.get_lines
Network.get_loads
Network.get_linear_shunt_compensator_sections
Network.get_node_breaker_topology
Network.get_non_linear_shunt_compensator_sections
Network.get_operational_limits
Network.get_phase_tap_changer_steps
Expand All @@ -104,6 +102,29 @@ All network elements are accessible as dataframes, using the following getters.
Network.get_vsc_converter_stations
Network.get_tie_lines

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

.. autosummary::
:toctree: api/
:nosignatures:

Network.get_bus_breaker_topology
Network.get_node_breaker_topology

These getters return an object of the following classes:

.. autosummary::
:nosignatures:

BusBreakerTopology
NodeBreakerTopology

.. include it in the toctree
.. toctree::
:hidden:

network/bus_breaker_topology
network/node_breaker_topology

Network elements update
------------------------
Expand Down
7 changes: 7 additions & 0 deletions docs/reference/network/bus_breaker_topology.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pypowsybl.network.BusBreakerTopology
====================================

.. currentmodule:: pypowsybl.network

.. autoclass:: BusBreakerTopology
:members:
7 changes: 7 additions & 0 deletions docs/reference/network/node_breaker_topology.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pypowsybl.network.NodeBreakerTopology
=====================================

.. currentmodule:: pypowsybl.network

.. autoclass:: NodeBreakerTopology
:members:
2 changes: 1 addition & 1 deletion docs/user_guide/network.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Then a list of post processors can be pass to the load function:

.. code-block:: python
network = pp.network.load('mycgmes.zip', post_processor_names=['replaceTieLinesByLines'])
network = pp.network.load('mycgmes.zip', post_processors=['replaceTieLinesByLines'])
Save a network
Expand Down
26 changes: 25 additions & 1 deletion pypowsybl/network/impl/bus_breaker_topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,29 @@ def __init__(self, network_handle: _pp.JavaHandle, voltage_level_id: str):
def switches(self) -> DataFrame:
"""
The list of switches of the bus breaker view, together with their connection status, as a dataframe.
The dataframe includes the following columns:
- **kind**: Switch kind (BREAKER, DISCONNECTOR, ...)
- **open**: True if the switch is opened
- **bus1_id**: node where the switch is connected at side 1
- **bus2_id**: node where the switch is connected at side 2
This dataframe is indexed by the id of the switches.
"""
return self._switchs

@property
def buses(self) -> DataFrame:
"""
The list of buses of the bus breaker view, as a dataframe.
The list of buses of the bus breaker view, as a dataframe.
The dataframe includes the following columns:
- **name**: Name of the bus breaker view bus
- **bus_id**: id of the corresponding bus in the bus view.
This dataframe is indexed by the id of the bus breaker view bus.
"""
return self._buses

Expand All @@ -47,6 +63,14 @@ def elements(self) -> DataFrame:
"""
The list of elements (lines, generators...) of this voltage level, together with the bus
of the bus breaker view where they are connected.
The dataframe includes the following columns:
- **type**: Type of the connected element (GENERATOR, LINE, ...)
- **bus_id**: bus id of the bus breaker view
- **side**: Side of the connected element
This dataframe is indexed by the id of the connected elements.
"""
return self._elements

Expand Down
22 changes: 22 additions & 0 deletions pypowsybl/network/impl/node_breaker_topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ def __init__(self, network_handle: _pp.JavaHandle, voltage_level_id: str):
def switches(self) -> DataFrame:
"""
The list of switches of the voltage level, together with their connection status, as a dataframe.
The dataframe includes the following columns:
- **name**: Switch name
- **kind**: Switch kind (BREAKER, DISCONNECTOR, ...)
- **open**: True if the switch is opened
- **retained**: True if the switch is to be retained in the Bus/Breaker view
- **node1**: node where the switch is connected at side 1
- **node2**: node where the switch is connected at side 2
This dataframe is indexed by the id of the switches.
"""
return self._switchs

Expand All @@ -39,13 +50,24 @@ def nodes(self) -> DataFrame:
"""
The list of nodes of the voltage level, together with their corresponding network element (if any),
as a dataframe.
The dataframe includes the following columns:
- **connectable_id**: Connected element, if any.
This dataframe is indexed by the id of the nodes.
"""
return self._nodes

@property
def internal_connections(self) -> DataFrame:
"""
The list of internal connection of the voltage level, together with the nodes they connect.
The dataframe includes the following columns:
- **node1**: node where the internal connection is connected at side 1
- **node2**: node where the internal connection is connected at side 2
"""
return self._internal_connections

Expand Down

0 comments on commit 58f7a8c

Please sign in to comment.