-
Notifications
You must be signed in to change notification settings - Fork 43
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
Conversation
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)); |
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.
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)
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(); |
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.
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
Kudos, SonarCloud Quality Gate passed! |
…oveHvdcLine and RemoveVoltageLevel (#2522) Signed-off-by: Coline PILOQUET <coline.piloquet@rte-france.com>
Please check if the PR fulfills these requirements (please use
'[x]'
to check the checkboxes, or submit the PR and then click the checkboxes)Does this PR already have an issue describing the problem ? If so, link to this issue using
'#XXX'
and skip the restNo
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.