Skip to content

Commit

Permalink
Replace testing of switch without name with a simple network instead …
Browse files Browse the repository at this point in the history
…of a modified conformity file

Signed-off-by: Romain Courtier <[email protected]>
  • Loading branch information
rcourtier committed Oct 15, 2024
1 parent 5db3d9c commit 2964b1c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1356,20 +1356,6 @@ public static GridModelReference microGridBaseCaseNLShuntCompensatorGP() {
microGridBaseCaseBoundaries());
}

public static GridModelReference microGridBaseCaseNLSwitchWithoutName() {
String base = ENTSOE_CONFORMITY_1_MODIFIED
+ "/MicroGrid/BaseCase/BC_NL_v2_switch_without_name/";
String baseOriginal = ENTSOE_CONFORMITY_1
+ MICROGRID_CONFIGURATION;
return new GridModelReferenceResources(
"MicroGrid-BaseCase-NL-switch-no-name",
null,
new ResourceSet(base, MICRO_GRID_NL_EQ),
new ResourceSet(baseOriginal, MICRO_GRID_NL_SSH,
MICRO_GRID_NL_TP),
microGridBaseCaseBoundaries());
}

public static GridModelReference microGridBaseCaseNLSwitchTypePreserved() {
String base = ENTSOE_CONFORMITY_1_MODIFIED
+ "/MicroGrid/BaseCase/BC_NL_v2_switch_type_preserved/";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,18 @@ void lineWithZeroImpedanceTest() {
@Test
void switchKindTest() {
// CGMES network:
// One LoadBreakSwitch and one generic Switch.
// A LoadBreakSwitch, a generic Switch, and a Disconnector without name.
// IIDM network:
// The switch kind is preserved. A generic CGMES switch is considered of kind breaker.
Network network = readCgmesResources(DIR, "switch_kind.xml");
assertNotNull(network);

// Check that the switch kind has been preserved.
assertNotNull(network.getSwitch("LBS"));
assertEquals(SwitchKind.LOAD_BREAK_SWITCH, network.getSwitch("LBS").getKind());
assertNotNull(network.getSwitch("SW"));
assertEquals(SwitchKind.BREAKER, network.getSwitch("SW").getKind());
assertEquals(SwitchKind.DISCONNECTOR, network.getSwitch("DIS").getKind());

// Disconnector has no name, so getNameOrId() returns its id
assertEquals("DIS", network.getSwitch("DIS").getNameOrId());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -914,12 +914,6 @@ void microGridBaseCaseNLShuntCompensatorGP() {
assertEquals(0.123, network.getShuntCompensator("fbfed7e3-3dec-4829-a286-029e73535685").getTerminal().getP(), 0.0);
}

@Test
void microGridBaseCaseNLSwitchWithoutName() {
Network network = Importers.importData("CGMES", CgmesConformity1ModifiedCatalog.microGridBaseCaseNLSwitchWithoutName().dataSource(), importParams);
assertNotNull(network.getSwitch("5f5d40ae-d52d-4631-9285-b3ceefff784c"));
}

@Test
void microGridBaseCaseBESingleFile() {
Network network = Importers.importData("CGMES", CgmesConformity1ModifiedCatalog.microGridBaseCaseBESingleFile().dataSource(), importParams);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,25 @@
<cim:Terminal.ConductingEquipment rdf:resource="#_SW"/>
<cim:Terminal.ConnectivityNode rdf:resource="#_CN_2"/>
</cim:Terminal>
<cim:Disconnector rdf:ID="_DIS">
<!-- cim:IdentifiedObject.name>Disconnector</cim:IdentifiedObject.name -->
<cim:Equipment.EquipmentContainer rdf:resource="#_VL"/>
<cim:ConductingEquipment.BaseVoltage rdf:resource="#_BV"/>
<cim:Switch.normalOpen>false</cim:Switch.normalOpen>
<cim:Switch.retained>false</cim:Switch.retained>
</cim:Disconnector>
<cim:Terminal rdf:ID="_T_DIS_1">
<cim:IdentifiedObject.name>Terminal DIS 1</cim:IdentifiedObject.name>
<cim:ACDCTerminal.sequenceNumber>1</cim:ACDCTerminal.sequenceNumber>
<cim:Terminal.ConductingEquipment rdf:resource="#_DIS"/>
<cim:Terminal.ConnectivityNode rdf:resource="#_CN_1"/>
</cim:Terminal>
<cim:Terminal rdf:ID="_T_DIS_2">
<cim:IdentifiedObject.name>Terminal DIS 2</cim:IdentifiedObject.name>
<cim:ACDCTerminal.sequenceNumber>2</cim:ACDCTerminal.sequenceNumber>
<cim:Terminal.ConductingEquipment rdf:resource="#_DIS"/>
<cim:Terminal.ConnectivityNode rdf:resource="#_CN_2"/>
</cim:Terminal>
<cim:BaseVoltage rdf:ID="_BV">
<cim:IdentifiedObject.name>110 kV</cim:IdentifiedObject.name>
<cim:BaseVoltage.nominalVoltage>110</cim:BaseVoltage.nominalVoltage>
Expand Down

0 comments on commit 2964b1c

Please sign in to comment.