-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add parameter to output flow decomposition results for paired dangling lines #162
Conversation
Signed-off-by: Caio Luke <[email protected]>
Signed-off-by: Caio Luke <[email protected]>
Signed-off-by: Caio Luke <[email protected]>
Signed-off-by: Caio Luke <[email protected]>
Signed-off-by: Caio Luke <[email protected]>
Signed-off-by: Caio Luke <[email protected]>
@OpenSuze if you validate the idea (adding a flow decomposition parameter), I will add some docs! |
Signed-off-by: Caio Luke <[email protected]>
allocatedAndLoopFlowsMatrix.toMap() | ||
.forEach((branchId, decomposedFlow) -> { | ||
String xnecId = DecomposedFlow.getXnecId(contingencyId, branchId); | ||
decomposedFlowMap.put(xnecId, createDecomposedFlow(branchId, decomposedFlow, decomposedFlowRescaler, network)); | ||
if (!enableResultsForPairedHalfLine) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing a test on enableResultsForPairedHalfLine and the rest of the code inside instead of testing !enableResultsForPairedHalfLine and returning is easier on the reader.
if (!enableResultsForPairedHalfLine) { | ||
return acTerminalReferenceFlows; | ||
} | ||
xnecList.stream().filter(TieLine.class::isInstance).forEach(xnec -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few process are duplicated code here, maybe use functions to make it more readable.
Signed-off-by: Caio Luke <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this PR !
Sorry for the delay
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you use the XnecProvider
interface instead of adding a new parameter please ?
For example, when using XnecProviderByIds
with a dangling line Id, the results should contain a DecomposedFlow
for this Id.
This will require to ensure that the dangling line is paired (to find the corresponding tie line) because flow decomposition on an unpaired dangling line does not make sense for me (no loop flow).
Maybe, you could provide a new XnecProvider
implementation called XnecProviderAllPairedDanglingLines
# Conflicts: # flow-decomposition/src/test/java/com/powsybl/flow_decomposition/FlowDecompositionTests.java
Signed-off-by: Caio Luke <[email protected]>
Quality Gate passedIssues Measures |
After some discussion in this similar PR, I understand that having different flow decompositions for paired dangling lines makes no sense. |
Please check if the PR fulfills these requirements
What kind of change does this PR introduce?
Feature
What is the current behavior?
As of today, it is not possible to have flow decomposition results for each half line (paired dangling line) of a tie line.
What is the new behavior (if this is a feature change)?
A new flow decomposition parameter (boolean -
enableResultsForPairedHalfLines
) will allow to produce flow decomposition results for these paired half lines.Does this PR introduce a breaking change or deprecate an API?