From 91a28f83dea78375418a38326a85bdae490a605b Mon Sep 17 00:00:00 2001 From: Etienne Homer Date: Fri, 23 Aug 2024 13:54:34 +0200 Subject: [PATCH 1/4] Override network store version to v1.15.0 Signed-off-by: Etienne Homer --- pom.xml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pom.xml b/pom.xml index e59d6fe8..ec4fce98 100644 --- a/pom.xml +++ b/pom.xml @@ -51,6 +51,8 @@ 1.0 2.12.0 + + 1.15.0 @@ -75,6 +77,24 @@ + + + com.powsybl + powsybl-network-store-iidm-impl + ${powsybl-network-store.version} + + + + com.powsybl + powsybl-network-store-client + ${powsybl-network-store.version} + + + + com.powsybl + powsybl-network-store-model + ${powsybl-network-store.version} + From 8c51a1e2aaec8afec964fea5995433e2ec0484f0 Mon Sep 17 00:00:00 2001 From: Etienne Homer Date: Fri, 23 Aug 2024 15:35:33 +0200 Subject: [PATCH 2/4] Fix nodes in CaseFactory + fix tests Signed-off-by: Etienne Homer --- .../integration/NetworkStorageTestCaseFactory.java | 10 +++++----- .../network/store/integration/NetworkStoreIT.java | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/network-store-integration-test/src/test/java/com/powsybl/network/store/integration/NetworkStorageTestCaseFactory.java b/network-store-integration-test/src/test/java/com/powsybl/network/store/integration/NetworkStorageTestCaseFactory.java index 6840fe54..b114b5b9 100644 --- a/network-store-integration-test/src/test/java/com/powsybl/network/store/integration/NetworkStorageTestCaseFactory.java +++ b/network-store-integration-test/src/test/java/com/powsybl/network/store/integration/NetworkStorageTestCaseFactory.java @@ -223,8 +223,8 @@ public static Network create(NetworkFactory networkFactory) { .setId("LINE1") .setVoltageLevel1("VL1") .setVoltageLevel2("VL2") - .setNode1(1) - .setNode2(2) + .setNode1(4) + .setNode2(3) .setR(50) .setX(20) .setG1(12) @@ -314,7 +314,7 @@ public static Network create(NetworkFactory networkFactory) { .setRatedU0(234) .newLeg1() .setVoltageLevel("VL2") - .setNode(1) + .setNode(4) .setR(45) .setX(35) .setG(25) @@ -480,7 +480,7 @@ public static Network create(NetworkFactory networkFactory) { ShuntCompensator shunt2 = vl2.newShuntCompensator() .setId("SHUNT2") - .setNode(3) + .setNode(5) .setVoltageRegulatorOn(false) .setTargetDeadband(20) .setTargetV(420) @@ -504,7 +504,7 @@ public static Network create(NetworkFactory networkFactory) { Battery battery = vl1.newBattery() .setId("battery") - .setNode(4) + .setNode(5) .setTargetP(50) .setTargetQ(10) .setMinP(40) diff --git a/network-store-integration-test/src/test/java/com/powsybl/network/store/integration/NetworkStoreIT.java b/network-store-integration-test/src/test/java/com/powsybl/network/store/integration/NetworkStoreIT.java index 54d05723..9f8b0369 100644 --- a/network-store-integration-test/src/test/java/com/powsybl/network/store/integration/NetworkStoreIT.java +++ b/network-store-integration-test/src/test/java/com/powsybl/network/store/integration/NetworkStoreIT.java @@ -190,7 +190,7 @@ public void visitGenerator(Generator generator) { VoltageLevel voltageLevel1 = network.getVoltageLevel("n1_voltageLevel1"); assertEquals(6, voltageLevel1.getNodeBreakerView().getMaximumNodeIndex()); - assertArrayEquals(new int[] {5, 2, 0, 1, 3, 6}, voltageLevel1.getNodeBreakerView().getNodes()); + assertArrayEquals(new int[] {0, 1, 2, 3, 5, 6}, voltageLevel1.getNodeBreakerView().getNodes()); assertNotNull(voltageLevel1.getNodeBreakerView().getTerminal(2)); assertNull(voltageLevel1.getNodeBreakerView().getTerminal(4)); List traversedNodes = new ArrayList<>(); @@ -1358,7 +1358,7 @@ public void threeWindingsTransformerTest() { assertEquals(28, threeWindingsTransformer.getTerminal(ThreeSides.TWO).getQ(), 0.1); assertEquals(18, threeWindingsTransformer.getTerminal(ThreeSides.THREE).getQ(), 0.1); - assertEquals(1, threeWindingsTransformer.getTerminal(ThreeSides.ONE).getNodeBreakerView().getNode()); + assertEquals(4, threeWindingsTransformer.getTerminal(ThreeSides.ONE).getNodeBreakerView().getNode()); assertEquals(2, threeWindingsTransformer.getTerminal(ThreeSides.TWO).getNodeBreakerView().getNode()); assertEquals(3, threeWindingsTransformer.getTerminal(ThreeSides.THREE).getNodeBreakerView().getNode()); @@ -2560,8 +2560,8 @@ public void configuredBusTest() { assertEquals("networkTestCase", readNetwork.getId()); - assertEquals(13, readNetwork.getBusBreakerView().getBusStream().collect(Collectors.toList()).size()); - assertEquals(2, readNetwork.getBusBreakerView().getBusStream().filter(b -> b instanceof ConfiguredBusImpl).count()); + assertEquals(16, readNetwork.getBusBreakerView().getBusStream().collect(Collectors.toList()).size()); + assertEquals(2,readNetwork.getBusBreakerView().getBusStream().filter(b -> b instanceof ConfiguredBusImpl).count()); Bus bus1 = readNetwork.getBusBreakerView().getBus("BUS5"); Bus bus2 = readNetwork.getBusBreakerView().getBus("BUS6"); From 0d094b06d78dc530558003c81be0889e4760ac51 Mon Sep 17 00:00:00 2001 From: Etienne Homer Date: Fri, 23 Aug 2024 15:41:43 +0200 Subject: [PATCH 3/4] Fix checkstyle Signed-off-by: Etienne Homer --- .../com/powsybl/network/store/integration/NetworkStoreIT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network-store-integration-test/src/test/java/com/powsybl/network/store/integration/NetworkStoreIT.java b/network-store-integration-test/src/test/java/com/powsybl/network/store/integration/NetworkStoreIT.java index 9f8b0369..2f15878b 100644 --- a/network-store-integration-test/src/test/java/com/powsybl/network/store/integration/NetworkStoreIT.java +++ b/network-store-integration-test/src/test/java/com/powsybl/network/store/integration/NetworkStoreIT.java @@ -2561,7 +2561,7 @@ public void configuredBusTest() { assertEquals("networkTestCase", readNetwork.getId()); assertEquals(16, readNetwork.getBusBreakerView().getBusStream().collect(Collectors.toList()).size()); - assertEquals(2,readNetwork.getBusBreakerView().getBusStream().filter(b -> b instanceof ConfiguredBusImpl).count()); + assertEquals(2, readNetwork.getBusBreakerView().getBusStream().filter(b -> b instanceof ConfiguredBusImpl).count()); Bus bus1 = readNetwork.getBusBreakerView().getBus("BUS5"); Bus bus2 = readNetwork.getBusBreakerView().getBus("BUS6"); From 137f01ed3d36f254029a4ad06ea3fdf084ffafc6 Mon Sep 17 00:00:00 2001 From: Etienne Homer Date: Fri, 23 Aug 2024 16:22:23 +0200 Subject: [PATCH 4/4] Fix test Signed-off-by: Etienne Homer --- .../network/store/integration/NetworkStoreExtensionsIT.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/network-store-integration-test/src/test/java/com/powsybl/network/store/integration/NetworkStoreExtensionsIT.java b/network-store-integration-test/src/test/java/com/powsybl/network/store/integration/NetworkStoreExtensionsIT.java index 5f7430d0..ee46ce7c 100644 --- a/network-store-integration-test/src/test/java/com/powsybl/network/store/integration/NetworkStoreExtensionsIT.java +++ b/network-store-integration-test/src/test/java/com/powsybl/network/store/integration/NetworkStoreExtensionsIT.java @@ -451,9 +451,9 @@ private Network createExtensionsNetwork(NetworkFactory networkFactory) { assertEquals(ConnectablePosition.Direction.TOP, cptwt2.getFeeder2().getDirection()); ThreeWindingsTransformer twt3 = s1.newThreeWindingsTransformer().setId("TWT3") - .setName("Three windings transformer 1").setRatedU0(234).newLeg1().setVoltageLevel("v1").setNode(1) - .setR(45).setX(35).setG(25).setB(15).setRatedU(5).add().newLeg2().setVoltageLevel("v2").setNode(1) - .setR(47).setX(37).setG(27).setB(17).setRatedU(7).add().newLeg3().setVoltageLevel("v3").setNode(1) + .setName("Three windings transformer 1").setRatedU0(234).newLeg1().setVoltageLevel("v1").setNode(3) + .setR(45).setX(35).setG(25).setB(15).setRatedU(5).add().newLeg2().setVoltageLevel("v2").setNode(2) + .setR(47).setX(37).setG(27).setB(17).setRatedU(7).add().newLeg3().setVoltageLevel("v3").setNode(2) .setR(49).setX(39).setG(29).setB(19).setRatedU(9).add().add(); twt3.newExtension(ConnectablePositionAdder.class).newFeeder1().withName("twt3.1").withOrder(3) .withDirection(ConnectablePosition.Direction.BOTTOM).add().newFeeder2().withName("twt3.2").withOrder(3)