-
Notifications
You must be signed in to change notification settings - Fork 40
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
Voltage and angle by bus in node/breaker topology #1170
Conversation
Signed-off-by: Mathieu BAGUE <mathieu.bague@rte-france.com>
Signed-off-by: Anne Tilloy <atilloy@gmail.com>
…opology during the XIIDM import. Signed-off-by: Anne Tilloy <atilloy@gmail.com>
Signed-off-by: Anne Tilloy <atilloy@gmail.com>
…leUntilMaximumVersion Signed-off-by: RALAMBOTIANA MIORA <miora.ralambotiana@rte-france.com>
…Version Signed-off-by: RALAMBOTIANA MIORA <miora.ralambotiana@rte-france.com>
Signed-off-by: Anne Tilloy <atilloy@gmail.com>
Hi ! For the moment, when no voltage and no angle are defined for a given bus, we read/write the list of nodes only. I am not sure that it is what you expected. What do you think ? |
iidm/iidm-xml-converter/src/main/java/com/powsybl/iidm/xml/VoltageLevelXml.java
Outdated
Show resolved
Hide resolved
@@ -20,8 +20,9 @@ | |||
<iidm:switch id="BK2" name="Breaker" kind="BREAKER" retained="true" open="false" node1="3" node2="4"/> | |||
<iidm:switch id="DISC_BBS1_BK3" name="Disconnector" kind="DISCONNECTOR" retained="false" open="false" node1="0" node2="5"/> | |||
<iidm:switch id="BK3" name="Breaker" kind="BREAKER" retained="true" open="false" node1="5" node2="6"/> | |||
<iidm:bus nodes="0,1,2,3,4,5,6"/> |
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.
If there is no V and/or theta, should we serialize buses?
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.
Line deleted.
@@ -5,7 +5,7 @@ | |||
<iidm:busBreakerTopology> | |||
<iidm:bus id="B1"/> | |||
</iidm:busBreakerTopology> | |||
<iidm:vscConverterStation id="C1" name="Converter1" lossFactor="0.011" voltageRegulatorOn="true" voltageSetpoint="405.0" bus="B1" connectableBus="B1" p="100.0" q="50.0"> | |||
<iidm:vscConverterStation id="C1" name="Converter1" voltageRegulatorOn="true" lossFactor="0.011" voltageSetpoint="405.0" bus="B1" connectableBus="B1" p="100.0" q="50.0"> |
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.
It's strange that the order of the two attributes is changing
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.
Revert.
</iidm:nodeBreakerTopology> | ||
<iidm:vscConverterStation id="C2" name="Converter2" lossFactor="0.011" voltageRegulatorOn="false" reactivePowerSetpoint="123.0" node="2"> | ||
<iidm:vscConverterStation id="C2" name="Converter2" voltageRegulatorOn="false" lossFactor="0.011" reactivePowerSetpoint="123.0" node="2"> |
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.
Same remark here
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.
Revert.
@@ -45,6 +46,8 @@ | |||
<iidm:switch id="BV" name="BW" kind="BREAKER" retained="true" open="false" node1="17" node2="18"/> | |||
<iidm:switch id="BX" name="BY" kind="BREAKER" retained="true" open="false" node1="19" node2="20"/> | |||
<iidm:switch id="BZ" name="CA" kind="BREAKER" retained="true" open="false" node1="21" node2="22"/> | |||
<iidm:bus v="236.44736" angle="15.250391" nodes="0,1,6,7,8,9,10,15,16,17,18,19,20,21,22"/> | |||
<iidm:bus nodes="3,4,5"/> |
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.
Same remark here
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.
Line deleted.
@@ -7,6 +7,7 @@ | |||
<iidm:switch id="br1" kind="BREAKER" retained="false" open="false" node1="1" node2="2"/> | |||
<iidm:internalConnection node1="0" node2="1"/> | |||
<iidm:internalConnection node1="3" node2="4"/> | |||
<iidm:bus nodes="0,1,2"/> |
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.
Same remark here
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.
Line deleted.
@@ -20,6 +21,7 @@ | |||
<iidm:switch id="br2" kind="BREAKER" retained="false" open="false" node1="1" node2="2"/> | |||
<iidm:internalConnection node1="0" node2="1"/> | |||
<iidm:internalConnection node1="3" node2="4"/> | |||
<iidm:bus nodes="0,1,2"/> |
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.
Same remark
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.
Line deleted.
for (Bus bus : vl.getBusView().getBuses()) { | ||
try { | ||
context.getWriter().writeEmptyElement(context.getVersion().getNamespaceURI(), "bus"); | ||
XmlUtil.writeDouble("v", bus.getV(), context.getWriter()); | ||
XmlUtil.writeDouble("angle", bus.getAngle(), context.getWriter()); | ||
Set<Integer> nodes = nodesByBus.get(bus.getId()); | ||
context.getWriter().writeAttribute("nodes", StringUtils.join(nodes.toArray(), ',')); | ||
} catch (XMLStreamException e) { | ||
throw new UncheckedXmlStreamException(e); | ||
} | ||
} |
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.
You can replace this by a forEach
and an intermediary method writeCalculatedBus(Bus, Set<Integer>, NetworkXmlWriterContext)
(with a stream, it will also be easier to filter bus with a voltage or angle non NaN
).
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.
This method could be declared as a static method in BusXml.
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.
Done, but in VoltageLevelXml.java.
iidm/iidm-xml-converter/src/main/java/com/powsybl/iidm/xml/util/IidmXmlUtil.java
Show resolved
Hide resolved
iidm/iidm-xml-converter/src/main/java/com/powsybl/iidm/xml/BusbarSectionXml.java
Show resolved
Hide resolved
iidm/iidm-xml-converter/src/main/java/com/powsybl/iidm/xml/BusbarSectionXml.java
Show resolved
Hide resolved
Signed-off-by: Anne Tilloy <atilloy@gmail.com>
a396d1c
to
e4dba75
Compare
…L attribute. Signed-off-by: Anne Tilloy <atilloy@gmail.com>
Signed-off-by: Mathieu BAGUE <mathieu.bague@rte-france.com>
@MioRtia @annetill I add both |
Signed-off-by: Mathieu BAGUE <mathieu.bague@rte-france.com>
Kudos, SonarCloud Quality Gate passed! 0 Bugs |
* Add a function to get the nodes of each buses, from the BusView Signed-off-by: Mathieu BAGUE <mathieu.bague@rte-france.com> * Export of bus in node/breaker topology with voltage, angle and nodes. * Voltage and angle by bus instead of busbar sections in node/breaker topology during the XIIDM import. Signed-off-by: Anne Tilloy <atilloy@gmail.com> * add IidmXmlUtil.assertMaximumVersion and IidmXmlUtil.readOptionalDoubleUntilMaximumVersion * add IidmXmlUtil.runFromMinimumVersion and IidmXmlUtil.runUntilMaximumVersion Signed-off-by: RALAMBOTIANA MIORA <miora.ralambotiana@rte-france.com> * Backward compatibility management and unitary tests update. * Not assert anything where there is a deletion or an addition of an XML attribute. Signed-off-by: Anne Tilloy <atilloy@gmail.com> * Add unit tests * Solve last code smell (complexity) Signed-off-by: Mathieu BAGUE <mathieu.bague@rte-france.com> Co-authored-by: Mathieu BAGUE <mathieu.bague@gmail.com> Co-authored-by: MioRtia <miora.ralambotiana@rte-france.com> (cherry picked from commit 2a32588)
Please check if the PR fulfills these requirements (please use
'[x]'
to check the checkboxes, or submit the PR and then click the checkboxes)I need to update the documentation.
Does this PR already have an issue describing the problem ? If so, link to this issue using
'#XXX'
and skip the restYes, fix issue #735
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Voltage and angle are no longer attached to bus bar sections in IIDM serialization. We introduce bus at node/breaker level with voltage, angle and the list of nodes that belong to this bus.
What is the current behavior? (You can also link to an open issue here)
Voltage and angle are attached to a bus bar section.
What is the new behavior (if this is a feature change)?
There are attached to bus in the node/breaker topology.
Does this PR introduce a breaking change or deprecate an API? If yes, check the following:
Other information:
(if any of the questions/checkboxes don't apply, please delete them entirely)