You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When importing a cgm that contains a substation in the EQ_BD file, there is an error saying the substation is present in both networks when the merge is attempted:
com.powsybl.commons.PowsyblException: The following object(s) of type SubstationImpl exist(s) in both networks: [xxx]
Describe the expected behavior
The merge should happen with no exception, and the resulting network should contain the substation.
Describe the steps
This is the code that is run for the exception to occur. The filename points to a zipped cgm, that contains an EQ_BD file that has a substation in it. CGM.zip
Network.read(Paths.get(new File(CsaProfileCracCreatorTest.class.getResource(filename).getFile()).toString()), LocalComputationManager.getDefault(), Suppliers.memoize(ImportConfig::load).get(), new Properties());
Environment
powsybl 6.2.0-RC1
Relevant Log Output
com.powsybl.commons.PowsyblException: The following object(s) of type SubstationImpl exist(s) in both networks: [b1859991-5a57-4f24-8763-7f83046d0984]
at com.powsybl.iidm.network.impl.NetworkImpl.checkMergeability(NetworkImpl.java:1022)
at com.powsybl.iidm.network.impl.NetworkImpl.merge(NetworkImpl.java:978)
at com.powsybl.iidm.network.impl.NetworkImpl.merge(NetworkImpl.java:146)
at com.powsybl.iidm.network.impl.NetworkFactoryImpl.merge(NetworkFactoryImpl.java:28)
at com.powsybl.iidm.network.impl.NetworkFactoryImpl.merge(NetworkFactoryImpl.java:36)
at com.powsybl.iidm.network.Network.merge(Network.java:517)
at com.powsybl.cgmes.conversion.CgmesImport.importData(CgmesImport.java:155)
at com.powsybl.iidm.network.Network.read(Network.java:127)
at com.powsybl.iidm.network.Network.read(Network.java:134)
at com.powsybl.iidm.network.Network.read(Network.java:148)
at com.powsybl.iidm.network.Network.read(Network.java:162)
Extra Information
No response
The text was updated successfully, but these errors were encountered:
For this test case the substation in the boundary is empty and is not referred by any of the IGMs, so it could be safely removed from the boundary.
An alternative workaround would be to import the instance files as a single, assembled model, instead of importing it as a separate set of IGMs that are then merged (the default behaviour when importing). This comes at a cost: you end up with all the equipment inside a single network, instead of having a Network that has 2 Subnetworks. To read the CGM.zip using this parameter you can use:
Another alternative would be to modify the Network::merge method to ignore duplicates when other network is merged, instead of not allowing it and throwing an exception, but that is a really big change in the merge feature. I will propose it in a separate PR.
Describe the current behavior
When importing a cgm that contains a substation in the EQ_BD file, there is an error saying the substation is present in both networks when the merge is attempted:
com.powsybl.commons.PowsyblException: The following object(s) of type SubstationImpl exist(s) in both networks: [xxx]
Describe the expected behavior
The merge should happen with no exception, and the resulting network should contain the substation.
Describe the steps
This is the code that is run for the exception to occur. The filename points to a zipped cgm, that contains an EQ_BD file that has a substation in it.
CGM.zip
Network.read(Paths.get(new File(CsaProfileCracCreatorTest.class.getResource(filename).getFile()).toString()), LocalComputationManager.getDefault(), Suppliers.memoize(ImportConfig::load).get(), new Properties());
Environment
powsybl 6.2.0-RC1
Relevant Log Output
com.powsybl.commons.PowsyblException: The following object(s) of type SubstationImpl exist(s) in both networks: [b1859991-5a57-4f24-8763-7f83046d0984]
Extra Information
No response
The text was updated successfully, but these errors were encountered: