-
Notifications
You must be signed in to change notification settings - Fork 45
[CGMES] Less internal connections created at import #3210
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Florian Dupuy <[email protected]>
Signed-off-by: Florian Dupuy <[email protected]>
Signed-off-by: Florian Dupuy <[email protected]>
Signed-off-by: Florian Dupuy <[email protected]>
Signed-off-by: Florian Dupuy <[email protected]>
Signed-off-by: Florian Dupuy <[email protected]>
Signed-off-by: Florian Dupuy <[email protected]>
Signed-off-by: Florian Dupuy <[email protected]>
Signed-off-by: Florian Dupuy <[email protected]>
|
Just one quick consideration: could all these rules/simplification of the underlying connectivity model be moved to a post-processor after import (or a network modification). This way it could be useful for all importers, in a centralised way, and we should not need to consider them in every importer that have to handle. For example, recent versions of PSSE (35 and later) support node/breaker models where we could face similar problems. |
Signed-off-by: Florian Dupuy <[email protected]>
The node mapping is done at once for all terminals connected to a given connectivity node Signed-off-by: Florian Dupuy <[email protected]>
Signed-off-by: Florian Dupuy <[email protected]>
Signed-off-by: Florian Dupuy <[email protected]>
Thanks for pointing out that similarity with PSSE! But we should rather centralize it in a utility method. Post-processing is not the good way to go I think (in terms of performance, robustness, and readability). That's at the cost of handling the utility method call (and map building beforehand) in each importer, and having an abstraction which allows it, sure. If that's not possible, I think we should rather duplicate the logic than putting it in a common postprocessing. |
cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/NodeMapping.java
Outdated
Show resolved
Hide resolved
cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/NodeMapping.java
Show resolved
Hide resolved
Tested on ENTSO-E CGMES sample data SmallGrid/NodeBreaker
|
Signed-off-by: Florian Dupuy <[email protected]>
cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/NodeMapping.java
Outdated
Show resolved
Hide resolved
cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/NodeMapping.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Florian Dupuy <[email protected]>
Signed-off-by: Florian Dupuy <[email protected]>
Signed-off-by: Florian Dupuy <[email protected]>
Signed-off-by: Florian Dupuy <[email protected]>
Signed-off-by: Florian Dupuy <[email protected]>
Signed-off-by: Florian Dupuy <[email protected]>
|
@Test | ||
void testNever() { | ||
Properties cgmesImportParameters = new Properties(); | ||
cgmesImportParameters.put(CgmesImport.CREATE_FICTITIOUS_SWITCHES_FOR_DISCONNECTED_TERMINALS_MODE, "NEVER"); |
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.
Functionnally, this parameter shouldn't change the result.
Since you didn't provide a SSH file, all terminals are considered connected.
if (!connected && createFictitiousSwitch(fictSwCreationMode, isSwitchEnd)) { | ||
createFictitiousSwitch(t, vl); | ||
} else { | ||
createInternalConnection(t, vl); |
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 don't have to systematically create a node for the terminal and an internal connection between the terminal's node and the connectivitynode's node. You could do it only if needed, that is if 2 or more connected non-switch equipments share that terminal's connectivity node.
Network network = Network.read("multiTerminalConnectivityNodes.xml", | ||
getClass().getResourceAsStream("/multiTerminalConnectivityNodes.xml"), | ||
LocalComputationManager.getDefault(), | ||
ImportConfig.load(), | ||
cgmesImportParameters); |
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 simplify the import, you may use a method from ConversionUtil class in com.powsybl.cgmes.conversion.test package:
public static Network readCgmesResources(Properties properties, String dir, String... files)
That may be especially handy when you need to read several files (like EQ and SSH instance).
Signed-off-by: Florian Dupuy <[email protected]>
…onnections Signed-off-by: Florian Dupuy <[email protected]>
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?
Feature
What is the current behavior?
Each connectable and switch is created with two nodes at each end, one for the cim:ConnectivityNode, one for the cim:Terminal. The two nodes are connected with an InternalConnection. This leads to a verbose iidm file with an excessive number of InternalConnections.
What is the new behavior (if this is a feature change)?
When the configuration is the following:
iidm.import.cgmes.create-fictitious-switches-for-disconnected-terminals-mode
isNEVER
(default value isALWAYS
)iidm.import.cgmes.create-busbar-section-for-every-connectivity-node
isfalse
(which is the default value)The InternalConnection is created only if needed:
Does this PR introduce a breaking change or deprecate an API?