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

Replace CGMES.switchType property by CGMES.originalClass property. #3267

Merged

Conversation

rcourtier
Copy link
Member

@rcourtier rcourtier commented Jan 10, 2025

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?

Refactoring.

What is the current behavior?

At CGMES import, if the Switch kind doesn't have a direct map to IIDM, i.e. if its class is: Switch, ProtectedSwitch, GroundDisconnector, Jumper, then its CGMES original class is stored in a CGMES.switchType property. The purpose is to be able to export back to CGMES the object with the correct class.
Similarly, at CGMES import, the original CGMES class of load or generator is stored in a CGMES.originalClass property.

What is the new behavior (if this is a feature change)?

For consistency purposes, drop the use of CGMES.switchType property in favor of CGMES.originalClass.

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)

Any access to the CGMES.switchType property should be replaced with CGMES.originalClass property. For instance:

String cgmesSwitchType = network.getSwitch("someSwitchUUID").getProperty("CGMES.switchType");

should be replaced by:

String cgmesSwitchType = network.getSwitch("someSwitchUUID").getProperty(Conversion.PROPERTY_CGMES_ORIGINAL_CLASS);

Similarly, any network saved to a serialized IIDM file should be updated by replacing all occurences of CGMES.switchType with CGMES.originalClass property, in case the network needs to be exported to CGMES.

Other information:

@rcourtier rcourtier requested review from flo-dup and olperr1 January 10, 2025 15:01
@rcourtier rcourtier self-assigned this Jan 14, 2025
Signed-off-by: Romain Courtier <romain.courtier@rte-france.com>
@rcourtier rcourtier force-pushed the store_switch_cgmes_original_class_in_dedicated_property branch from df5f8e6 to 22cce9d Compare January 15, 2025 08:42
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.

This is a breaking change... we should warn the users about it.

@rcourtier rcourtier added the Breaking Change API is broken label Jan 15, 2025
@flo-dup flo-dup merged commit 8aa0fdf into main Jan 15, 2025
8 checks passed
@flo-dup flo-dup deleted the store_switch_cgmes_original_class_in_dedicated_property branch January 15, 2025 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants