Skip to content

Commit

Permalink
add Sld parameters in doc (#775)
Browse files Browse the repository at this point in the history
* add Sld parameters in doc
---------

Signed-off-by: Tiphaine Mouminous <tiphaine.mouminous_externe@rte-france.com>
  • Loading branch information
unetablettedechocolat authored and geofjamg committed Aug 24, 2024
1 parent d605170 commit 6c2002a
Show file tree
Hide file tree
Showing 12 changed files with 4,953 additions and 0 deletions.
632 changes: 632 additions & 0 deletions docs/_static/images/SldParam_topologicalcoloringfalse.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
701 changes: 701 additions & 0 deletions docs/_static/images/SldParam_topologicalcoloringtrue.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
364 changes: 364 additions & 0 deletions docs/_static/images/ieee14_SldParam_centername.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
350 changes: 350 additions & 0 deletions docs/_static/images/ieee14_SldParam_complib_flatdesign.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
364 changes: 364 additions & 0 deletions docs/_static/images/ieee14_SldParam_default.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
364 changes: 364 additions & 0 deletions docs/_static/images/ieee14_SldParam_diagonallabel.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
371 changes: 371 additions & 0 deletions docs/_static/images/ieee14_SldParam_nodesinfos.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
635 changes: 635 additions & 0 deletions docs/_static/images/ieee14_SldParam_topologicalcoloringfalse.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
704 changes: 704 additions & 0 deletions docs/_static/images/ieee14_SldParam_topologicalcoloringtrue.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
364 changes: 364 additions & 0 deletions docs/_static/images/ieee14_SldParam_usename.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
104 changes: 104 additions & 0 deletions docs/user_guide/network_visualization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,110 @@ Note that a loadflow can be run before writing the diagram so that it displays r
.. image:: ../_static/images/ieee14_vl4.svg
:class: forced-white-background

Single-line diagrams can be customized through SldParameters:

.. code-block:: python
>>> network = pp.network.create_ieee14()
>>> result = pp.loadflow.run_ac(network)
>>> network.get_single_line_diagram('VL4',parameters = pp.network.SldParameters(use_name = False, center_name = False, diagonal_label = False, nodes_infos = False, tooltip_enabled = False, topological_coloring = True, component_library = 'Convergence'))
- use_name: if true, display components names instead of their id (default value false)
- center_name: if true, center the names of feeders (default value false)
- diagonal_label: if true, display labels diagonally (default value false)
- nodes_infos: if true, display nodes infos (caption on bottom left) (default value false)
- tooltip_enabled: if true, display the name of the component pointed by the cursor (default value false)
- topological_coloring: if true, set each electrical nodes with a different colour (default value true)
- component_library: choose component library (default value 'Convergence')
Let's see some examples down below:

- with default parameters
.. code-block:: python
>>> import pypowsybl.network as pn
>>> param = pn.SldParameters() #default parameters
>>> network.get_single_line_diagram('VL4', parameters = param)
.. image:: ../_static/images/ieee14_SldParam_default.svg
:class: forced-white-background

- with use_name = true
.. code-block:: python
>>> param = pn.SldParameters(use_name = True)
>>> network.get_single_line_diagram('VL4', parameters = param)
.. image:: ../_static/images/ieee14_SldParam_usename.svg
:class: forced-white-background

- with center_name = true
.. code-block:: python
>>> param = pn.SldParameters(center_name = True)
>>> network.get_single_line_diagram('VL4', parameters = param)
.. image:: ../_static/images/ieee14_SldParam_centername.svg
:class: forced-white-background

- with diagonal_label = true
.. code-block:: python
>>> param = pn.SldParameters(diagonal_label = True)
>>> network.get_single_line_diagram('VL4', parameters = param)
.. image:: ../_static/images/ieee14_SldParam_diagonallabel.svg
:class: forced-white-background

- with nodes_infos = true
.. code-block:: python
>>> param = pn.SldParameters(nodes_infos = True)
>>> network.get_single_line_diagram('VL4', parameters = param)
.. image:: ../_static/images/ieee14_SldParam_nodesinfos.svg
:class: forced-white-background

- with tooltip enabled
.. code-block:: python
>>> param = pn.SldParameters(tooltip_enabled = True)
>>> network.get_single_line_diagram('VL4', parameters = param)
.. image:: ../_static/images/ieee14_SldParam_tooltipenabledtrue.png
:class: forced-white-background

- with topological coloring = true
.. code-block:: python
>>> network = pn.create_four_substations_node_breaker_network()
>>> network.update_switches(id="S1VL2_COUPLER",open=True)
>>> param = pn.SldParameters(topological_coloring = True)
>>> network.get_single_line_diagram('S1VL2', parameters = param)
.. image:: ../_static/images/SldParam_topologicalcoloringtrue.svg
:class: forced-white-background

- with topological coloring = false
.. code-block:: python
>>> param = pn.SldParameters(topological_coloring = False)
>>> network.get_single_line_diagram('S1VL2', parameters = param)
.. image:: ../_static/images/SldParam_topologicalcoloringfalse.svg
:class: forced-white-background

- with component_library = "FlatDesign"
.. code-block:: python
>>> network = pn.create_ieee14()
>>> param = pn.SldParameters(component_library = "FlatDesign")
>>> network.get_single_line_diagram('VL4', parameters = param)
.. image:: ../_static/images/ieee14_SldParam_complib_flatdesign.svg
:class: forced-white-background


It is also possible to display a multi-substation single line diagram (currently a beta feature):

.. code-block:: python
Expand Down

0 comments on commit 6c2002a

Please sign in to comment.