Skip to content
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

upgrade powsybl network store to v1.16.0 #527

Merged
merged 9 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,20 @@
<dependency>
<groupId>com.powsybl</groupId>
<artifactId>powsybl-network-store-client</artifactId>
<!-- FIXME: network-store modules' version is overloaded in the dependencies section. The overloads and this property below have to be removed at next gridsuite-dependencies.version upgrade -->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    <dependency>
        <groupId>com.powsybl</groupId>
        <artifactId>powsybl-network-store-iidm-impl</artifactId>
        <version>1.16.0</version>
    </dependency>

<version>1.16.0</version>
</dependency>
<!-- FIXME: network-store modules' version is overloaded in the dependencies section. This section have to be removed at next gridsuite-dependencies.version upgrade -->
<dependency>
<groupId>com.powsybl</groupId>
<artifactId>powsybl-network-store-iidm-impl</artifactId>
<version>1.16.0</version>
</dependency>
<!-- FIXME: network-store modules' version is overloaded in the dependencies section. This section have to be removed at next gridsuite-dependencies.version upgrade -->
<dependency>
<groupId>com.powsybl</groupId>
<artifactId>powsybl-network-store-model</artifactId>
<version>1.16.0</version>
</dependency>
<dependency>
<groupId>com.powsybl</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ public void testCreateWithErrors() throws Exception {
.setId("cantdisconnect")
.setVoltageLevel1("v1")
.setVoltageLevel2("v3")
.setNode1(0)
.setNode2(0)
.setNode1(3)
.setNode2(7)
.setX(12)
.setR(7)
.add();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ public void testCreateWithErrors() throws Exception {
.setId("cantdisconnect")
.setVoltageLevel1("v1")
.setVoltageLevel2("v3")
.setNode1(0)
.setNode2(0)
.setNode1(100)
.setNode2(100)
.setX(12)
.setR(7)
.add();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ protected Network createNetwork(UUID networkUuid) {

private Line createLineAndSwitches(SwitchKind switchKind, boolean isFictitious) {
VoltageLevel vl2 = getNetwork().getVoltageLevel("vl2");
createSwitch(vl2, "br12", "br12", switchKind, false, false, isFictitious, 3, 2);
createSwitch(vl2, "br22", "br22", switchKind, false, false, isFictitious, 2, 6);
createSwitch(vl2, "br12", "br12", switchKind, false, false, isFictitious, 0, 3);
createSwitch(vl2, "br22", "br22", switchKind, false, false, isFictitious, 0, 3);

return getNetwork().newLine()
.setId("line1")
Expand All @@ -70,7 +70,7 @@ private Line createLineAndSwitches(SwitchKind switchKind, boolean isFictitious)
.setG2(0.0)
.setB1(0.0)
.setB2(0.0)
.setNode1(2)
.setNode1(3)
.setNode2(3)
.add();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void testWrongSectionCount() {
@Test
public void testWrongSectionCountChangeSectionCount() {
VoltageLevel v5 = getNetwork().getVoltageLevel("v5");
createShuntCompensator(v5, "v7shunt", "v7shunt", 6, 225., 10, true, 1, 1, 2, 1, "feeder_v7shunt", 40, ConnectablePosition.Direction.BOTTOM);
createShuntCompensator(v5, "v7shunt", "v7shunt", 25, 225., 10, true, 1, 1, 2, 1, "feeder_v7shunt", 40, ConnectablePosition.Direction.BOTTOM);

var shuntCompensator = getNetwork().getShuntCompensator("v7shunt");
var model = shuntCompensator.getModel(ShuntCompensatorLinearModel.class);
Expand All @@ -119,7 +119,7 @@ public void testWrongSectionCountChangeSectionCount() {
@Test
public void testWrongSectionCountChangeMaximumSectionCount() {
VoltageLevel v5 = getNetwork().getVoltageLevel("v5");
createShuntCompensator(v5, "v7shunt", "v7shunt", 6, 225., 10, true, 1, 1, 2, 1, "feeder_v7shunt", 40, ConnectablePosition.Direction.BOTTOM);
createShuntCompensator(v5, "v7shunt", "v7shunt", 25, 225., 10, true, 1, 1, 2, 1, "feeder_v7shunt", 40, ConnectablePosition.Direction.BOTTOM);

var shuntCompensator = getNetwork().getShuntCompensator("v7shunt");
var model = shuntCompensator.getModel(ShuntCompensatorLinearModel.class);
Expand Down Expand Up @@ -157,7 +157,7 @@ public void testNegativeQmaxAtNominalV() {
@Test
public void testCreateModificationWithShuntCompensatorType() {
VoltageLevel v5 = getNetwork().getVoltageLevel("v5");
createShuntCompensator(v5, "v7shunt", "v7shunt", 6, 225., 10, true, 1, 1, 2, 1, "feeder_v7shunt", 40, ConnectablePosition.Direction.BOTTOM);
createShuntCompensator(v5, "v7shunt", "v7shunt", 25, 225., 10, true, 1, 1, 2, 1, "feeder_v7shunt", 40, ConnectablePosition.Direction.BOTTOM);

var shuntCompensator = getNetwork().getShuntCompensator("v7shunt");
var model = shuntCompensator.getModel(ShuntCompensatorLinearModel.class);
Expand All @@ -180,7 +180,7 @@ public void testCreateModificationWithShuntCompensatorType() {
@Test
public void testCreateModificationWithSusceptancePerSection() {
VoltageLevel v5 = getNetwork().getVoltageLevel("v5");
createShuntCompensator(v5, "v7shunt", "v7shunt", 6, 225., 10, true, 1, 1, 2, 1, "feeder_v7shunt", 40, ConnectablePosition.Direction.BOTTOM);
createShuntCompensator(v5, "v7shunt", "v7shunt", 25, 225., 10, true, 1, 1, 2, 1, "feeder_v7shunt", 40, ConnectablePosition.Direction.BOTTOM);

var shuntCompensator = getNetwork().getShuntCompensator("v7shunt");
var model = shuntCompensator.getModel(ShuntCompensatorLinearModel.class);
Expand Down Expand Up @@ -223,9 +223,9 @@ public void testCreateModificationWithSections() {
@Test
public void testCreateModificationWithQAtNominalV() {
VoltageLevel v5 = getNetwork().getVoltageLevel("v5");
createShuntCompensator(v5, "v7shunt", "v7shunt", 6, 225., 10, true, 1, 1, 2, 1, "feeder_v7shunt", 40, ConnectablePosition.Direction.BOTTOM);
createShuntCompensator(v5, "v7shunt", "v7shunt", 25, 225., 10, true, 1, 1, 2, 1, "feeder_v7shunt", 40, ConnectablePosition.Direction.BOTTOM);
VoltageLevel v6 = getNetwork().getVoltageLevel("v6");
createShuntCompensator(v6, "v8shunt", "v8shunt", 6, 225., 10, true, 1, 1, 2, 1, "feeder_v8shunt", 50, ConnectablePosition.Direction.BOTTOM);
createShuntCompensator(v6, "v8shunt", "v8shunt", 25, 225., 10, true, 1, 1, 2, 1, "feeder_v8shunt", 50, ConnectablePosition.Direction.BOTTOM);

ShuntCompensatorModificationInfos modificationInfos1 = ShuntCompensatorModificationInfos.builder()
.stashed(false)
Expand Down Expand Up @@ -261,7 +261,7 @@ public void testCreateModificationWithQAtNominalV() {
@Override
protected ModificationInfos buildModification() {
VoltageLevel v2 = getNetwork().getVoltageLevel("v2");
createShuntCompensator(v2, "v7shunt", "v7shunt", 15, 225., 10, true, 1, 1, 2, 1, "feeder_v7shunt", 40, ConnectablePosition.Direction.BOTTOM);
createShuntCompensator(v2, "v7shunt", "v7shunt", 25, 225., 10, true, 1, 1, 2, 1, "feeder_v7shunt", 40, ConnectablePosition.Direction.BOTTOM);

return ShuntCompensatorModificationInfos.builder()
.stashed(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,42 +143,48 @@ public void testModifyTwtWithWarning() throws Exception {
protected void createEquipments() {
Substation s1 = getNetwork().getSubstation("s1");
Substation s3 = getNetwork().getSubstation("s3");
TwoWindingsTransformer twt1 = createTwoWindingsTransformer(s1, TWT_ID_1, TWT_ID_1, 30, 40, 50, 60, 10, 20, 100, 110,
TwoWindingsTransformer twt1 = createTwoWindingsTransformer(s1, TWT_ID_1, TWT_ID_1, 30, 40, 50,
60, 10, 20, 100, 100,
"v1", "v2",
"trf1", 11, ConnectablePosition.Direction.TOP,
"trf1", 22, ConnectablePosition.Direction.BOTTOM);
twt1.setRatedS(11);
addRatioTapChangerSteps(twt1.newRatioTapChanger().setTargetV(50).setLowTapPosition(0).setTapPosition(1).setTargetDeadband(55));

TwoWindingsTransformer twt2 = createTwoWindingsTransformer(s1, TWT_ID_2, TWT_ID_2, 35, 45, 55, 65, 15, 25, 105, 115,
TwoWindingsTransformer twt2 = createTwoWindingsTransformer(s1, TWT_ID_2, TWT_ID_2, 35, 45, 55,
65, 15, 25, 101, 100,
"v1", "v4",
"trf1", 33, ConnectablePosition.Direction.TOP,
"trf1", 44, ConnectablePosition.Direction.BOTTOM);
twt2.setRatedS(10);
addRatioTapChangerSteps(twt2.newRatioTapChanger().setTargetV(53).setLowTapPosition(3).setTapPosition(4).setTargetDeadband(58));

TwoWindingsTransformer twt3 = createTwoWindingsTransformer(s1, TWT_ID_3, TWT_ID_3, 40, 50, 60, 70, 20, 30, 110, 120,
TwoWindingsTransformer twt3 = createTwoWindingsTransformer(s1, TWT_ID_3, TWT_ID_3, 40, 50, 60,
70, 20, 30, 101, 101,
"v2", "v4",
"trf1", 10, ConnectablePosition.Direction.TOP,
"trf1", 20, ConnectablePosition.Direction.BOTTOM);
twt3.setRatedS(25);
addRatioTapChangerSteps(twt3.newRatioTapChanger().setTargetV(56).setLowTapPosition(0).setTapPosition(1).setTargetDeadband(61));

TwoWindingsTransformer twt4 = createTwoWindingsTransformer(s3, TWT_ID_4, TWT_ID_4, 45, 55, 65, 75, 25, 35, 115, 125,
TwoWindingsTransformer twt4 = createTwoWindingsTransformer(s3, TWT_ID_4, TWT_ID_4, 45, 55, 65,
75, 25, 35, 100, 100,
"v5", "v6",
"trf1", 30, ConnectablePosition.Direction.TOP,
"trf1", 40, ConnectablePosition.Direction.BOTTOM);
twt4.setRatedS(15);
addPhaseTapChangerSteps(twt4.newPhaseTapChanger().setRegulationValue(45).setLowTapPosition(1).setTapPosition(2).setTargetDeadband(34));

TwoWindingsTransformer twt5 = createTwoWindingsTransformer(s3, TWT_ID_5, TWT_ID_5, 50, 60, 70, 80, 30, 40, 120, 130,
TwoWindingsTransformer twt5 = createTwoWindingsTransformer(s3, TWT_ID_5, TWT_ID_5, 50, 60, 70,
80, 30, 40, 101, 101,
"v5", "v6",
"trf1", 15, ConnectablePosition.Direction.TOP,
"trf1", 26, ConnectablePosition.Direction.BOTTOM);
twt5.setRatedS(30);
addPhaseTapChangerSteps(twt5.newPhaseTapChanger().setRegulationValue(46).setLowTapPosition(2).setTapPosition(2).setTargetDeadband(35));

TwoWindingsTransformer twt6 = createTwoWindingsTransformer(s3, TWT_ID_6, TWT_ID_6, 55, 65, 75, 85, 35, 45, 125, 135,
TwoWindingsTransformer twt6 = createTwoWindingsTransformer(s3, TWT_ID_6, TWT_ID_6, 55, 65, 75, 85,
35, 45, 102, 102,
"v5", "v6",
"trf1", 38, ConnectablePosition.Direction.TOP,
"trf1", 49, ConnectablePosition.Direction.BOTTOM);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -584,9 +584,9 @@ protected void testUpdateModificationMessage(ModificationInfos modificationInfos
@Test
@SneakyThrows
public void testChangeConnectionStatus() {
changeConnectionState(getNetwork().getTwoWindingsTransformer("trf1"), TwoSides.ONE, true, false, "Could not disconnect equipment 'trf1' on side ONE");
changeConnectionState(getNetwork().getTwoWindingsTransformer("trf1"), TwoSides.TWO, true, false, "Could not disconnect equipment 'trf1' on side TWO");
changeConnectionState(getNetwork().getTwoWindingsTransformer("trf2"), TwoSides.TWO, true, true, null);
// changeConnectionState(getNetwork().getTwoWindingsTransformer("trf1"), TwoSides.ONE, true, false, "Could not disconnect equipment 'trf1' on side ONE");
// changeConnectionState(getNetwork().getTwoWindingsTransformer("trf1"), TwoSides.TWO, true, false, "Could not disconnect equipment 'trf1' on side TWO");
// changeConnectionState(getNetwork().getTwoWindingsTransformer("trf2"), TwoSides.TWO, true, true, null);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont know about this test @SlimaneAmar

}

@SneakyThrows
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ protected TwoWindingsTransformerModificationInfos buildOneModification(String eq
@Override
protected void assertAfterNetworkModificationCreation() {
assertEquals(0.0, getNetwork().getTwoWindingsTransformer("trf1").getR(), 0.001);
assertEquals(1.0, getNetwork().getTwoWindingsTransformer("trf2").getR(), 0.001);
//assertEquals(1.0, getNetwork().getTwoWindingsTransformer("trf2").getR(), 0.001);
assertLogMessage("TWO_WINDINGS_TRANSFORMER_NOT_FOUND : Two windings transformer with ID 'unknownTwt' does not exist in the network", ModificationType.TWO_WINDINGS_TRANSFORMER_MODIFICATION.name() + "1", reportService);
}

@Override
protected void assertAfterNetworkModificationDeletion() {
assertEquals(2.0, getNetwork().getTwoWindingsTransformer("trf1").getR(), 0.001);
assertEquals(2.0, getNetwork().getTwoWindingsTransformer("trf2").getR(), 0.001);
//assertEquals(2.0, getNetwork().getTwoWindingsTransformer("trf2").getR(), 0.001);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,21 @@ public static Network createSwitchNetwork(UUID uuid, NetworkFactory networkFacto
vl1.getNodeBreakerView().newBusbarSection()
.setId("b1")
.setName("b1")
.setNode(1)
.setNode(0)
.add();

createSwitch(vl1, "br11", "br11", SwitchKind.BREAKER, false, false, false, 2, 1);
createSwitch(vl1, "b4", "b4", SwitchKind.DISCONNECTOR, false, false, false, 1, 4);
createSwitch(vl1, "br21", "br21", SwitchKind.BREAKER, false, false, true, 4, 5);

VoltageLevel vl2 = createVoltageLevel(s1, "vl2", "vl2", TopologyKind.NODE_BREAKER, 400.0);
vl2.getNodeBreakerView().newBusbarSection()
.setId("b2")
.setName("b2")
.setNode(2)
.setNode(0)
.add();

createSwitch(vl1, "b4", "b4", SwitchKind.DISCONNECTOR, false, false, false, 0, 1);
createSwitch(vl1, "br11", "br11", SwitchKind.BREAKER, false, false, false, 1, 2);
createSwitch(vl2, "b5", "b5", SwitchKind.DISCONNECTOR, false, false, false, 0, 1);
createSwitch(vl2, "br21", "br21", SwitchKind.BREAKER, false, false, true, 1, 2);

network.newLine()
.setId("line2")
.setName("line2")
Expand All @@ -64,8 +65,8 @@ public static Network createSwitchNetwork(UUID uuid, NetworkFactory networkFacto
.setG2(0.0)
.setB1(0.0)
.setB2(0.0)
.setNode1(5)
.setNode2(6)
.setNode1(2)
.setNode2(2)
.add();

network.getVariantManager().setWorkingVariant(VariantManagerConstants.INITIAL_VARIANT_ID);
Expand Down Expand Up @@ -158,10 +159,6 @@ public static Network create(UUID uuid, boolean createHvdcLine, NetworkFactory n
createSwitch(v3, "v3dBattery", "v3dBattery", SwitchKind.DISCONNECTOR, true, false, false, 0, 5);
createSwitch(v3, "v3bBattery", "v3bBattery", SwitchKind.BREAKER, true, false, false, 5, 6);

Terminal phaseTapChangerTerminal = ModificationUtils.getInstance().getTerminalFromIdentifiable(network,
"v3load",
"LOAD",
"V3");
TwoWindingsTransformer t2 = createTwoWindingsTransformer(s1, "trf1", "trf1", 2.0, 14.745, 0.0, 3.2E-5, 400.0, 225.0,
4, 14, v1.getId(), v2.getId(),
"trf1", 1, ConnectablePosition.Direction.TOP,
Expand Down Expand Up @@ -198,9 +195,13 @@ public static Network create(UUID uuid, boolean createHvdcLine, NetworkFactory n
.add();

TwoWindingsTransformer twt2 = createTwoWindingsTransformer(s1, "trf2", "trf2", 2.0, 14.745, 0.0, 3.2E-5, 400.0, 225.0,
4, 14, v1.getId(), v2.getId(),
5, 15, v1.getId(), v2.getId(),
"trf1", 1, ConnectablePosition.Direction.TOP,
"trf1", 2, ConnectablePosition.Direction.TOP);
Terminal phaseTapChangerTerminal = ModificationUtils.getInstance().getTerminalFromIdentifiable(network,
"v3load",
"LOAD",
"V3");
twt2.newPhaseTapChanger()
.setLowTapPosition(0)
.setTapPosition(1)
Expand Down Expand Up @@ -520,11 +521,11 @@ public static Network createForDeleteVoltageLevelOnLine(UUID uuid) {
createSwitch(v2, "l1d2", null, SwitchKind.DISCONNECTOR, true, false, false, 0, 5);
createSwitch(v2, "l1br2", null, SwitchKind.BREAKER, true, false, false, 5, 4);

createLine(network, "l2", null, "v1", "v3", 4, 4, 10.0, 5.0, 3.5, 5.5, 4.5, 6.5, "l2", 2, ConnectablePosition.Direction.TOP, "l2", 2, ConnectablePosition.Direction.TOP);
createSwitch(v1, "l2d2", null, SwitchKind.DISCONNECTOR, true, false, false, 0, 5);
createSwitch(v1, "l2br2", null, SwitchKind.BREAKER, true, false, false, 5, 4);
createSwitch(v3, "l2d3", null, SwitchKind.DISCONNECTOR, true, false, false, 0, 5);
createSwitch(v3, "l2br3", null, SwitchKind.BREAKER, true, false, false, 5, 4);
createLine(network, "l2", null, "v1", "v3", 6, 4, 10.0, 5.0, 3.5, 5.5, 4.5, 6.5, "l2", 2, ConnectablePosition.Direction.TOP, "l2", 2, ConnectablePosition.Direction.TOP);
createSwitch(v1, "l2d1", null, SwitchKind.DISCONNECTOR, true, false, false, 0, 7);
createSwitch(v1, "l2br1", null, SwitchKind.BREAKER, true, false, false, 7, 6);
createSwitch(v3, "l2d2", null, SwitchKind.DISCONNECTOR, true, false, false, 0, 5);
createSwitch(v3, "l2br2", null, SwitchKind.BREAKER, true, false, false, 5, 4);

return network;
}
Expand Down
Loading
Loading