Skip to content

Commit

Permalink
fix security analysis mentioning sensitivity, also punctuation issues (
Browse files Browse the repository at this point in the history
…#708)

Signed-off-by: Damien Jeandemange <[email protected]>
  • Loading branch information
jeandemanged authored Feb 15, 2024
1 parent abcae66 commit 7c12bf3
Show file tree
Hide file tree
Showing 15 changed files with 59 additions and 59 deletions.
2 changes: 1 addition & 1 deletion docs/user_guide/dynamic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Here is an example of a simple config.yaml file. It uses the same configurations
Parameters
----------

To make a dynamic simulation, you need multiple things :
To make a dynamic simulation, you need multiple things:

1. A dynamic mapping, it links the static elements (generators, loads, lines) to their dynamic behavior (alpha beta load)
2. A curve mapping, it records the given values to be watch by the simulation tool. Curves are the output of the simulation
Expand Down
10 changes: 5 additions & 5 deletions docs/user_guide/loadflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Let's have a look at the default ones:

For more details on each parameter, please refer to the :doc:`API reference </reference/loadflow/parameters>`.

All parameters are also fully described in `Powsybl loadfow parameter documentation <https://www.powsybl.org/pages/documentation/simulation/powerflow/>`_.
All parameters are also fully described in `Powsybl load flow parameters documentation <https://www.powsybl.org/pages/documentation/simulation/powerflow/>`_.

Parameters specific to a provider
---------------------------------
Expand All @@ -73,7 +73,7 @@ We can list supported parameters specific to default provider using:
>>> lf.get_provider_parameters_names()
['slackBusSelectionMode', 'slackBusesIds', 'lowImpedanceBranchMode', 'voltageRemoteControl', ...]

And get more detailed informations about theses parameters using:
And get more detailed information about theses parameters using:

.. doctest::
:options: +NORMALIZE_WHITESPACE
Expand Down Expand Up @@ -109,8 +109,8 @@ included in the computation:
>>> results
[ComponentResult(connected_component_num=0, synchronous_component_num=0, status=CONVERGED, iteration_count=3, slack_bus_id='VLHV1_0', slack_bus_active_power_mismatch=-606.5596837558763, distributed_active_power=0.0)]

Component results provides general information about the loadflow: was it successful ? how many iterations did
it need ? what's the remaining active power imbalance ? For example, let's have a look at the imbalance
Component results provides general information about the loadflow execution: was it successful? How many iterations did
it need? What is the remaining active power imbalance? For example, let's have a look at the imbalance
on the main component of the network:

.. doctest::
Expand All @@ -136,7 +136,7 @@ the voltage magnitudes (rounded to 2 digits here):
DC Load Flow
------------

In order to run an AC loadflow, simply use the :func:`run_dc` method.
In order to run a DC loadflow, simply use the :func:`run_dc` method.

For that example, we will use a distributed slack, with imbalance distributed on generators,
proportional to their maximum power. We also choose to ignore transformer ratios in the DC equations:
Expand Down
10 changes: 5 additions & 5 deletions docs/user_guide/network.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The network model


The :class:`Network` object is the main data structure of pypowsybl.
It contains all the data of a power network : substations, generators, lines,
It contains all the data of a power network: substations, generators, lines,
transformers, ...

pypowsybl provides methods to create networks, and to access and modify their data.
Expand All @@ -21,13 +21,13 @@ Create a network
----------------

pypowsybl provides several factory methods to create well known network models.
For example, you can create the IEEE 9-bus network case :
For example, you can create the IEEE 9-bus network case:

.. doctest::

>>> network = pp.network.create_ieee9()

Another common way of creating a network is to load it from a file :
Another common way of creating a network is to load it from a file:

.. code-block:: python
Expand Down Expand Up @@ -136,7 +136,7 @@ For example, you can retrieve generators data as follows:
GEN2 OTHER 607.0 -9999.99 4999.0 -1.797693e+308 1.797693e+308 NaN MIN_MAX 24.5 301.0 True GEN2 NaN NaN NaN VLGEN VLGEN_0 True

Most dataframes are indexed on the ID of the elements.
However, some more complex dataframes have a multi-index : for example,
However, some more complex dataframes have a multi-index: for example,
ratio and phase tap changer steps are indexed on their transformer ID together with
the step position:

Expand Down Expand Up @@ -209,7 +209,7 @@ Basic topology changes
----------------------

Most elements dataframes contain information about "is this element connected?" and "where is it connected?".
That information appears as the ``connected`` and ``bus_id`` columns :
That information appears as the ``connected`` and ``bus_id`` columns:

.. doctest::

Expand Down
4 changes: 2 additions & 2 deletions docs/user_guide/network_visualization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Note that similarly to single-line diagrams, a loadflow can be run before writin
>>> result = pp.loadflow.run_ac(network)
>>> network.write_network_area_diagram_svg('ieee9.svg')
Network-area diagrams can be customized through NadParameters :
Network-area diagrams can be customized through NadParameters:

.. code-block:: python
Expand All @@ -80,7 +80,7 @@ Network-area diagrams can be customized through NadParameters :
- current_value_precision: number of digits after the decimal point for current values (default value 0)
- voltage_value_precision: number of digits after the decimal point for voltage values(default value 1)
- bus_legend: if true, angle and voltage values associated to a voltage level are displayed in a text box. If false, only the voltage level name is displayed (default value true)
- substation_description_displayed : if true, the substation name is added to the voltage level info on the diagram (default value false)
- substation_description_displayed: if true, the substation name is added to the voltage level info on the diagram (default value false)
In order to get a list of the displayed voltage levels from an input voltage level (or an input list of voltage levels) and a depth:
Expand Down
4 changes: 2 additions & 2 deletions docs/user_guide/security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ AC security analysis
To perform a security analysis, you need at least a network and a contingency on this network.
In the result there are violations detected with the initial loadflow on the network.
These violations are collected in pre_contingency_result. The results contain also
the violations created by the contingency, they are collected by contingency in post_contingency_results :
the violations created by the contingency, they are collected by contingency in post_contingency_results:

.. doctest::
:options: +NORMALIZE_WHITESPACE
Expand Down Expand Up @@ -128,7 +128,7 @@ The following example define a switch closing action with id 'SwitchAction' on t
To enable the application of the action you need to define an operator strategy and add the action to it.
An operator strategy is a set of actions to be applied after the simulation of a contingency.
It is defined with an unique id, a reference to the id of the contingency, a list action ids and a condition.
The following operator strategy define the application of the switch action 'SwitchAction' after 'Breaker contingency' with the 'True' condition (always applied) :
The following operator strategy define the application of the switch action 'SwitchAction' after 'Breaker contingency' with the 'True' condition (always applied):

.. doctest::
:options: +NORMALIZE_WHITESPACE
Expand Down
6 changes: 3 additions & 3 deletions docs/user_guide/sensitivity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ as a result:
NHV1_NHV2_1 NHV1_NHV2_2
LOAD -0.5 -0.5

Several matrix of sensitivity factors can be specified, in that case you must name your matrix at creation and reuse this name to query you results :
Several matrix of sensitivity factors can be specified, in that case you must name your matrix at creation and reuse this name to query you results:

.. doctest::

Expand Down Expand Up @@ -180,7 +180,7 @@ Shift keys from UCTE glsk files
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Alternatively zones can also be created with weighted injections defined in ucte GLSK files. Two ways of creating zones are available.
The first one use a glsk file and create a list of Zone objects with all the areas defined within :
The first one use a glsk file and create a list of Zone objects with all the areas defined within:

.. code-block:: python
Expand All @@ -192,7 +192,7 @@ The first one use a glsk file and create a list of Zone objects with all the are
>>> sa.add_branch_flow_factor_matrix(['BBE2AA1 FFR3AA1 1'], ['10YCB-GERMANY--8'], 'm')
>>> results = sa.run(n, params)
The second one allows a more refined zone creation by separating the glsk file data loading and the zone creation :
The second one allows a more refined zone creation by separating the glsk file data loading and the zone creation:

.. code-block:: python
Expand Down
4 changes: 2 additions & 2 deletions pypowsybl/dynamic/impl/event_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def add_branch_disconnection(self, static_id: str, event_time: float, disconnect
Args:
static_id (str): network element to disconnect
event_time (float): timestep at which the event happens
disconnect_origin (bool) : the disconnection is made at the origin
disconnect_extremity (bool) : the disconnection is made at the extremity
disconnect_origin (bool): the disconnection is made at the origin
disconnect_extremity (bool): the disconnection is made at the extremity
"""
_pp.add_event_branch_disconnection(
self._handle, static_id, event_time, disconnect_origin, disconnect_extremity)
Expand Down
2 changes: 1 addition & 1 deletion pypowsybl/dynamic/impl/model_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def add_all_dynamic_mappings(self, mapping_type: DynamicMappingType, mapping_df:
"""
Update the dynamic mapping of a simulation, must provide a :class:`~pandas.DataFrame` or as named arguments.
| The dataframe must contains these three columns :
| The dataframe must contains these three columns:
| - static_id: id of the network element to map
| - parameter_set_id: set id in the parameter file
| - mapping_type: value of enum DynamicMappingType
Expand Down
8 changes: 4 additions & 4 deletions pypowsybl/network/impl/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ def get_generators(self, all_attributes: bool = False, attributes: List[str] = N
- **min_q_at_target_p** (optional): the minimum reactive value for the generator for the target p specified (MVar)
- **max_q_at_p** (optional): the maximum reactive value for the generator at current p (MVar)
- **min_q_at_p** (optional): the minimum reactive value for the generator at current p (MVar)
- **rated_s** : The rated nominal power (MVA)
- **rated_s**: The rated nominal power (MVA)
- **reactive_limits_kind**: type of the reactive limit of the generator (can be MIN_MAX, CURVE or NONE)
- **target_v**: the target voltage magnitude value for the generator (in kV)
- **target_q**: the target reactive value for the generator (in MVAr)
Expand Down Expand Up @@ -2373,7 +2373,7 @@ def update_generators(self, df: DataFrame = None, **kwargs: ArrayLike) -> None:
- `target_v`
- `target_q`
- `voltage_regulator_on`
- `regulated_element_id` : you may define any injection or busbar section as the regulated location.
- `regulated_element_id`: you may define any injection or busbar section as the regulated location.
Only supported in node breaker voltage levels.
- `p`
- `q`
Expand Down Expand Up @@ -3083,7 +3083,7 @@ def update_terminals(self, df: DataFrame = None, **kwargs: ArrayLike) -> None:
Notes:
Attributes that can be updated are :
- `connected` : element_side must be provided if it is a sided network element
- `connected`: element_side must be provided if it is a sided network element
See Also:
:meth:`get_terminals`
Expand Down Expand Up @@ -4191,7 +4191,7 @@ def create_operational_limits(self, df: DataFrame = None, **kwargs: ArrayLike) -
- **type**: the type of limit to be created (CURRENT, APPARENT_POWER, ACTIVE_POWER)
- **value**: the value of the limit in A, MVA or MW
- **acceptable_duration**: the maximum number of seconds during which we can operate under that limit
- **is_fictitious** : fictitious limit ?
- **is_fictitious**: fictitious limit ?
For each location of the network defined by a couple (element_id, side):
Expand Down
12 changes: 6 additions & 6 deletions pypowsybl/security/impl/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@

class Parameters: # pylint: disable=too-few-public-methods
"""
Parameters for a sensitivity analysis execution.
Parameters for a security analysis execution.
All parameters are first read from you configuration file, then overridden with
the constructor arguments.
Please note that sensitivity analysis providers may not honor all parameters, according to their capabilities.
Please note that security analysis providers may not honor all parameters, according to their capabilities.
For example, some providers will not be able to simulate the voltage control of shunt compensators, etc.
The exact behaviour of some parameters may also depend on your sensitivity analysis provider.
The exact behaviour of some parameters may also depend on your security analysis provider.
Please check the documentation of your provider for that information.
.. currentmodule:: pypowsybl.sensitivity
.. currentmodule:: pypowsybl.security
Args:
load_flow_parameters: parameters that are common to loadflow and sensitivity analysis
load_flow_parameters: parameters that are common to loadflow and security analysis
increased_violations_parameters: Define what violations should be considered increased between N and contingency situations
provider_parameters: Define parameters linked to the sensitivity analysis provider
provider_parameters: Define parameters linked to the security analysis provider
the names of the existing parameters can be found with method ``get_provider_parameters_names``
"""

Expand Down
26 changes: 13 additions & 13 deletions pypowsybl/security/impl/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@

class SecurityAnalysis(ContingencyContainer):
"""
Allows to run a sensitivity analysis on a network.
Allows to run a security analysis on a network.
"""

def __init__(self, handle: _pypowsybl.JavaHandle):
ContingencyContainer.__init__(self, handle)

def run_ac(self, network: Network, parameters: Union[Parameters, pypowsybl.loadflow.Parameters] = None,
provider: str = '', reporter: Reporter = None) -> SecurityAnalysisResult:
""" Runs an AC sensitivity analysis.
""" Runs an AC security analysis.
Args:
network: Network on which the sensitivity analysis will be computed
network: Network on which the security analysis will be computed
parameters: Security analysis parameters
provider: Name of the sensitivity analysis implementation provider to be used,
provider: Name of the security analysis implementation provider to be used,
will use default provider if empty.
Returns:
A sensitivity analysis result, containing information about violations and monitored elements
A security analysis result, containing information about violations and monitored elements
"""
security_parameters = Parameters(load_flow_parameters=parameters) if isinstance(parameters,
pypowsybl.loadflow.Parameters) else parameters
Expand All @@ -49,16 +49,16 @@ def run_ac(self, network: Network, parameters: Union[Parameters, pypowsybl.loadf

def run_dc(self, network: Network, parameters: Union[Parameters, pypowsybl.loadflow.Parameters] = None,
provider: str = '', reporter: Reporter = None) -> SecurityAnalysisResult:
""" Runs an DC sensitivity analysis.
""" Runs a DC security analysis.
Args:
network: Network on which the sensitivity analysis will be computed
network: Network on which the security analysis will be computed
parameters: Security analysis parameters
provider: Name of the sensitivity analysis implementation provider to be used,
provider: Name of the security analysis implementation provider to be used,
will use default provider if empty.
Returns:
A sensitivity analysis result, containing information about violations and monitored elements
A security analysis result, containing information about violations and monitored elements
"""
security_parameters = Parameters(load_flow_parameters=parameters) if isinstance(parameters,
pypowsybl.loadflow.Parameters) else parameters
Expand All @@ -73,7 +73,7 @@ def add_monitored_elements(self, contingency_context_type: ContingencyContextTyp
branch_ids: List[str] = None,
voltage_level_ids: List[str] = None,
three_windings_transformer_ids: List[str] = None) -> None:
""" Add elements to be monitored by the sensitivity analysis. The sensitivity analysis result
""" Add elements to be monitored by the security analysis. The security analysis result
will provide additional information for those elements, like the power and current values.
Args:
Expand Down Expand Up @@ -107,7 +107,7 @@ def add_precontingency_monitored_elements(self,
branch_ids: List[str] = None,
voltage_level_ids: List[str] = None,
three_windings_transformer_ids: List[str] = None) -> None:
""" Add elements to be monitored by the sensitivity analysis on precontingency state. The sensitivity analysis result
""" Add elements to be monitored by the security analysis on precontingency state. The security analysis result
will provide additional information for those elements, like the power and current values.
Args:
Expand All @@ -124,8 +124,8 @@ def add_postcontingency_monitored_elements(self, contingency_ids: Union[List[str
branch_ids: List[str] = None,
voltage_level_ids: List[str] = None,
three_windings_transformer_ids: List[str] = None) -> None:
""" Add elements to be monitored by the sensitivity analysis for specific contingencies.
The sensitivity analysis result will provide additional information for those elements, like the power and current values.
""" Add elements to be monitored by the security analysis for specific contingencies.
The security analysis result will provide additional information for those elements, like the power and current values.
Args:
contingency_ids: list of contingencies for which we want to monitor additional elements
Expand Down
2 changes: 1 addition & 1 deletion pypowsybl/security/impl/security_analysis_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class SecurityAnalysisResult:
"""
The result of a sensitivity analysis.
The result of a security analysis.
"""

def __init__(self, handle: _pypowsybl.JavaHandle):
Expand Down
Loading

0 comments on commit 7c12bf3

Please sign in to comment.