Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Maissa SOUISSI <maissa.souissi@rte-france.com>
  • Loading branch information
souissimai committed Nov 16, 2023
1 parent 868e8df commit d125883
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@ private void cleanLoadFlowResultsAndPublishCancel(UUID resultUuid, String receiv
private static LoadingLimits.TemporaryLimit handleEquipmentLimitViolation(Branch<?> branch, LimitViolationInfos violationInfo) {

Optional<com.powsybl.iidm.network.CurrentLimits> currentLimits = violationInfo.getSide().equals("ONE") ? branch.getCurrentLimits1() : branch.getCurrentLimits2();
Double permanantLimit = currentLimits.get().getPermanentLimit();
if (violationInfo.getValue() < permanantLimit) {
if (violationInfo.getValue() < currentLimits.get().getPermanentLimit()) {
return null;
} else {
List<LoadingLimits.TemporaryLimit> temporaryLimits = currentLimits.get().getTemporaryLimits().stream().collect(Collectors.toList());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,6 @@ private static void assertResultsEquals(LoadFlowResult result, org.gridsuite.loa
}
}

private static void assertLimitViolationsCalculatedOverloadEquals(List<LimitViolationInfos> limitViolationsDto) {
assertEquals(60, limitViolationsDto.get(0).getActualOverload(), 0.01);
assertNull(limitViolationsDto.get(0).getUpComingOverload());
assertNull(limitViolationsDto.get(1).getActualOverload());
assertEquals(300, limitViolationsDto.get(1).getUpComingOverload(), 0.01);
}

private static void assertLimitViolationsEquals(List<LimitViolation> limitViolations, List<LimitViolationInfos> limitViolationsDto, Network network) {
assertEquals(limitViolations.size(), limitViolationsDto.size());

Expand Down Expand Up @@ -298,7 +291,6 @@ public void testGetLimitViolations() throws Exception {
.andReturn();
List<LimitViolationInfos> limitViolations = mapper.readValue(result.getResponse().getContentAsString(), new TypeReference<List<LimitViolationInfos>>() { });
assertLimitViolationsEquals(LimitViolationsMock.limitViolations, limitViolations, network);
//assertLimitViolationsCalculatedOverloadEquals(limitViolations);
}
}

Expand Down

0 comments on commit d125883

Please sign in to comment.