Open
Description
Describe the current behavior
CGMES importer looks for _EQ_
or _EQ.
string presence in file name to filter for EQ profiles.
Describe the expected behavior
A more robust solution would rather check only the model header md:Model.profile
to determine what profile(s) a file contains.
Describe the motivation
Got an issue with non-obvious stack trace with one IGM where files were named (allegedly weirdly):
confidential_EQ_confidential_EQ.xml
confidential_EQ_confidential_SSH.xml
confidential_EQ_confidential_SV.xml
confidential_EQ_confidential_TP.xml
All of them are then considered as EQ
. Because they all have same md:Model.modelingAuthoritySet
the import then fails with default importer settings.
Workarounds are:
- renaming files
- changing
iidm.import.cgmes.cgm-with-subnetworks-defined-by
toFILENAME
(consequences may be acceptable or not) - changing
iidm.import.cgmes.cgm-with-subnetworks
tofalse
(consequences may be acceptable or not)
Extra Information
powsybl-core 6.5.0
DEBUG:powsybl:Duplicate key MAS (attempted merging values [confidential_EQ_confidential_SV.xml] and [confidential_EQ_confidential_TP.xml])
java.lang.IllegalStateException: Duplicate key MAS (attempted merging values [confidential_EQ_confidential_SV.xml] and [confidential_EQ_confidential_TP.xml])
at [email protected]/java.util.stream.Collectors.duplicateKeyException(Collectors.java:135)
at [email protected]/java.util.stream.Collectors.lambda$uniqKeysMapAccumulator$1(Collectors.java:182)
at [email protected]/java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
at [email protected]/java.util.stream.Streams$StreamBuilderImpl.forEachRemaining(Streams.java:411)
at [email protected]/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
at [email protected]/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:276)
at [email protected]/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at [email protected]/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
at [email protected]/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1707)
at [email protected]/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at [email protected]/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at [email protected]/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
at [email protected]/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at [email protected]/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
at com.powsybl.cgmes.conversion.CgmesImport$MultipleGridModelChecker.separateByModelingAuthority(CgmesImport.java:260)
at com.powsybl.cgmes.conversion.CgmesImport$MultipleGridModelChecker.separate(CgmesImport.java:247)
at com.powsybl.cgmes.conversion.CgmesImport.importData(CgmesImport.java:163)
at com.powsybl.iidm.network.Network.read(Network.java:128)
at com.powsybl.iidm.network.Network.read(Network.java:135)
at com.powsybl.python.network.NetworkCFunctions.lambda$loadNetwork$6(NetworkCFunctions.java:171)
at com.powsybl.python.commons.Util.doCatch(Util.java:132)
at com.powsybl.python.network.NetworkCFunctions.loadNetwork(NetworkCFunctions.java:163)