Skip to content

Commit

Permalink
Fix doc generation (#691)
Browse files Browse the repository at this point in the history
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
  • Loading branch information
geofjamg authored Jan 22, 2024
1 parent e2f75d3 commit bbb2e8e
Show file tree
Hide file tree
Showing 12 changed files with 82 additions and 72 deletions.
1 change: 0 additions & 1 deletion docs/reference/network.rst
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ Network elements can be created or removed using the following methods:

Network.create_2_windings_transformers
Network.create_batteries
Network.create_aliases
Network.create_busbar_sections
Network.create_buses
Network.create_curve_reactive_limits
Expand Down
12 changes: 6 additions & 6 deletions docs/reference/voltage_initializer.rst
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
=========
===================
Voltage Initializer
=========
===================

.. module:: pypowsybl.voltage_initializer

The voltage_initializer module is a tool to initialize voltage of a network before a loadflow and can prevent divergence.

Run the voltage initializer
------------
---------------------------
.. autosummary::
:toctree: api/

run

VoltageInitializerParameters : How to parameterize the tool
------------
-----------------------------------------------------------
.. autosummary::
:toctree: api/

Expand All @@ -28,11 +28,11 @@ VoltageInitializerParameters : How to parameterize the tool
VoltageInitializerParameters.set_objective_distance

VoltageInitializerResults : How to exploit the results
------------
------------------------------------------------------
.. autosummary::
:toctree: api/

VoltageInitializerResults
VoltageInitializerResults.apply_all_modification
VoltageInitializerResults.apply_all_modifications
VoltageInitializerResults.status
VoltageInitializerResults.indicators
2 changes: 1 addition & 1 deletion docs/user_guide/loadflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ OpenLoadFlow supports AC Newton-Raphson and linear DC calculation methods.
You may also use DynaFlow, provided by the `Dynawo <https://dynawo.github.io>`_ project.
DynaFlow is a new steady-state simulation tool that aims at calculating the steady-state point by using
a simplified time-domain simulation.
Please see configuration instructions on `Powsybl website <https://www.powsybl.org/pages/documentation/simulation/powerflow/dynaflow.html>`_.
Please see configuration instructions on `Powsybl website <https://www.powsybl.org/pages/documentation/simulation/powerflow/dynaflow.html>`__.


Parameters
Expand Down
2 changes: 1 addition & 1 deletion docs/user_guide/shortcircuit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ The parameters available to run a shortcircuit analysis are:


Simple example
-------------
--------------

.. code-block::
Expand Down
2 changes: 1 addition & 1 deletion pypowsybl/network/impl/layout_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class LayoutParameters(SldParameters):
"""
.. deprecated:: 1.1.0
Use :class:`SldParameters` instead.
Use :class:`SldParameters` instead.
This class is only used for backward compatibility and represents sld parameters for a single line diagram svg
generation."""
Expand Down
12 changes: 7 additions & 5 deletions pypowsybl/network/impl/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def dump(self, file: PathOrStr, format: str = 'XIIDM', parameters: ParamsDict =
reporter: Reporter = None) -> None:
"""
.. deprecated:: 1.1.0
Use :meth:`save` instead.
Use :meth:`save` instead.
"""
warnings.warn("dump is deprecated, use save instead", DeprecationWarning)
self.save(file, format, parameters, reporter)
Expand Down Expand Up @@ -163,7 +163,7 @@ def save(self, file: PathOrStr, format: str = 'XIIDM', parameters: ParamsDict =
def dump_to_string(self, format: str = 'XIIDM', parameters: ParamsDict = None, reporter: Reporter = None) -> str:
"""
.. deprecated:: 1.1.0
Use :meth:`save_to_string` instead.
Use :meth:`save_to_string` instead.
"""
warnings.warn("dump_to_string is deprecated, use save_to_string instead", DeprecationWarning)
return self.save_to_string(format, parameters, reporter)
Expand Down Expand Up @@ -258,7 +258,7 @@ def write_network_area_diagram_svg(self, svg_file: PathOrStr, voltage_level_ids:
edge_name_displayed: bool = False) -> None:
"""
.. deprecated:: 1.1.0
Use :class:`write_network_area_diagram_svg` with `NadParameters` instead.
Use :class:`write_network_area_diagram_svg` with `NadParameters` instead.
Create a network area diagram in SVG format and write it to a file.
Args:
Expand Down Expand Up @@ -1479,6 +1479,7 @@ def get_voltage_levels(self, all_attributes: bool = False, attributes: List[str]
- **low_voltage_limit**: the low voltage limit
- **fictitious** (optional): ``True`` if the voltage level is part of the model and not of the actual network
- **topology_kind** (optional): the voltage level topology kind (NODE_BREAKER or BUS_BREAKER)
This dataframe is indexed by the id of the voltage levels
Examples:
Expand Down Expand Up @@ -3244,7 +3245,8 @@ def get_variant_ids(self) -> List[str]:
def get_current_limits(self, all_attributes: bool = False, attributes: List[str] = None) -> DataFrame:
"""
.. deprecated::
Use :meth:`get_operational_limits` instead.
Use :meth:`get_operational_limits` instead.
Get the list of all current limits on the network paired with their branch id.
Args:
Expand Down Expand Up @@ -4462,7 +4464,7 @@ def get_extensions(self, extension_name: str, table_name: str = "") -> DataFrame
def get_extension(self, extension_name: str) -> DataFrame:
"""
.. deprecated::
Use :meth:`get_extensions` instead.
Use :meth:`get_extensions` instead.
"""
warnings.warn("get_extension is deprecated, use get_extensions instead", DeprecationWarning)
return self.get_extensions(extension_name)
Expand Down
107 changes: 58 additions & 49 deletions pypowsybl/network/impl/network_element_modification_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,31 +50,33 @@ def create_line_on_line(network: Network, deprecated_bbs_or_bus_id: str = None,
Args:
network: the network
df: attributes as a dataframe, it should contain:
bbs_or_bus_id: the ID of the existing bus or bus bar section of the voltage level voltage_level_id.
new_line_id: ID of the new line
new_line_r: resistance of the new line, in ohms
new_line_x: reactance of the new line, in ohms
new_line_b1: shunt susceptance on side 1 of the new line
new_line_b2: shunt susceptance on side 2 of the new line
new_line_g1: shunt conductance on side 1 of the new line
new_line_g2: shunt conductance on side 2 of the new line
line_id: the id on of the line on which we want to create a tee point.
line1_id: when the initial line is cut, the line segment at side 1 has a given ID (optional).
line1_name: when the initial line is cut, the line segment at side 1 has a given name (optional).
line2_id: when the initial line is cut, the line segment at side 2 has a given ID (optional).
line2_name: when the initial line is cut, the line segment at side 2 has a given name (optional).
position_percent: when the existing line is cut in two lines, percent is equal to the ratio between the parameters of the first line
and the parameters of the line that is cut multiplied by 100. 100 minus percent is equal to the ratio
between the parameters of the second line and the parameters of the line that is cut multiplied by 100.
create_fictitious_substation: True to create the fictitious voltage level inside a fictitious substation (false by default).
fictitious_voltage_level_id: the ID of the fictitious voltage level (optional) containing the tee point.
fictitious_voltage_level_name: the name of the fictitious voltage level (optional) containing the tee point.
fictitious_substation_id: the ID of the fictitious substation (optional).
fictitious_substation_name: the name of the fictitious substation (optional).
- bbs_or_bus_id: the ID of the existing bus or bus bar section of the voltage level voltage_level_id.
- new_line_id: ID of the new line
- new_line_r: resistance of the new line, in ohms
- new_line_x: reactance of the new line, in ohms
- new_line_b1: shunt susceptance on side 1 of the new line
- new_line_b2: shunt susceptance on side 2 of the new line
- new_line_g1: shunt conductance on side 1 of the new line
- new_line_g2: shunt conductance on side 2 of the new line
- line_id: the id on of the line on which we want to create a tee point.
- line1_id: when the initial line is cut, the line segment at side 1 has a given ID (optional).
- line1_name: when the initial line is cut, the line segment at side 1 has a given name (optional).
- line2_id: when the initial line is cut, the line segment at side 2 has a given ID (optional).
- line2_name: when the initial line is cut, the line segment at side 2 has a given name (optional).
- position_percent: when the existing line is cut in two lines, percent is equal to the ratio between the parameters of the first line
and the parameters of the line that is cut multiplied by 100. 100 minus percent is equal to the ratio
between the parameters of the second line and the parameters of the line that is cut multiplied by 100.
- create_fictitious_substation: True to create the fictitious voltage level inside a fictitious substation (false by default).
- fictitious_voltage_level_id: the ID of the fictitious voltage level (optional) containing the tee point.
- fictitious_voltage_level_name: the name of the fictitious voltage level (optional) containing the tee point.
- fictitious_substation_id: the ID of the fictitious substation (optional).
- fictitious_substation_name: the name of the fictitious substation (optional).
raise_exception: optionally, whether the calculation should throw exceptions. In any case, errors will
be logged. Default is False.
be logged. Default is False.
reporter: optionally, the reporter to be used to create an execution report, default is None (no report).
bbs_or_bus_id: the ID of the existing bus or bus bar section of the voltage level voltage_level_id.
bbs_or_bus_id: the ID of the existing bus or bus bar section of the voltage level voltage_level_id.
deprecated_bbs_or_bus_id: this argument is deprecated, use the dataframe instead
deprecated_new_line_id: this argument is deprecated, use the dataframe instead
deprecated_new_line_r: this argument is deprecated, use the dataframe instead
Expand Down Expand Up @@ -202,13 +204,15 @@ def revert_create_line_on_line(network: Network, deprecated_line_to_be_merged1_i
Args:
network: the network
df: attributes as a dataframe, it should contain:
line_to_be_merged1_id: The id of the first line connected to the tee point.
line_to_be_merged2_id: The id of the second line connected to the tee point.
line_to_be_deleted: The tee point line that will be deleted
merged_line_id: The id of the new line from the two lines to be merged
merged_line_name: The name of the new line from the two lines to be merged (default to line id)
- line_to_be_merged1_id: The id of the first line connected to the tee point.
- line_to_be_merged2_id: The id of the second line connected to the tee point.
- line_to_be_deleted: The tee point line that will be deleted
- merged_line_id: The id of the new line from the two lines to be merged
- merged_line_name: The name of the new line from the two lines to be merged (default to line id)
raise_exception: optionally, whether the calculation should throw exceptions. In any case, errors will
be logged. Default is False.
be logged. Default is False.
reporter: optionally, the reporter to be used to create an execution report, default is None (no report).
deprecated_line_to_be_merged1_id: this argument is deprecated, use the dataframe instead
deprecated_line_to_be_merged2_id: this argument is deprecated, use the dataframe instead
Expand Down Expand Up @@ -263,17 +267,19 @@ def connect_voltage_level_on_line(network: Network, deprecated_bbs_or_bus_id: st
Args:
network: the network
df: attributes as a dataframe, it should contain:
bbs_or_bus_id: The ID of the configured bus or bus bar section to which the lines will be connected.
line_id: the ID ot the line on which the voltage level should be connected.
position_percent: when the existing line is cut, percent is equal to the ratio between the parameters of the first line
- bbs_or_bus_id: The ID of the configured bus or bus bar section to which the lines will be connected.
- line_id: the ID ot the line on which the voltage level should be connected.
- position_percent: when the existing line is cut, percent is equal to the ratio between the parameters of the first line
and the parameters of the line that is cut multiplied by 100. 100 minus percent is equal to the ratio
between the parameters of the second line and the parameters of the line that is cut multiplied by 100.
line1_id: when the initial line is cut, the line segment at side 1 will receive this ID (optional).
line1_name: when the initial line is cut, the line segment at side 1 will receive this name (optional).
line2_id: when the initial line is cut, the line segment at side 2 will receive this ID (optional).
line2_name: when the initial line is cut, the line segment at side 2 will receive this name (optional).
- line1_id: when the initial line is cut, the line segment at side 1 will receive this ID (optional).
- line1_name: when the initial line is cut, the line segment at side 1 will receive this name (optional).
- line2_id: when the initial line is cut, the line segment at side 2 will receive this ID (optional).
- line2_name: when the initial line is cut, the line segment at side 2 will receive this name (optional).
raise_exception: optionally, whether the calculation should throw exceptions. In any case, errors will
be logged. Default is False.
be logged. Default is False.
reporter: optionally, the reporter to be used to create an execution report, default is None (no report).
deprecated_bbs_or_bus_id: this argument is deprecated, use the dataframe instead
deprecated_line_id: this argument is deprecated, use the dataframe instead
Expand Down Expand Up @@ -729,15 +735,17 @@ def replace_tee_point_by_voltage_level_on_line(network: Network, deprecated_tee_
Args:
network: the network in which the busbar sections are.
df: Attributes as a dataframe. It should contain:
tee_point_line1: The ID of the existing line connecting the first voltage level to the tee point
tee_point_line2: The ID of the existing line connecting the tee point to the second voltage level
tee_point_line_to_remove: The ID of the existing line connecting the tee point to the attached voltage level
bbs_or_bus_id: The ID of the existing bus or bus bar section in the attached voltage level voltageLevelId,
where we want to connect the new lines new line 1 and new line 2
new_line1_id: The ID of the new line connecting the first voltage level to the attached voltage level
new_line2_id: The ID of the new line connecting the second voltage level to the attached voltage level
new_line1_name: The optional name of the new line connecting the first voltage level to the attached voltage level
new_line2_name: The optional name of the new line connecting the second voltage level to the attached voltage level
- tee_point_line1: The ID of the existing line connecting the first voltage level to the tee point
- tee_point_line2: The ID of the existing line connecting the tee point to the second voltage level
- tee_point_line_to_remove: The ID of the existing line connecting the tee point to the attached voltage level
- bbs_or_bus_id: The ID of the existing bus or bus bar section in the attached voltage level voltageLevelId,
where we want to connect the new lines new line 1 and new line 2
- new_line1_id: The ID of the new line connecting the first voltage level to the attached voltage level
- new_line2_id: The ID of the new line connecting the second voltage level to the attached voltage level
- new_line1_name: The optional name of the new line connecting the first voltage level to the attached voltage level
- new_line2_name: The optional name of the new line connecting the second voltage level to the attached voltage level
raise_exception: whether an exception should be raised if a problem occurs. By default, false.
reporter: an optional reporter to get functional logs.
deprecated_tee_point_line1: this argument is deprecated, use the dataframe instead
Expand Down Expand Up @@ -831,7 +839,8 @@ def create_voltage_level_topology(network: Network, df: DataFrame = None, raise_
Examples:
.. code-block:: python
pp.network.create_voltage_level_topology(network=network, raise_exception=True, id='VL',
pp.network.create_voltage_level_topology(network=network, raise_exception=True, id='VL',
aligned_buses_or_busbar_count=3, switch_kinds='BREAKER, DISCONNECTOR')
"""
metadata = _pp.get_network_modification_metadata(NetworkModificationType.VOLTAGE_LEVEL_TOPOLOGY_CREATION)
Expand Down Expand Up @@ -1054,8 +1063,8 @@ def create_line_bays(network: Network, df: DataFrame = None, raise_exception: bo
Args:
network: the network to which we want to add the new line
df: Attributes as a dataframe.
raise_exception: optionally, whether the calculation should throw exceptions. In any case, errors will
be logged. Default is False.
raise_exception: optionally, whether the calculation should throw exceptions. In any case, errors will
be logged. Default is False.
reporter: optionally, the reporter to be used to create an execution report, default is None (no report).
kwargs: Attributes as keyword arguments.
Expand Down
2 changes: 1 addition & 1 deletion pypowsybl/sensitivity/impl/ac_sensitivity_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(self, handle: _pypowsybl.JavaHandle):
def set_bus_voltage_factor_matrix(self, bus_ids: List[str], target_voltage_ids: List[str]) -> None:
"""
.. deprecated:: 1.1.0
Use :meth:`add_bus_voltage_factor_matrix` instead.
Use :meth:`add_bus_voltage_factor_matrix` instead.
Defines buses voltage sensitivities to be computed.
Expand Down
4 changes: 2 additions & 2 deletions pypowsybl/sensitivity/impl/ac_sensitivity_analysis_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def get_bus_voltages_sensitivity_matrix(self, matrix_id: str = DEFAULT_MATRIX_ID
Optional[pd.DataFrame]:
"""
.. deprecated:: 1.1.0
Use :meth:`get_sensitivity_matrix` instead.
Use :meth:`get_sensitivity_matrix` instead.
Get the matrix of bus voltages sensitivities on the base case or on post contingency state.
Expand All @@ -47,7 +47,7 @@ def get_reference_voltages(self, matrix_id: str = DEFAULT_MATRIX_ID, contingency
pd.DataFrame]:
"""
.. deprecated:: 1.1.0
Use :meth:`get_reference_matrix` instead.
Use :meth:`get_reference_matrix` instead.
The values of bus voltages on the base case or on post contingency state.
Expand Down
4 changes: 2 additions & 2 deletions pypowsybl/sensitivity/impl/dc_sensitivity_analysis_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def get_branch_flows_sensitivity_matrix(self, matrix_id: str = DEFAULT_MATRIX_ID
pd.DataFrame]:
"""
.. deprecated:: 1.1.0
Use :meth:`get_sensitivity_matrix` instead.
Use :meth:`get_sensitivity_matrix` instead.
Get the matrix of branch flows sensitivities on the base case or on post contingency state.
Expand All @@ -48,7 +48,7 @@ def get_branch_flows_sensitivity_matrix(self, matrix_id: str = DEFAULT_MATRIX_ID
def get_reference_flows(self, matrix_id: str = DEFAULT_MATRIX_ID, contingency_id: str = None) -> Optional[pd.DataFrame]:
"""
.. deprecated:: 1.1.0
Use :meth:`get_reference_matrix` instead.
Use :meth:`get_reference_matrix` instead.
The branches active power flows on the base case or on post contingency state.
Expand Down
Loading

0 comments on commit bbb2e8e

Please sign in to comment.