Skip to content

Conversation

klesaulnier
Copy link
Contributor

No description provided.

LE SAULNIER Kevin added 6 commits September 4, 2025 14:53
Signed-off-by: LE SAULNIER Kevin <[email protected]>
Signed-off-by: LE SAULNIER Kevin <[email protected]>
Signed-off-by: LE SAULNIER Kevin <[email protected]>
Signed-off-by: LE SAULNIER Kevin <[email protected]>
Signed-off-by: LE SAULNIER Kevin <[email protected]>
.limitReduction(limitViolation.getLimitReduction())
.value(limitViolation.getValue())
.side(limitViolation.getSide())
.loading(computeLoading(limitViolation))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't want the same changes for N results?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

N results will be chaged on other US

protected static Double getPatlLimit(LimitViolation limitViolation, Network network) {
String equipmentId = limitViolation.getSubjectId();
Branch<?> branch = network.getBranch(equipmentId);
ThreeSides limitViolationSide = limitViolation.getSide();
Copy link
Contributor

@antoinebhs antoinebhs Sep 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: if you're dealing with branches, you could have used TwoSides

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

return null;
}

Optional<CurrentLimits> currentLimits = limitViolationSide.name().equals(TwoSides.ONE.name()) ? branch.getCurrentLimits1() : branch.getCurrentLimits2();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't you use :
default Optional getCurrentLimits(TwoSides side) {
of branch directly? it's a good helper method?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

return null;
}

Optional<CurrentLimits> currentLimits = limitViolationSide.name().equals(TwoSides.ONE.name()) ? branch.getCurrentLimits1() : branch.getCurrentLimits2();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment to fetch the side

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or compare directly enum instead of names at least?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -0,0 +1,60 @@
/**
* Copyright (c) 2023, RTE (http://www.rte-france.com)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2025

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment on lines 117 to 118
if (limitName.equals(LimitViolationUtils.PERMANENT_LIMIT_NAME)) {
return currentLimits.get().getTemporaryLimits().stream().findFirst().orElse(null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: temporaryLimits = currentLimits.get().getTemporaryLimits() ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Signed-off-by: LE SAULNIER Kevin <[email protected]>
Copy link

sonarqubecloud bot commented Sep 5, 2025

Copy link
Contributor

@antoinebhs antoinebhs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code OK
Test OK

@klesaulnier klesaulnier merged commit 6aa7369 into main Sep 8, 2025
4 checks passed
@klesaulnier klesaulnier deleted the new-fields-sa-result branch September 8, 2025 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants