-
Notifications
You must be signed in to change notification settings - Fork 37
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
Conversation
13adfa7
to
f64b765
Compare
1b54ca2
to
20e2f48
Compare
iidm/iidm-converter-api/src/main/java/com/powsybl/iidm/export/ExportOptions.java
Show resolved
Hide resolved
iidm/iidm-xml-converter/src/main/java/com/powsybl/iidm/xml/AbstractConnectableXml.java
Show resolved
Hide resolved
iidm/iidm-xml-converter/src/main/java/com/powsybl/iidm/xml/AbstractNetworkXmlContext.java
Outdated
Show resolved
Hide resolved
iidm/iidm-xml-converter/src/main/java/com/powsybl/iidm/xml/ThreeWindingsTransformerXml.java
Show resolved
Hide resolved
iidm/iidm-xml-converter/src/main/java/com/powsybl/iidm/xml/util/IidmXmlUtil.java
Outdated
Show resolved
Hide resolved
20e2f48
to
cbbc53a
Compare
public ExportOptions() { | ||
} | ||
|
||
public ExportOptions(boolean withBranchSV, boolean indent, boolean onlyMainCc, TopologyLevel topologyLevel, boolean throwExceptionIfExtensionNotFound) { | ||
this(withBranchSV, indent, onlyMainCc, topologyLevel, throwExceptionIfExtensionNotFound, null); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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>
ef4e77f
to
1602248
Compare
Kudos, SonarCloud Quality Gate passed!
|
Please check if the PR fulfills these requirements (please use
'[x]'
to check the checkboxes, or submit the PR and then click the checkboxes)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