Skip to content

Add resistance to dc switch#3863

Open
SGI-Landry wants to merge 8 commits intomainfrom
LH-Add_resistance_to_DcSwitch
Open

Add resistance to dc switch#3863
SGI-Landry wants to merge 8 commits intomainfrom
LH-Add_resistance_to_DcSwitch

Conversation

@SGI-Landry
Copy link
Copy Markdown
Contributor

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)
  • A PR or issue has been opened in all impacted repositories (if any)

Does this PR already have an issue describing the problem?

Fixes #3827 with basic data model and IIDM import. DGS and CGMES imports yet to come.

What kind of change does this PR introduce?

  • Add optional attribute r to class DcSwitch, with default value zero.
  • Change DcTopologyModel to take it into account in the computation of the topology. DcSwitch with non-zero resistance split buses in two.
  • I used this opportunity to create tests for DcTopologyModel in
  • Add read/write support for IIDM with tests in AbstractDcSwitchTest.

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

  • [ ] Yes
  • No

Change in the IIDM format. Note that while the parameter is optional, it is only written if its value is non-zero. Therefore the round-trip test would not work for a file where the resistance is specified to value zero, because it will not be re-written to the file.

Other information:

Current limitation: for now parameter r does not take variants into account.

@SGI-Landry SGI-Landry self-assigned this Apr 3, 2026
@SGI-Landry SGI-Landry added the IIDM label Apr 3, 2026
@SGI-Landry
Copy link
Copy Markdown
Contributor Author

@bperr can you please take a look at this PR? Thanks.

@olperr1
Copy link
Copy Markdown
Member

olperr1 commented Apr 3, 2026

I added the "PR: do-not-merge" label because the IIDM v1.16 format must not be changed now that it is released.
We will soon create a PR to "open" the new IIDM v1.17 format. Once done (and this new PR reviewed), it will be necessary to adapt the current PR.

@olperr1
Copy link
Copy Markdown
Member

olperr1 commented Apr 3, 2026

@SGI-Landry: The sign-off is missing on your commits. This makes the DCO control fail.
Could you amend your commits to add it?

bperr
bperr previously approved these changes Apr 3, 2026
@SGI-Landry SGI-Landry requested a review from olperr1 April 3, 2026 08:49
No multivariant management for this attribute.

Signed-off-by: Landry Huet <landry.huet@supergrid-institute.com>
I used this opportunity to enhance the test coverage of DcTopologyModel.

Signed-off-by: Landry Huet <landry.huet@supergrid-institute.com>
Signed-off-by: Landry Huet <landry.huet@supergrid-institute.com>
…for now.

Signed-off-by: Landry Huet <landry.huet@supergrid-institute.com>
Signed-off-by: Landry Huet <landry.huet@supergrid-institute.com>
Signed-off-by: Landry Huet <landry.huet@supergrid-institute.com>
Signed-off-by: Landry Huet <landry.huet@supergrid-institute.com>
@SGI-Landry SGI-Landry force-pushed the LH-Add_resistance_to_DcSwitch branch from c6ab36a to 33acdac Compare April 3, 2026 13:59
@SGI-Landry
Copy link
Copy Markdown
Contributor Author

@SGI-Landry: The sign-off is missing on your commits. This makes the DCO control fail. Could you amend your commits to add it?

Thanks for pointing this out. This is now fixed.

Copy link
Copy Markdown
Member

@jeandemanged jeandemanged left a comment

Choose a reason for hiding this comment

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

here some first comments (didn't have time to complete)

Comment on lines +77 to +78
DcSwitchImpl dcSwitch = new DcSwitchImpl(networkRef, subnetworkRef, id, getName(), isFictitious(), kind, dcNode1, dcNode2, open);
dcSwitch.setR(this.r);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

add r to DcSwitchImpl constructor, otherwise you would send an update notification with the setter (see also further comment)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done. Is there any reasonable way to reduce the number of arguments in the constructor?

Comment thread iidm/iidm-api/src/main/java/com/powsybl/iidm/network/DcSwitch.java Outdated
- change comment in DcSwitch.
- add r to constructor of DcSwitchImpl and add network listener call in setR.
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 7, 2026

@alicecaron alicecaron moved this from TODO to In Progress in Release 06/2026 Apr 7, 2026
@alicecaron alicecaron moved this from In Progress to Waiting for review in Release 06/2026 Apr 7, 2026
@SGI-Landry SGI-Landry mentioned this pull request Apr 10, 2026
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Waiting for review

Development

Successfully merging this pull request may close these issues.

Enhanced DC Circuit Breaker

5 participants