Track phase shifter tap movements in security analysis results - #4066
Open
RiadBRD wants to merge 4 commits into
Open
Track phase shifter tap movements in security analysis results#4066RiadBRD wants to merge 4 commits into
RiadBRD wants to merge 4 commits into
Conversation
…ingencyResult * Add MovedPhaseShifterResult record (transformerId, initialTap, newTap) * Add Map<String, MovedPhaseShifterResult> phaseShifterResults to PreContingencyResult and PostContingencyResult * Update JSON serialization to handle the new field (only written when non-empty) * Update JSON deserialization with version guard (>= 2.0) and empty default for backward compatibility * Bump SecurityAnalysisResult version from 1.9 to 2.0 * Update all call sites to pass Collections.emptyMap() when no phase shifter results * Add tests for non-empty phase shifter results Signed-off-by: Riad Benradi <riad.benradi_externe@rte-france.com> Signed-off-by: Riad Benradi <riad.benradi_externe@rte-france.com>
olperr1
requested changes
Aug 27, 2026
olperr1
requested changes
Aug 27, 2026
olperr1
left a comment
Member
There was a problem hiding this comment.
Also, can you improve the test coverage?
For instance, you have created a single (de)serialization test with tap movements in the results.
added 2 commits
August 31, 2026 14:04
…PreContingencyResult` and `PostContingencyResult`. - Bump `SecurityAnalysisResult` JSON version to `1.10`, with the `phaseShifterResults` tag gated on `>= 1.10`. - Share JSON read/write helpers in the new `PhaseShifterResultSerializer` utility. - Sort serialized entries by `transformerId` for deterministic output. - Guard constructors against null or empty maps by defaulting to `Collections.emptyMap()`. - Update the JSON fixture with the new version and `violationLocation`. Signed-off-by: Riad Benradi <riad.benradi_externe@rte-france.com>
|
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.



Please check if the PR fulfills these requirements
What kind of change does this PR introduce?
Feature
Add phase shifter tap position tracking to security analysis results. Both PreContingencyResult and PostContingencyResult now include a map of all phase shifters that were optimized (moved) during the loadflow calculation, capturing their initial and final tap positions.
What is the current behavior?
Phase shifter tap adjustments made during security analysis loadflow computations are not preserved or accessible in the results. Users cannot track which phase shifters were moved or their tap position changes.
What is the new behavior (if this is a feature change)?
After a security analysis loadflow, users can now retrieve phase shifter movements via:
getPhaseShifterResults()- returns a map of all moved phase shifters keyed by transformer IDgetPhaseShifterResult(String transformerId)- retrieves specific phase shifter movementEach
MovedPhaseShifterResultcontains:transformerId: The phase shifter identifierinitialTap: Tap position beforenewTap: Tap position afterDoes this PR introduce a breaking change or deprecate an API?
If yes, please check if the following requirements are fulfilled
What changes might users need to make in their application due to this PR? (migration steps)
The
PostContingencyResultconstructor signature changed from 6 to 7 parameters, adding a requiredphaseShifterResultsmap as the last parameter. All direct instantiations must pass this parameter; useCollections.emptyMap()when no phase shifter data is available.The
PreContingencyResultmaintains backward compatibility via constructor overloading. Existing 4-parameter calls continue to work, but to pass phase shifter data, you must use the new 5-parameter constructor.JSON deserialization of existing results remains compatible with the new
phaseShifterResultsfield, which is treated as optional and defaults to an empty map.Applications can now access phase shifter movements through the new
getPhaseShifterResults()andgetPhaseShifterResult(String)methods on both result classes.