Skip to content
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

include node id in loadflow result #147

Merged
merged 18 commits into from
Dec 6, 2024

Conversation

jamal-khey
Copy link
Contributor

@jamal-khey jamal-khey commented Nov 19, 2024

this pull request depend on powsybl-ws-communs

@jamal-khey jamal-khey self-assigned this Nov 20, 2024
@jamal-khey jamal-khey changed the title include node id in loadflow result WIP: include node id in loadflow result Nov 20, 2024
@jamal-khey jamal-khey changed the title WIP: include node id in loadflow result include node id in loadflow result Nov 20, 2024
private LoadflowResultsUtils() {
}

public static String getIdFromViolation(LimitViolation limitViolation, Network network) {
Copy link
Contributor

Choose a reason for hiding this comment

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

getViolationLocationId ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

.filter(Objects::nonNull)
.map(Bus::getId)
.distinct()
.toList();
Copy link
Contributor

Choose a reason for hiding this comment

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

In nodebreaker we want busbar sections ids and not bus ids

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done in powsybl-ws-commons


import static com.powsybl.security.ViolationLocation.Type.NODE_BREAKER;

public final class LoadflowResultsUtils {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why all methods are public
It's used only by LoadFlowWorkerService

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this code has been moved to powsybl-ws-commons , to avoid duplicating it for security-analysis-server

Signed-off-by: jamal-khey <myjamal89@gmail.com>
Signed-off-by: jamal-khey <myjamal89@gmail.com>
@@ -792,4 +790,53 @@ private static final class LimitViolationsMock {
new LimitViolation("NHV1_NHV2_2", "lineName2", LimitViolationType.CURRENT, "limit2", 300, 900, 0.7F, 1000, TwoSides.ONE),
new LimitViolation("NHV1_NHV2_2", "lineName2", LimitViolationType.CURRENT, "limit2", 300, 900, 0.7F, 1000, TwoSides.TWO));
}

private static final class VoltageLimitViolationsMock {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this static block ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i need results with ViolationLocation for the tests

});
assertEquals(2, limitViolations.size());
// check that the subject id is equal to the Bus Id
assertEquals(limitViolations.get(0).getSubjectId(), "NHV1");
Copy link
Contributor

Choose a reason for hiding this comment

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

VLHV1_0

Signed-off-by: jamal-khey <myjamal89@gmail.com>
Signed-off-by: jamal-khey <myjamal89@gmail.com>
@SlimaneAmar SlimaneAmar force-pushed the jamal-khey/limit-violation-by-node branch from d11c213 to 85f5c16 Compare December 6, 2024 07:53
Signed-off-by: Slimane AMAR <amarsli@gm0winl104.bureau.si.interne>
@SlimaneAmar SlimaneAmar force-pushed the jamal-khey/limit-violation-by-node branch from 85f5c16 to 2e14a23 Compare December 6, 2024 08:00
@jamal-khey jamal-khey merged commit 1414617 into main Dec 6, 2024
4 checks passed
@jamal-khey jamal-khey deleted the jamal-khey/limit-violation-by-node branch December 6, 2024 08:20
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.

2 participants