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

Geographical and ControlArea persistence #1983

Merged
merged 10 commits into from
Mar 24, 2022
Merged

Geographical and ControlArea persistence #1983

merged 10 commits into from
Mar 24, 2022

Conversation

marcosmc
Copy link
Contributor

@marcosmc marcosmc commented Feb 21, 2022

Please check if the PR fulfills these requirements (please use '[x]' to check the checkboxes, or submit the PR and then click the checkboxes)

  • 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)

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Feature

What is the current behavior? (You can also link to an open issue here)
The original Id of the Geographical and Subgeographical Regions are not preserved in the export to CGMES.

What is the new behavior (if this is a feature change)?
Keep the Id of the Geographical and Subgeographical Regions if it exists, or create a new Id to use for all network exports.

marcosmc and others added 6 commits February 21, 2022 10:08
Signed-off-by: AIA_NT\demiguelm <demiguelm@aia.es>
Signed-off-by: AIA_NT\demiguelm <demiguelm@aia.es>
Signed-off-by: AIA_NT\demiguelm <demiguelm@aia.es>
Signed-off-by: AIA_NT\demiguelm <demiguelm@aia.es>
@marcosmc marcosmc marked this pull request as ready for review March 17, 2022 09:31
@marcosmc marcosmc requested review from miovd and zamarrenolm and removed request for miovd March 17, 2022 09:31
Comment on lines +453 to +470
private void addIidmMappingsControlArea(Network network) {
CgmesControlAreas cgmesControlAreas = network.getExtension(CgmesControlAreas.class);
if (cgmesControlAreas == null) {
network.newExtension(CgmesControlAreasAdder.class).add();
cgmesControlAreas = network.getExtension(CgmesControlAreas.class);
String cgmesControlAreaId = CgmesExportUtil.getUniqueId();
cgmesControlAreas.newCgmesControlArea()
.setId(cgmesControlAreaId)
.setName("Network")
.setEnergyIdentificationCodeEic("Network--1")
.add();
CgmesControlArea cgmesControlArea = cgmesControlAreas.getCgmesControlArea(cgmesControlAreaId);
for (DanglingLine danglingLine : network.getDanglingLines()) {
cgmesControlArea.add(danglingLine.getTerminal());
}
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you explain why you're adding Control areas here? I don't think it is needed...

Copy link
Member

Choose a reason for hiding this comment

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

The CGMES export was creating a "default" control area if none was defined in the input files, or the Network came from IIDM.
Instead of only writing it in the export module, we also keep it in the CGMES-IIDM mappings, as we are doing for the rest of information produced. The export module will write what is found in the CGMES-IIDM mapping data.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, thank you for your answer

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

95.6% 95.6% Coverage
0.0% 0.0% Duplication

@miovd miovd merged commit f6b4fc4 into main Mar 24, 2022
@miovd miovd deleted the complete-persistence branch March 24, 2022 08:46
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