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

CGMES export. Preserve original class of generators. Fix synchronous machine type. Fix operating mode #2726

Conversation

marqueslanauja
Copy link
Contributor

@marqueslanauja marqueslanauja commented Sep 29, 2023

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?

Fixes one of the issues described in #2707

What kind of change does this PR introduce?

Feature

What is the current behavior?

The cgmes classes EquivalentInjection, ExternalNetworkInjection and SynchronousMachine, during the import process, are converted into generators. During the cgmes export process, all the IIDM generators are exported as SynchronousMachines, therefore the original cgmes classes are not preserved.

Also, during the cgmes export process, the SynchronousMachineKind and SynchronousMachineOperatingMode are always calculated based on the minP, maxP, and targetP attributes.

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

The cgmes original class is preserved during the cgmes export process, therefore generators are exported as EquivalentInjection, ExternalNetworkInjection and SynchronousMachine in concordance with their original class.

Original SynchronousMachineKind and SynchronousMachineOperatingMode are also preserved if they are compatible with the current attributes of the generator, in another case, the calculated values are exported.

To avoid Infinite values during reimport, minP, maxP, minQ, and maxQ attributes are not exported when they are assigned to the default values (Double.MIN_VALUE and Double.MAX_VALUE).

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

  • The Breaking Change or Deprecated label has been added
  • The migration guide has been updated in the github wiki (What changes might users need to make in their application due to this PR?)

Other information:

marqueslanauja and others added 10 commits September 29, 2023 09:09
Signed-off-by: José Antonio Marqués <marquesja@aia.es>
Signed-off-by: José Antonio Marqués <marquesja@aia.es>
Signed-off-by: José Antonio Marqués <marquesja@aia.es>
Signed-off-by: José Antonio Marqués <marquesja@aia.es>
Signed-off-by: José Antonio Marqués <marquesja@aia.es>
Signed-off-by: José Antonio Marqués <marquesja@aia.es>
Signed-off-by: José Antonio Marqués <marquesja@aia.es>
marqueslanauja and others added 3 commits October 16, 2023 07:22
Signed-off-by: José Antonio Marqués <marquesja@aia.es>
@marqueslanauja
Copy link
Contributor Author

I think it is better to keep duplicated code since it is more readable.

…_operatingMode_issue_2707

Signed-off-by: José Antonio Marqués <marquesja@aia.es>

# Conflicts:
#	cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/export/EquipmentExportTest.java
marqueslanauja and others added 9 commits October 26, 2023 16:44
…_operatingMode_issue_2707

Signed-off-by: marqueslanauja <51124986+marqueslanauja@users.noreply.github.com>
…_operatingMode_issue_2707

Signed-off-by: José Antonio Marqués <marquesja@aia.es>

# Conflicts:
#	cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/Conversion.java
#	cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/export/SteadyStateHypothesisExport.java
#	cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/export/EquipmentExportTest.java
#	cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/export/ExportXmlCompare.java
#	cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/export/SteadyStateHypothesisExportTest.java
Signed-off-by: José Antonio Marqués <marquesja@aia.es>
…_operatingMode_issue_2707

Signed-off-by: José Antonio Marqués <marquesja@aia.es>

# Conflicts:
#	cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/elements/EquivalentInjectionConversion.java
#	cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/export/elements/EquivalentInjectionEq.java
@zamarrenolm zamarrenolm changed the title Cgmes Export: Preserve original class of generators . Fix synchronousMachine type. Fix operatingMode CGMES export. Preserve original class of generators. Fix Synchronous Machine type. Fix operating mode Jan 9, 2024
@zamarrenolm zamarrenolm changed the title CGMES export. Preserve original class of generators. Fix Synchronous Machine type. Fix operating mode CGMES export. Preserve original class of generators. Fix synchronous machine type. Fix operating mode Jan 9, 2024
Copy link

sonarcloud bot commented Jan 15, 2024

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

4 New issues
0 Security Hotspots
90.4% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

marqueslanauja and others added 3 commits February 22, 2024 12:37
…_operatingMode_issue_2707

Signed-off-by: José Antonio Marqués <marquesja@aia.es>

# Conflicts:
#	cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/Conversion.java
#	cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/export/EquipmentExport.java
#	cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/export/SteadyStateHypothesisExport.java
#	cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/export/EquipmentExportTest.java
Signed-off-by: José Antonio Marqués <marquesja@aia.es>
Copy link
Contributor

@nemanja-st nemanja-st left a comment

Choose a reason for hiding this comment

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

Mostly cosmetic changes, to align usage of string and const where possible.

Signed-off-by: José Antonio Marqués <marquesja@aia.es>
@marqueslanauja
Copy link
Contributor Author

We added the generatorOrMotor kind.

…_operatingMode_issue_2707

Signed-off-by: José Antonio Marqués <marquesja@aia.es>

# Conflicts:
#	cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/elements/SynchronousMachineConversion.java
#	cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/export/EquipmentExport.java
Signed-off-by: José Antonio Marqués <marquesja@aia.es>
…_operatingMode_issue_2707

Signed-off-by: José Antonio Marqués <marquesja@aia.es>

# Conflicts:
#	cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/elements/SynchronousMachineConversion.java
#	cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/export/EquipmentExport.java
#	cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/export/SteadyStateHypothesisExport.java
#	cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/export/EquipmentExportTest.java
…_operatingMode_issue_2707

Signed-off-by: José Antonio Marqués <marquesja@aia.es>

# Conflicts:
#	cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/export/EquipmentExport.java
#	cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/export/ExportXmlCompare.java
Copy link
Member

@zamarrenolm zamarrenolm left a comment

Choose a reason for hiding this comment

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

The change has been verified using a big network to ensure we do not introduce any regression in performance

Copy link

sonarcloud bot commented Mar 27, 2024

@annetill annetill merged commit 27e5368 into main Mar 27, 2024
6 checks passed
@annetill annetill deleted the cgmes_export_fix_synchronousMachine_type_and_operatingMode_issue_2707 branch March 27, 2024 10:01
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.

5 participants