fix: Introduce parameter for enabling voltage rejection#607
Merged
Conversation
Signed-off-by: Sascha Petznick <229719644+spetznick-elia@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a configuration toggle to enable/disable voltage-based rejection criteria during AC validation in the topology optimizer, and updates scoring code to correctly forward configured voltage thresholds instead of relying on hard-coded defaults.
Changes:
- Introduces
enable_critical_voltage_rejectionin AC GA parameters and wires it through optimizer/scoring. - Updates AC acceptance/scoring logic to conditionally apply voltage-magnitude and voltage-angle rejection checks.
- Extends/updates tests to cover the new toggle and verify threshold forwarding paths.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/topology_optimizer_pkg/tests/interfaces/messages/test_ac_ga_params.py | Verifies default and explicit behavior for the new enable_critical_voltage_rejection parameter. |
| packages/topology_optimizer_pkg/tests/ac/test_ac_scoring_functions.py | Adds tests for toggle behavior in acceptance and for forwarding voltage thresholds through scoring paths. |
| packages/topology_optimizer_pkg/src/toop_engine_topology_optimizer/interfaces/messages/ac_params.py | Adds enable_critical_voltage_rejection to the AC GA parameter message model. |
| packages/topology_optimizer_pkg/src/toop_engine_topology_optimizer/ac/scoring_functions.py | Implements the toggle in evaluate_acceptance and forwards configured voltage thresholds through scoring functions. |
| packages/topology_optimizer_pkg/src/toop_engine_topology_optimizer/ac/optimizer.py | Forwards the new toggle from GA config into scoring parameters. |
Signed-off-by: Sascha Petznick <229719644+spetznick-elia@users.noreply.github.com>
Signed-off-by: Sascha Petznick <229719644+spetznick-elia@users.noreply.github.com>
Signed-off-by: Sascha Petznick <229719644+spetznick-elia@users.noreply.github.com>
|
BenjPetr
approved these changes
Jul 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Checklist
Please check if the PR fulfills these requirements:
Does this PR already have an issue describing the problem?
Fixes #
What is the new behavior (if this is a feature change)?
PR introduces a flag to toggle voltage-related rejection reasons for ac validation and switches it off by default. This breaks previous behavior.
Also fixes a default parameter for
critical_voltage_jump_percent: float = 5.0andmax_allowed_va_diff: float = 20.0incompute_loadflow_and_metricsandcompute_metrics_single_timestep. We also add these parameters tocompute_remaining_loadflows, which calledcompute_metrics_single_timestepwithout parameters leading to always using the default.Does this PR introduce a breaking change?