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

[Network modifications] Fix: Remove disconnectors and breakers in RemoveHvdcLine and RemoveVoltageLevel #2522

Merged
merged 7 commits into from
Mar 29, 2023

Conversation

colinepiloquet
Copy link
Member

Please check if the PR fulfills these requirements (please use '[x]' to check the checkboxes, or submit the PR and then click the checkboxes)

  • 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 ? If so, link to this issue using '#XXX' and skip the rest
No

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Bug fix

What is the current behavior? (You can also link to an open issue here)
The breakers and disconnectors are not removed.

What is the new behavior (if this is a feature change)?
In RemoveHvdcLine: the switches of the HVDC line and of the shunts are removed.
In RemoveVoltageLevel: the switches of branches in other voltage levels are removed.
the converting stations of HVDC lines on the other side are removed.

colinepiloquet and others added 3 commits March 28, 2023 12:04
Signed-off-by: Coline PILOQUET <coline.piloquet@rte-france.com>
Signed-off-by: Coline PILOQUET <coline.piloquet@rte-france.com>
});

voltageLevel.getConnectables().forEach(Connectable::remove);
voltageLevel.getConnectables().forEach(connectable -> new RemoveFeederBayBuilder().withConnectableId(connectable.getId()).build().apply(network, throwException, computationManager, reporter));
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe you can optimize this to only call RemoveFeederBay if it is a branch or a transformer (not useful for injection since the whole voltage level is removed in the end)

colinepiloquet and others added 2 commits March 28, 2023 18:17
Signed-off-by: Coline PILOQUET <coline.piloquet@rte-france.com>
Comment on lines 53 to 57
voltageLevel.getConnectables(Branch.class).forEach(branch -> new RemoveFeederBayBuilder().withConnectableId(branch.getId()).build().apply(network, throwException, computationManager, reporter));
voltageLevel.getConnectables(ThreeWindingsTransformer.class).forEach(threewt -> new RemoveFeederBayBuilder().withConnectableId(threewt.getId()).build().apply(network, throwException, computationManager, reporter));
voltageLevel.getConnectables().forEach(Connectable::remove);

voltageLevel.remove();
Copy link
Contributor

@miovd miovd Mar 29, 2023

Choose a reason for hiding this comment

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

Hmm, I would rather do something like:

voltageLevel.getConnectables().forEach(c -> {
             if (c instanceof Injection) {
                       c.remove();
             } else {
                     new RemoveFeederBayBuilder()......
             }
});

This way, getConnectables is only called once and RemoveFeederBay called for non-Injection connectable

colinepiloquet and others added 2 commits March 29, 2023 14:03
Signed-off-by: Coline PILOQUET <coline.piloquet@rte-france.com>
@sonarqubecloud
Copy link

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

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@miovd miovd merged commit 23d50ed into main Mar 29, 2023
@miovd miovd deleted the fix_remove_vl_and_hvdc branch March 29, 2023 13:01
miovd pushed a commit that referenced this pull request Mar 30, 2023
…oveHvdcLine and RemoveVoltageLevel (#2522)

Signed-off-by: Coline PILOQUET <coline.piloquet@rte-france.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants