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

Allow to write IIDM-XML files in previous versions #1129

Merged
merged 9 commits into from
Jan 31, 2020

Conversation

miovd
Copy link
Contributor

@miovd miovd commented Jan 22, 2020

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)

Does this PR already have an issue describing the problem ?
No

What kind of change does this PR introduce?
Feature

What is the current behavior?
IIDM-XML files can only be written in current IIDM-XML version (i.e. 1.1)

What is the new behavior (if this is a feature change)?
IIDM-XML files can now be written in current and previous IIDM-XML versions (i.e. 1.0 and 1.1)

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

Other information:
⚠️ Network extensions cannot for the moment be written in previous versions, it will be implemented in another PR

@miovd miovd added this to PR in progress in Evolutions IIDM via automation Jan 22, 2020
@miovd miovd requested a review from mathbagu January 22, 2020 10:41
@miovd miovd changed the title [WIP] Allow to write IIDM-XML files in previous versions Allow to write IIDM-XML files in previous versions Jan 22, 2020
@miovd miovd changed the title Allow to write IIDM-XML files in previous versions [WIP] Allow to write IIDM-XML files in previous versions Jan 23, 2020
@miovd miovd changed the title [WIP] Allow to write IIDM-XML files in previous versions Allow to write IIDM-XML files in previous versions Jan 23, 2020
@miovd miovd changed the title Allow to write IIDM-XML files in previous versions [WIP] Allow to write IIDM-XML files in previous versions Jan 27, 2020
@miovd miovd added PR: conflict-with-main and removed Deprecated Methods have been deprecated labels Jan 27, 2020
@miovd miovd changed the title [WIP] Allow to write IIDM-XML files in previous versions Allow to write IIDM-XML files in previous versions Jan 27, 2020
@miovd miovd requested a review from mathbagu January 27, 2020 14:57
public ExportOptions() {
}

public ExportOptions(boolean withBranchSV, boolean indent, boolean onlyMainCc, TopologyLevel topologyLevel, boolean throwExceptionIfExtensionNotFound) {
this(withBranchSV, indent, onlyMainCc, topologyLevel, throwExceptionIfExtensionNotFound, null);
Copy link
Contributor

Choose a reason for hiding this comment

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

To be discussed: I'm not sure we should allow null values

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In my opinion, null for version would mean the same as "default" version i.e. the most recent version (which is implemented in NetworkXml).

The logic here of using null for undefined rather than directly a defined value is that if we use ExportOptions for an another serialization of IIDM in the future (IIDM-JSON for example), the most recent version of this serialization does not have to be the same as IIDM-XML most recent version. In this case, keeping it undefined and letting the converter itself assert the defaut version is the best solution I think.

.setAcceptableDuration(acceptableDuration)
.setValue(value)
.setFictitious(fictitious)
.endTemporaryLimit();
}
});
adder.add();
}

public static void writeCurrentLimits(Integer index, CurrentLimits limits, XMLStreamWriter writer) throws XMLStreamException {
Copy link
Contributor

Choose a reason for hiding this comment

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

To be discussed: I fact, I have a doubt now... This method is not really public, but private package... maybe you were right yesterday when I asked you to remove the deprecated. I think we should even break the API and make this method private package.

Is this method still used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently, it is only used in some extensions relying on CurrentLimits. Not sure either if this should remain public or not but I think both positions are valid.

Signed-off-by: RALAMBOTIANA MIORA <miora.ralambotiana@rte-france.com>
Signed-off-by: RALAMBOTIANA MIORA <miora.ralambotiana@rte-france.com>
Signed-off-by: RALAMBOTIANA MIORA <miora.ralambotiana@rte-france.com>
Signed-off-by: RALAMBOTIANA MIORA <miora.ralambotiana@rte-france.com>
Signed-off-by: RALAMBOTIANA MIORA <miora.ralambotiana@rte-france.com>
Signed-off-by: RALAMBOTIANA MIORA <miora.ralambotiana@rte-france.com>
Signed-off-by: RALAMBOTIANA MIORA <miora.ralambotiana@rte-france.com>
Signed-off-by: RALAMBOTIANA MIORA <miora.ralambotiana@rte-france.com>
@sonarcloud
Copy link

sonarcloud bot commented Jan 31, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 2 Code Smells

90.4% 90.4% Coverage
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Evolutions IIDM
  
Merged PR
Development

Successfully merging this pull request may close these issues.

None yet

2 participants