-
Notifications
You must be signed in to change notification settings - Fork 43
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: Add a parameter to export as bus branch #3315
base: main
Are you sure you want to change the base?
Conversation
30aef81
to
1e8fdfd
Compare
534fe97
to
bec824f
Compare
1e8fdfd
to
09cc8ac
Compare
30b97d9
to
cba96a8
Compare
c72e70d
to
55af22e
Compare
cba96a8
to
321044c
Compare
Signed-off-by: Romain Courtier <[email protected]>
Signed-off-by: Romain Courtier <[email protected]>
Signed-off-by: Romain Courtier <[email protected]>
…S_BRANCH export Signed-off-by: Romain Courtier <[email protected]>
Signed-off-by: Romain Courtier <[email protected]>
Signed-off-by: Romain Courtier <[email protected]>
321044c
to
cca2fbd
Compare
|
private static final Parameter TOPOLOGY_KIND_PARAMETER = new Parameter( | ||
TOPOLOGY_KIND, | ||
ParameterType.STRING, | ||
"The topology kind of the export", |
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.
"The topology kind of the export", | |
"Force the topology kind for the export (disable automatic detection)", |
@@ -159,12 +159,25 @@ public ReferenceDataProvider getReferenceDataProvider() { | |||
} | |||
|
|||
private CgmesTopologyKind networkTopologyKind(Network network) { |
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.
Can you rename this method to detectNetworkTopologyKind
?
It doesn't consider the parameters, but only the network, so it should not be used to get the topology kind. With this name, it's maybe clearer.
@@ -130,4 +130,11 @@ public static String getElement(String xmlFile, String className, String rdfId) | |||
Pattern pattern = Pattern.compile(regex, Pattern.DOTALL); | |||
return getFirstMatch(xmlFile, pattern); | |||
} | |||
|
|||
public static long getElementCount(String xmlFile, String className) { | |||
String regex = "(<cim:" + className + " (rdf:ID=\"_|rdf:about=\"#_).*?\")>"; |
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.
.*?
can be replaced by .+
.
| 100 | `BUS_BRANCH` | Yes (**) | Yes | | ||
|
||
### Connectivity elements | ||
* non-retained `Switch` are always written in the case of a `NODE_BREAKER` export, and never written in the case of a `BUS_BRANCH` export |
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.
* non-retained `Switch` are always written in the case of a `NODE_BREAKER` export, and never written in the case of a `BUS_BRANCH` export | |
* Non-retained `Switch` are always written in the case of a `NODE_BREAKER` export, and never written in the case of a `BUS_BRANCH` export |
* If some `VoltageLevel` of the network are at `node/breaker` and some other at `bus/breaker` connectivity level, then the export's topology kind depends on the CIM version for export: | ||
it is `BUS_BRANCH` for CIM 16 and `NODE_BREAKER` for CIM 100 | ||
|
||
It is however possible to ignore the computed export topology kind and force it to be `NODE_BREAKER` or `BUS_BRANCH` by setting the parameter `iidm.export.cgmes.topology-kind`. |
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 is however possible to ignore the computed export topology kind and force it to be `NODE_BREAKER` or `BUS_BRANCH` by setting the parameter `iidm.export.cgmes.topology-kind`. | |
It is however possible to ignore the computed export topology kind and force it to be `NODE_BREAKER` or `BUS_BRANCH` by setting the parameter [`iidm.export.cgmes.topology-kind`](#options). |
Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
No.
What kind of change does this PR introduce?
New feature.
Does this PR introduce a new Powsybl Action implying to be implemented in simulators or pypowsybl?
What is the current behavior?
CGMES export's topology kind depends on the network's topology kind computation. A network with at least one node/breaker voltage level will be exported as
NODE_BREAKER
, and a full bus/breaker network will always be exported asBUS_BRANCH
.What is the new behavior (if this is a feature change)?
The network topology kind computation has been revised. The network has to be a full node/breaker to be exported in CGMES as
NODE_BREAKER
, likewise it has to be a full bus/breaker to be exported in CGMES asBUS_BRANCH
. In case of a hybrid (mixed topology) network, the computed topology kind depends on the CIM version for export: it isBUS_BRANCH
in case of a CIM 16 export andNODE_BREAKER
for a CIM 100 export.A new parameter has been added to override the computed export topology kind and force a desired one. It allows for example to export a node/breaker network as
BUS_BRANCH
. The allowed values for this parameter areNODE_BREAKER
andBUS_BRANCH
.The differences in the various configurations of CIM version and topology kind are:
In case of a CIM 16
BUS_BRANCH
export:ConnectivityNode
are not exportedSwitch
are not exportedIn case of a CIM 100
BUS_BRANCH
export,ConnectivityNode
are exported from buses of the BusBreakerViewSwitch
are not exportedIn case of a
NODE_BREAKER
export:ConnectivityNode
are always exported, either from nodes if the VoltageLevel is at node/breaker connectivity level, or from buses if the VoltageLevel is at bus/breaker connectivity level.Switch
are always exported.Also, there is a specificity for the CIM 16
BUS_BRANCH
export where this export intrinsically means not writting the equipment operation profile. This means the following classes won't be written:As well as the following attributes:
Note: the CGMES EquipmentOperation profile contains more elements, but they don't exist in PowSyBl and are already not exported.
Does this PR introduce a breaking change or deprecate an API?
If yes, please check if the following requirements are fulfilled
What changes might users need to make in their application due to this PR? (migration steps)
In case of a network with mixed topology, that is with some
VoltageLevel
innode/breaker
topology kind and some otherVoltageLevel
inbus/breaker
topology kind, the CGMES export without this feature was always aNODE_BREAKER
one. The change introduced here is that the export will now be aBUS_BRANCH
one if the CIM version for export is 16 (default value).In order to restore a
NODE_BREAKER
export for a mixed-topology network, one has to set the TOPOLOGY_KIND CgmesExport parameter as follows:Other information: