-
Notifications
You must be signed in to change notification settings - Fork 13
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
Import pypowsybl nominal voltage filter into powsybl-diagram #566
Conversation
…agram Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
network-area-diagram/src/main/java/com/powsybl/nad/build/iidm/VoltageLevelFilter.java
Outdated
Show resolved
Hide resolved
network-area-diagram/src/main/java/com/powsybl/nad/build/iidm/VoltageLevelFilter.java
Outdated
Show resolved
Hide resolved
network-area-diagram/src/main/java/com/powsybl/nad/build/iidm/VoltageLevelFilter.java
Outdated
Show resolved
Hide resolved
network-area-diagram/src/main/java/com/powsybl/nad/build/iidm/VoltageLevelFilter.java
Outdated
Show resolved
Hide resolved
network-area-diagram/src/main/java/com/powsybl/nad/build/iidm/VoltageLevelFilter.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[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.
Just one comment remaining. But looking at the code now I realize it's partially duplicate, we could factorize the two traverse to avoid this duplication. I think we could do this with a Predicate<VoltageLevel>
which would be always true in the basic case, and which would be based on the thresholds for the new filter. Besides, this would enable more complex filtering of voltage levels (might not be very useful though...?)
network-area-diagram/src/main/java/com/powsybl/nad/build/iidm/VoltageLevelFilter.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
network-area-diagram/src/main/java/com/powsybl/nad/build/iidm/VoltageLevelFilter.java
Outdated
Show resolved
Hide resolved
network-area-diagram/src/main/java/com/powsybl/nad/build/iidm/VoltageLevelFilter.java
Outdated
Show resolved
Hide resolved
network-area-diagram/src/main/java/com/powsybl/nad/build/iidm/VoltageLevelFilter.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
…e displayed Signed-off-by: Sophie Frasnedo <[email protected]>
Kudos, SonarCloud Quality Gate passed! |
public static VoltageLevelFilter createVoltageLevelDepthFilter(Network network, String voltageLevelId, int depth) { | ||
Objects.requireNonNull(network); | ||
Objects.requireNonNull(voltageLevelId); | ||
return createVoltageLevelsDepthFilter(network, List.of(voltageLevelId), depth); |
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.
yes, indeed, this was also duplicate code!
Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
No
What kind of change does this PR introduce?
This PR adds a feature that was first coded in pypowsybl to powsybl-diagram. This feature allows network-area diagram users to filter voltage levels according to their nominal voltage.
What is the current behavior?
Such a filter is not available in powsybl-diagram. It is only available for pypowsybl users.
What is the new behavior (if this is a feature change)?
This filter will be available for powsybl-diagram users as well as pypowsybl users.
Other information:
This PR must be followed by another PR in pypowsybl repository to call the powsybl-diagram function and delete the pypowsybl function