Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Sld parameters in doc #775

Merged
merged 6 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
So-Fras marked this conversation as resolved.
Show resolved Hide resolved
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.
101 changes: 101 additions & 0 deletions docs/user_guide/network_visualization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,107 @@ 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 node 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 (we need to get a whole substation here to see the difference)
.. code-block:: python

>>> param = pn.SldParameters(topological_coloring = True)
>>> network.get_single_line_diagram('S4', parameters = param)

.. image:: ../_static/images/ieee14_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('S4', parameters = param)

.. image:: ../_static/images/ieee14_SldParam_topologicalcoloringfalse.svg
:class: forced-white-background

- with component_library = "FlatDesign"
.. code-block:: python

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