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

Add connect/disconnect on Tie Lines and HVDC Lines #3072

Merged
merged 17 commits into from
Jun 28, 2024

Conversation

rolnico
Copy link
Member

@rolnico rolnico commented Jun 19, 2024

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?
Bug fix + new Feature

What is the current behavior?
If you use for example a ConnectableConnection on a non-existing connectable or on a TieLine (which is not a Connectable), the application of the NetworkModification will crash due to a null pointer exception. This is due to the fact that only Connectables are managed since Tie Lines and HVDC Lines do not have connect/disconnect methods.

What is the new behavior (if this is a feature change)?
Tie Lines and HVDC Lines now have connect and disconnect methods implemented.
Network modification for connection and disconnection now also work with Tie Lines and HVDC Lines.

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

If yes, please check if the following requirements are fulfilled

  • The Breaking Change or Deprecated label has been added
  • The migration steps are described in the following section

What changes might users need to make in their application due to this PR? (migration steps)

If you had your own implementation for HVDC Lines, you now need to implement the following methods:

    boolean connectConverterStations();
    boolean connectConverterStations(Predicate<Switch> isTypeSwitchToOperate);
    boolean connectConverterStations(Predicate<Switch> isTypeSwitchToOperate, TwoSides side);
    boolean disconnectConverterStations();
    boolean disconnectConverterStations(Predicate<Switch> isSwitchOpenable);
    boolean disconnectConverterStations(Predicate<Switch> isSwitchOpenable, TwoSides side);

If you had your own implementation for Tie Lines, you now need to implement the following methods:

    boolean connectDanglingLines();
    boolean connectDanglingLines(Predicate<Switch> isTypeSwitchToOperate);
    boolean connectDanglingLines(Predicate<Switch> isTypeSwitchToOperate, TwoSides side);
    boolean disconnectDanglingLines();
    boolean disconnectDanglingLines(Predicate<Switch> isSwitchOpenable);
    boolean disconnectDanglingLines(Predicate<Switch> isSwitchOpenable, TwoSides side);

Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
@rolnico rolnico added bug Breaking Change API is broken labels Jun 19, 2024
@rolnico rolnico requested review from olperr1 and annetill June 19, 2024 15:21
@rolnico rolnico self-assigned this Jun 19, 2024
@rolnico
Copy link
Member Author

rolnico commented Jun 19, 2024

This is another possible solution that would close #3069

@rolnico
Copy link
Member Author

rolnico commented Jun 19, 2024

Should the Tie Line and HVDC Line become Connectables ?

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.

Could you add a utility method to avoid the code duplication?

# Conflicts:
#	iidm/iidm-modification/src/main/java/com/powsybl/iidm/modification/AbstractDisconnection.java
#	iidm/iidm-modification/src/main/java/com/powsybl/iidm/modification/ConnectableConnection.java
#	iidm/iidm-modification/src/test/java/com/powsybl/iidm/modification/ConnectionAndDisconnectionsTest.java
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Copy link
Member

@olperr1 olperr1 left a comment

Choose a reason for hiding this comment

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

@annetill: Should we also revert the javadoc changes of #3079?

Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Copy link

sonarcloud bot commented Jun 28, 2024

@olperr1 olperr1 merged commit b113fcb into main Jun 28, 2024
7 checks passed
@olperr1 olperr1 deleted the nro/add_connect_on_tieline branch June 28, 2024 06:38
olperr1 pushed a commit that referenced this pull request Jul 1, 2024
* add connection and disconnection to HVDC lines and Tie Lines
* extract connect/disconnect methods to util class
* modify javadoc and parameters name

Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
(cherry picked from commit b113fcb)
geofjamg pushed a commit that referenced this pull request Sep 18, 2024
* add connection and disconnection to HVDC lines and Tie Lines
* extract connect/disconnect methods to util class
* modify javadoc and parameters name

Signed-off-by: Nicolas Rol <nicolas.rol@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.

4 participants