From 58f7a8c8052f9e90418086e62b7957e859bc97a3 Mon Sep 17 00:00:00 2001 From: Damien Jeandemange Date: Fri, 27 Sep 2024 18:28:27 +0200 Subject: [PATCH] Add documentation about Node/Breaker and Bus/Breaker topology Signed-off-by: Damien Jeandemange --- docs/reference/network.rst | 25 ++++++++++++++++-- .../network/bus_breaker_topology.rst | 7 +++++ .../network/node_breaker_topology.rst | 7 +++++ docs/user_guide/network.rst | 2 +- .../network/impl/bus_breaker_topology.py | 26 ++++++++++++++++++- .../network/impl/node_breaker_topology.py | 22 ++++++++++++++++ 6 files changed, 85 insertions(+), 4 deletions(-) create mode 100644 docs/reference/network/bus_breaker_topology.rst create mode 100644 docs/reference/network/node_breaker_topology.rst diff --git a/docs/reference/network.rst b/docs/reference/network.rst index 5c81bf199..cd89db825 100644 --- a/docs/reference/network.rst +++ b/docs/reference/network.rst @@ -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 @@ -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 @@ -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 ------------------------ diff --git a/docs/reference/network/bus_breaker_topology.rst b/docs/reference/network/bus_breaker_topology.rst new file mode 100644 index 000000000..b4b532580 --- /dev/null +++ b/docs/reference/network/bus_breaker_topology.rst @@ -0,0 +1,7 @@ +pypowsybl.network.BusBreakerTopology +==================================== + +.. currentmodule:: pypowsybl.network + +.. autoclass:: BusBreakerTopology + :members: diff --git a/docs/reference/network/node_breaker_topology.rst b/docs/reference/network/node_breaker_topology.rst new file mode 100644 index 000000000..75bbdf268 --- /dev/null +++ b/docs/reference/network/node_breaker_topology.rst @@ -0,0 +1,7 @@ +pypowsybl.network.NodeBreakerTopology +===================================== + +.. currentmodule:: pypowsybl.network + +.. autoclass:: NodeBreakerTopology + :members: diff --git a/docs/user_guide/network.rst b/docs/user_guide/network.rst index 7cba8431a..79f04d409 100644 --- a/docs/user_guide/network.rst +++ b/docs/user_guide/network.rst @@ -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 diff --git a/pypowsybl/network/impl/bus_breaker_topology.py b/pypowsybl/network/impl/bus_breaker_topology.py index 956730d80..2f49860c2 100644 --- a/pypowsybl/network/impl/bus_breaker_topology.py +++ b/pypowsybl/network/impl/bus_breaker_topology.py @@ -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 @@ -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 diff --git a/pypowsybl/network/impl/node_breaker_topology.py b/pypowsybl/network/impl/node_breaker_topology.py index 4f6386191..a423929d6 100644 --- a/pypowsybl/network/impl/node_breaker_topology.py +++ b/pypowsybl/network/impl/node_breaker_topology.py @@ -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 @@ -39,6 +50,12 @@ 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 @@ -46,6 +63,11 @@ def nodes(self) -> DataFrame: 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