Skip to content

Commit

Permalink
Merge branch 'main' into psse_import_update_substation_data_without_c…
Browse files Browse the repository at this point in the history
…onversion
  • Loading branch information
zamarrenolm authored Nov 14, 2024
2 parents cb8bb61 + 6dd9ad6 commit eb7fe5d
Show file tree
Hide file tree
Showing 126 changed files with 3,466 additions and 29,729 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@

import com.google.common.jimfs.Configuration;
import com.google.common.jimfs.Jimfs;
import com.powsybl.cgmes.conformity.CgmesConformity1ModifiedCatalog;
import com.powsybl.cgmes.conversion.CgmesImport;
import com.powsybl.cgmes.conversion.CgmesModelExtension;
import com.powsybl.cgmes.model.CgmesModel;
import com.powsybl.commons.config.InMemoryPlatformConfig;
import com.powsybl.commons.datasource.ReadOnlyDataSource;
import com.powsybl.commons.datasource.ResourceDataSource;
import com.powsybl.commons.datasource.ResourceSet;
import com.powsybl.computation.ComputationManager;
import com.powsybl.computation.local.LocalComputationManager;
import com.powsybl.iidm.network.Importers;
Expand Down Expand Up @@ -52,7 +53,8 @@ void tearDown() throws Exception {

@Test
void miniGridNodeBreakerMissingVoltageLevel() throws IOException {
ReadOnlyDataSource dataSource = CgmesConformity1ModifiedCatalog.miniGridNodeBreakerMissingVoltageLevel().dataSource();
ReadOnlyDataSource dataSource = new ResourceDataSource("CGMES file",
new ResourceSet("/", "missing_voltagelevel.xml"));
Properties importParams = new Properties();
importParams.put(CgmesImport.PRE_PROCESSORS, "createMissingContainers");

Expand All @@ -74,7 +76,7 @@ void miniGridNodeBreakerMissingVoltageLevel() throws IOException {

// Check that a specific terminal has a voltage level, navigating the CGMES model
CgmesModel cgmes = network.getExtension(CgmesModelExtension.class).getCgmesModel();
String terminalId = "4915762d-133e-4209-8545-2822d095d7cd";
String terminalId = "T_BBS";
String voltageLevelId = cgmes.voltageLevel(cgmes.terminal(terminalId), cgmes.isNodeBreaker());
if (voltageLevelId == null || voltageLevelId.isEmpty()) {
fail("Missing voltage level for terminal " + terminalId);
Expand Down
40 changes: 40 additions & 0 deletions cgmes/cgmes-completion/src/test/resources/missing_voltagelevel.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<rdf:RDF xmlns:cim="http://iec.ch/TC57/2013/CIM-schema-cim16#" xmlns:md="http://iec.ch/TC57/61970-552/ModelDescription/1#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<md:FullModel rdf:about="urn:uuid:ModelID">
<md:Model.scenarioTime>2021-03-01T23:00:00Z</md:Model.scenarioTime>
<md:Model.created>2021-03-02T10:22:58Z</md:Model.created>
<md:Model.description>Nodes containers mapping</md:Model.description>
<md:Model.version>001</md:Model.version>
<md:Model.profile>http://entsoe.eu/CIM/EquipmentCore/3/1</md:Model.profile>
<md:Model.profile>http://entsoe.eu/CIM/EquipmentOperation/3/1</md:Model.profile>
<md:Model.modelingAuthoritySet>powsybl.org</md:Model.modelingAuthoritySet>
</md:FullModel>
<cim:GeographicalRegion rdf:ID="_GR">
<cim:IdentifiedObject.name>Geographical region</cim:IdentifiedObject.name>
</cim:GeographicalRegion>
<cim:SubGeographicalRegion rdf:ID="_SGR">
<cim:IdentifiedObject.name>Subgeographical region</cim:IdentifiedObject.name>
<cim:SubGeographicalRegion.Region rdf:resource="#_GR"/>
</cim:SubGeographicalRegion>
<cim:Substation rdf:ID="_ST">
<cim:IdentifiedObject.name>Substation</cim:IdentifiedObject.name>
<cim:Substation.Region rdf:resource="#_SGR"/>
</cim:Substation>
<cim:ConnectivityNode rdf:ID="_CN">
<cim:IdentifiedObject.name>Node</cim:IdentifiedObject.name>
<cim:ConnectivityNode.ConnectivityNodeContainer rdf:resource="#_VL"/>
</cim:ConnectivityNode>
<cim:BusbarSection rdf:ID="_BBS">
<cim:IdentifiedObject.name>Busbar section</cim:IdentifiedObject.name>
<cim:Equipment.EquipmentContainer rdf:resource="#VL" />
<cim:ConductingEquipment.BaseVoltage rdf:resource="#_BV" />
</cim:BusbarSection>
<cim:Terminal rdf:ID="_T_BBS">
<cim:IdentifiedObject.name>Terminal BBS</cim:IdentifiedObject.name>
<cim:Terminal.ConductingEquipment rdf:resource="#_BBS"/>
<cim:Terminal.ConnectivityNode rdf:resource="#_CN"/>
</cim:Terminal>
<cim:BaseVoltage rdf:ID="_BV">
<cim:IdentifiedObject.name>110 kV</cim:IdentifiedObject.name>
<cim:BaseVoltage.nominalVoltage>110</cim:BaseVoltage.nominalVoltage>
</cim:BaseVoltage>
</rdf:RDF>
Original file line number Diff line number Diff line change
Expand Up @@ -986,23 +986,6 @@ public static GridModelReferenceResources miniNodeBreakerLoadBreakSwitch() {
MINI_GRID_BD_TP));
}

public static GridModelReferenceResources miniNodeBreakerCimLine() {
String base = ENTSOE_CONFORMITY_1_MODIFIED
+ "/MiniGrid/NodeBreaker/BaseCase_Complete_v3_cim_line/";
return new GridModelReferenceResources(
"MiniGrid-NodeBreaker-Cim-Line",
null,
new ResourceSet(base,
MINI_GRID_EQ),
new ResourceSet(MINI_GRID_NODE_BREAKER_BASE,
MINI_GRID_SV,
MINI_GRID_DL,
MINI_GRID_SSH,
MINI_GRID_TP),
new ResourceSet(MINI_GRID_NODE_BREAKER_BD_BASE, MINI_GRID_BD_EQ,
MINI_GRID_BD_TP));
}

public static GridModelReferenceResources miniNodeBreakerProtectedSwitch() {
String base = ENTSOE_CONFORMITY_1_MODIFIED
+ "/MiniGrid/NodeBreaker/BaseCase_Complete_v3_protected_switch/";
Expand All @@ -1020,57 +1003,6 @@ public static GridModelReferenceResources miniNodeBreakerProtectedSwitch() {
MINI_GRID_BD_TP));
}

public static GridModelReferenceResources miniNodeBreakerSwitchBetweenVoltageLevelsOpen() {
String base = ENTSOE_CONFORMITY_1_MODIFIED
+ "/MiniGrid/NodeBreaker/BaseCase_Complete_v3_switchVLsOpen/";
return new GridModelReferenceResources(
"MiniGrid-NodeBreaker-switchBetweenVoltageLevelsOpen",
null,
new ResourceSet(base,
MINI_GRID_EQ,
MINI_GRID_SSH),
new ResourceSet(MINI_GRID_NODE_BREAKER_BASE,
MINI_GRID_SV,
MINI_GRID_DL,
MINI_GRID_TP),
new ResourceSet(MINI_GRID_NODE_BREAKER_BD_BASE, MINI_GRID_BD_EQ,
MINI_GRID_BD_TP));
}

public static GridModelReferenceResources miniNodeBreakerJoinVoltageLevelSwitch() {
String base = ENTSOE_CONFORMITY_1_MODIFIED
+ "/MiniGrid/NodeBreaker/BaseCase_Complete_v3_joinVoltageLevelSwitch/";
return new GridModelReferenceResources(
"MiniGrid-NodeBreaker-joinVoltageLevel-switch",
null,
new ResourceSet(base,
MINI_GRID_EQ),
new ResourceSet(MINI_GRID_NODE_BREAKER_BASE,
MINI_GRID_SV,
MINI_GRID_DL,
MINI_GRID_SSH,
MINI_GRID_TP),
new ResourceSet(MINI_GRID_NODE_BREAKER_BD_BASE, MINI_GRID_BD_EQ,
MINI_GRID_BD_TP));
}

public static GridModelReferenceResources miniNodeBreakerJoinVoltageLevelTx() {
String base = ENTSOE_CONFORMITY_1_MODIFIED
+ "/MiniGrid/NodeBreaker/BaseCase_Complete_v3_joinVoltageLevelTx/";
return new GridModelReferenceResources(
"MiniGrid-NodeBreaker-joinVoltageLevel-tx",
null,
new ResourceSet(base,
MINI_GRID_EQ),
new ResourceSet(MINI_GRID_NODE_BREAKER_BASE,
MINI_GRID_SV,
MINI_GRID_DL,
MINI_GRID_SSH,
MINI_GRID_TP),
new ResourceSet(MINI_GRID_NODE_BREAKER_BD_BASE, MINI_GRID_BD_EQ,
MINI_GRID_BD_TP));
}

public static GridModelReference miniNodeBreakerInternalLineZ0() {
String base = ENTSOE_CONFORMITY_1_MODIFIED
+ "/MiniGrid/NodeBreaker/BaseCase_Complete_v3_internal_line_z0/";
Expand All @@ -1088,22 +1020,6 @@ public static GridModelReference miniNodeBreakerInternalLineZ0() {
MINI_GRID_BD_TP));
}

public static GridModelReference miniNodeBreakerSubstationNode() {
String base = ENTSOE_CONFORMITY_1_MODIFIED
+ "/MiniGrid/NodeBreaker/BaseCase_Complete_v3_substation_node/";
return new GridModelReferenceResources(
"MiniGrid-NodeBreaker-Substation-Node",
null,
new ResourceSet(base,
MINI_GRID_EQ),
new ResourceSet(MINI_GRID_NODE_BREAKER_BASE,
MINI_GRID_SV,
MINI_GRID_SSH,
MINI_GRID_TP),
new ResourceSet(MINI_GRID_NODE_BREAKER_BD_BASE, MINI_GRID_BD_EQ,
MINI_GRID_BD_TP));
}

public static GridModelReference miniNodeBreakerMissingSubstationRegion() {
String base = ENTSOE_CONFORMITY_1_MODIFIED
+ "/MiniGrid/NodeBreaker/BaseCase_Complete_v3_missing_substation_region/";
Expand Down Expand Up @@ -1613,22 +1529,6 @@ public static GridModelReferenceResources smallGridBusBranchWithBusbarSectionsAn
SMALL_GRID_BD_TP));
}

public static GridModelReference miniGridNodeBreakerMissingVoltageLevel() {
String base = ENTSOE_CONFORMITY_1_MODIFIED
+ "/MiniGrid/NodeBreaker/BaseCase_Complete_v3_missing_voltage_level/";
return new GridModelReferenceResources(
"MiniGrid-NodeBreaker-BaseCase-Complete-v3-missing-voltage-levels",
null,
new ResourceSet(base,
MINI_GRID_EQ),
new ResourceSet(MINI_GRID_NODE_BREAKER_BASE,
MINI_GRID_SSH,
MINI_GRID_SV,
MINI_GRID_TP),
new ResourceSet(MINI_GRID_NODE_BREAKER_BD_BASE, MINI_GRID_BD_EQ,
MINI_GRID_BD_TP));
}

public static GridModelReferenceResources miniGridNodeBreakerSwitchTypePreserved() {
String base = ENTSOE_CONFORMITY_1_MODIFIED
+ "/MiniGrid/NodeBreaker/BaseCase_Complete_v3_switch_type_preserved/";
Expand Down
Loading

0 comments on commit eb7fe5d

Please sign in to comment.