-
Notifications
You must be signed in to change notification settings - Fork 8
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
Bug fix: support of factors with SKIP status after contingencies #476
Conversation
for (LfSensitivityFactor<DcVariableType, DcEquationType> lfFactor : lfFactors) { | ||
if (lfFactor.getStatus() == LfSensitivityFactor.Status.ZERO) { | ||
valueWriter.write(lfFactor.getIndex(), contingency != null ? contingency.getIndex() : -1, 0, Double.NaN); | ||
} else if (contingency != null && lfFactor.getStatus() == LfSensitivityFactor.Status.SKIP) { |
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.
I don't know yet what is the right fix but not this one because, all skipped factors are handle at the start of DC sensitivity analysis. So here a value is emitted in the writer a second time.
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
@annetill I refactored the code to discard ZERO and SKIP factors at the very beginning of the analysis and clean useless checks everywhere. Is has changed some of the unit test, where we were writing post contingency output on case of invalid factors in some cases. Is it ok for you? |
@@ -1865,7 +1865,33 @@ void testGeneratorContingencyNotInMainComponentAndMonitoredBranchNotInMainCompon | |||
assertEquals(1, result.getPreContingencyValues().size()); | |||
assertEquals(0.0, result.getSensitivityValue("GEN_1", "T2wT"), LoadFlowAssert.DELTA_POWER); | |||
assertEquals(Double.NaN, result.getFunctionReferenceValue("T2wT"), LoadFlowAssert.DELTA_POWER); | |||
assertEquals(0.0, result.getSensitivityValue("GEN_3", "GEN_1", "T2wT"), LoadFlowAssert.DELTA_POWER); |
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.
I am okay with the change in this unit test.
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Kudos, SonarCloud Quality Gate passed! |
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.
Approved!
Signed-off-by: Anne Tilloy anne.tilloy@rte-france.com
Please check if the PR fulfills these requirements (please use
'[x]'
to check the checkboxes, or submit the PR and then click the checkboxes)Does this PR already have an issue describing the problem ? If so, link to this issue using
'#XXX'
and skip the restWhat kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
What is the current behavior? (You can also link to an open issue here)
What is the new behavior (if this is a feature change)?
Does this PR introduce a breaking change or deprecate an API? If yes, check the following:
Other information:
(if any of the questions/checkboxes don't apply, please delete them entirely)