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

Import pypowsybl nominal voltage filter into powsybl-diagram #566

Merged
merged 17 commits into from
Dec 11, 2023

Conversation

So-Fras
Copy link
Member

@So-Fras So-Fras commented Nov 21, 2023

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

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

…agram

Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
So-Fras and others added 2 commits December 5, 2023 22:01
Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
Copy link
Contributor

@flo-dup flo-dup left a 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...?)

So-Fras and others added 5 commits December 7, 2023 12:26
Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
…e displayed

Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
Copy link

sonarcloud bot commented Dec 8, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

97.4% 97.4% Coverage
0.0% 0.0% Duplication

public static VoltageLevelFilter createVoltageLevelDepthFilter(Network network, String voltageLevelId, int depth) {
Objects.requireNonNull(network);
Objects.requireNonNull(voltageLevelId);
return createVoltageLevelsDepthFilter(network, List.of(voltageLevelId), depth);
Copy link
Contributor

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!

@So-Fras So-Fras merged commit fe9215f into main Dec 11, 2023
6 checks passed
@So-Fras So-Fras deleted the voltage_filter branch December 11, 2023 09:52
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