diff --git a/docs/_static/images/ieee30_subnetwork_filtered_no_id.svg b/docs/_static/images/ieee30_subnetwork_filtered_no_vl_id.svg similarity index 100% rename from docs/_static/images/ieee30_subnetwork_filtered_no_id.svg rename to docs/_static/images/ieee30_subnetwork_filtered_no_vl_id.svg diff --git a/docs/reference/dynamic.rst b/docs/reference/dynamic.rst index 6a4f684157..6c900844b9 100644 --- a/docs/reference/dynamic.rst +++ b/docs/reference/dynamic.rst @@ -28,8 +28,7 @@ EventMapping EventMapping EventMapping.get_possible_events - EventMapping.add_branch_disconnection - EventMapping.add_injection_disconnection + EventMapping.add_disconnection CurveMapping ------------ diff --git a/docs/reference/security.rst b/docs/reference/security.rst index 3de730a4c4..d49507f9c5 100644 --- a/docs/reference/security.rst +++ b/docs/reference/security.rst @@ -53,6 +53,21 @@ with the following methods: SecurityAnalysis.add_precontingency_monitored_elements SecurityAnalysis.add_postcontingency_monitored_elements +Define operator strategies and remedial actions +------------------------------------------------ + +You can define operator strategies and remedial actions with the following methods: + +.. autosummary:: + :nosignatures: + :toctree: api/ + + SecurityAnalysis.add_load_active_power_action + SecurityAnalysis.add_load_reactive_power_action + SecurityAnalysis.add_generator_active_power_action + SecurityAnalysis.add_switch_action + SecurityAnalysis.add_operator_strategy + Results ------- @@ -66,7 +81,9 @@ When the security analysis is completed, you can inspect its results: SecurityAnalysisResult.limit_violations SecurityAnalysisResult.pre_contingency_result SecurityAnalysisResult.post_contingency_results + SecurityAnalysisResult.operator_strategy_results SecurityAnalysisResult.find_post_contingency_result + SecurityAnalysisResult.find_operator_strategy_results SecurityAnalysisResult.branch_results SecurityAnalysisResult.bus_results SecurityAnalysisResult.three_windings_transformer_results diff --git a/docs/user_guide/index.rst b/docs/user_guide/index.rst index 0689d9b325..c4d14bf885 100644 --- a/docs/user_guide/index.rst +++ b/docs/user_guide/index.rst @@ -6,7 +6,7 @@ The User Guide is meant to help the user on specific topics, relying as much as possible on practical examples. .. toctree:: - :maxdepth: 2 + :maxdepth: 2 network network_visualization diff --git a/docs/user_guide/security.rst b/docs/user_guide/security.rst index 800f666ead..3135a25dcd 100644 --- a/docs/user_guide/security.rst +++ b/docs/user_guide/security.rst @@ -82,10 +82,6 @@ Information can be obtained on buses, branches and three windings transformers. NHV1_NHV2_2 301.06 0.00 302.80 -300.19 -116.60 326.75 NaN NHV1_NHV2_1 NHV1_NHV2_2 610.56 334.06 1,008.93 -601.00 -285.38 1,047.83 NaN - - -.. testcleanup:: security.monitored_elements - It also possible to get flow transfer on monitored branches in case of N-1 branch contingencies: .. doctest:: diff --git a/pypowsybl/security/impl/security.py b/pypowsybl/security/impl/security.py index b4b8e69343..0f516ac552 100644 --- a/pypowsybl/security/impl/security.py +++ b/pypowsybl/security/impl/security.py @@ -137,29 +137,64 @@ def add_postcontingency_monitored_elements(self, contingency_ids: Union[List[str branch_ids, voltage_level_ids, three_windings_transformer_ids) def add_load_active_power_action(self, action_id: str, load_id: str, is_relative: bool, active_power: float) -> None: - """ + """ Add a load action, modifying the load active power + + Args: + action_id: unique ID for the action + load_id: load identifier + is_relative: whether the active power change specified is absolute, or relative to current load active power + active_power: the active power change + """ _pypowsybl.add_load_active_power_action(self._handle, action_id, load_id, is_relative, active_power) def add_load_reactive_power_action(self, action_id: str, load_id: str, is_relative: bool, reactive_power: float) -> None: - """ + """ Add a load action, modifying the load reactive power + + Args: + action_id: unique ID for the action + load_id: load identifier + is_relative: whether the reactive power change specified is absolute, or relative to current load reactive power + reactive_power: the reactive power change + """ _pypowsybl.add_load_reactive_power_action(self._handle, action_id, load_id, is_relative, reactive_power) def add_generator_active_power_action(self, action_id: str, generator_id: str, is_relative: bool, active_power: float) -> None: - """ + """ Add a generator action, modifying the generator active power + + Args: + action_id: unique ID for the action + generator_id: generator identifier + is_relative: whether the active power change specified is absolute, or relative to current generator active power + active_power: the active power change + """ _pypowsybl.add_generator_active_power_action(self._handle, action_id, generator_id, is_relative, active_power) def add_switch_action(self, action_id: str, switch_id: str, open: bool) -> None: - """ + """ Add a switch action, modifying the switch open/close status + + Args: + action_id: unique ID for the action + switch_id: switch identifier + open: True to open the switch, False to close + """ _pypowsybl.add_switch_action(self._handle, action_id, switch_id, open) def add_operator_strategy(self, operator_strategy_id: str, contingency_id: str, action_ids: List[str], condition_type: ConditionType = ConditionType.TRUE_CONDITION, violation_subject_ids: List[str] = None, violation_types: List[ViolationType] = None) -> None: - """ + """ Add an operator strategy to the specified contingency + + Args: + operator_strategy_id: unique ID for the operator strategy + contingency_id: the contingency on which the operator strategy applies + action_ids: the list of actions to be applied as part of the strategy + condition_type: the type of condition + violation_subject_ids: identifiers of network elements monitored to apply the operator strategy + violation_types: type of violations to consider to apply the operator strategy """ if violation_types is None: violation_types = []