Skip to content

fix removing voltageLevel when equipments are still present#3860

Open
EtienneLt wants to merge 7 commits intomainfrom
fix-removing-voltageLevel-when-equipment-still-present
Open

fix removing voltageLevel when equipments are still present#3860
EtienneLt wants to merge 7 commits intomainfrom
fix-removing-voltageLevel-when-equipment-still-present

Conversation

@EtienneLt
Copy link
Copy Markdown
Contributor

@EtienneLt EtienneLt commented Apr 1, 2026

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?
no

What kind of change does this PR introduce?
Bug fix

What is the current behavior?
when reverting a modification with a created voltage level if there are still equipments present on it it will fail

What is the new behavior (if this is a feature change)?
fix it and add a new warning when there is still quadripole or not

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

  • Yes
  • No

Other information:

Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
@EtienneLt EtienneLt self-assigned this Apr 1, 2026
Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
Comment on lines +1 to +7
+ Testing reportNode for reverting create line on line and not removing the voltage level
Line CJ_1 removed
Line CJ_2 removed
Line testLine removed
Line CJ_NEW created
Voltage level CJ_VL still contains equipments including quadripoles, it is not removed
Voltage level VLTEST removed
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So you are expecting everything to be deleted even if the voltage level cannot be deleted ? Wouldn't it be better to check before deleting instead of starting and noticing that one of the element cannot be deleted ?

Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
Comment on lines +138 to +139
core.iidm.modification.voltageLevelRemovingEquipmentsLeftWithQuadripoles = Le poste ${vlId} contient toujours des équipements dont des quadripoles, il n'est pas supprimé.
core.iidm.modification.voltageLevelRemovingEquipmentsLeftWithoutQuadripoles = Le poste ${vlId} contient toujours des équipements mais aucun quadripoles, il n'est pas supprimé.
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.

There's a typo in quadripôles: it takes a ^.

Comment on lines +138 to +139
core.iidm.modification.voltageLevelRemovingEquipmentsLeftWithQuadripoles = Voltage level ${vlId} still contains equipments including quadripoles, it is not removed
core.iidm.modification.voltageLevelRemovingEquipmentsLeftWithoutQuadripoles = Voltage level ${vlId} still contains equipments but no quadripoles, it is not removed
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.

quadripoles -> branches

Can you fix the keys and the messages?

core.iidm.modification.voltageLevelRemovingEquipmentsLeft = Le poste ${vlId} contient toujours des équipements.
core.iidm.modification.voltageLevelRemovingEquipmentsLeft = Le poste ${vlId} contient toujours des �quipements.
core.iidm.modification.voltageLevelRemovingEquipmentsLeftWithQuadripoles = Le poste ${vlId} contient toujours des équipements dont des quadripoles, il n'est pas supprimé.
core.iidm.modification.voltageLevelRemovingEquipmentsLeftWithoutQuadripoles = Le poste ${vlId} contient toujours des équipements mais aucun quadripoles, il n'est pas supprimé.
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.

Beware, this file should be edited in UTF-8.

Comment on lines +203 to +205
boolean noMoreBranches = voltageLevel.getConnectableStream().noneMatch(c -> c.getType() != IdentifiableType.LINE
|| c.getType() != IdentifiableType.TWO_WINDINGS_TRANSFORMER || c.getType() != IdentifiableType.THREE_WINDINGS_TRANSFORMER ||
c.getType() != IdentifiableType.HVDC_CONVERTER_STATION);
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.

This check can be done in the if (!noMoreEquipments) {.

Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 1, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
46.9% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

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