From fea64b94be5a90fa3bdeb09c2ab709cf4b40725e Mon Sep 17 00:00:00 2001 From: SCHWITZGUEBEL Marc Ext Date: Mon, 8 Apr 2024 13:55:08 +0200 Subject: [PATCH 1/6] upgrade open loadflow 1.8.2 --- pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 84d092c9..6b483883 100644 --- a/pom.xml +++ b/pom.xml @@ -50,10 +50,10 @@ 3.0.0 - 1.27.0 - 4.15.0 - 1.21.0 - 1.21.0 + 1.27.2 + 4.15.2 + 1.21.1 + 1.26.0 1.1.0 From 51f18c979861aad6a5b9da5d464cf0a3ff13758c Mon Sep 17 00:00:00 2001 From: schwitzguebel Date: Mon, 8 Apr 2024 12:05:51 +0000 Subject: [PATCH 2/6] Prepare release 1.25.1 --- cse-cc-export-runner-app/pom.xml | 2 +- cse-cc-import-runner-app/pom.xml | 2 +- cse-lib/computation/pom.xml | 4 ++-- cse-lib/data/pom.xml | 4 ++-- cse-lib/network-processing/pom.xml | 2 +- cse-lib/pom.xml | 2 +- cse-runner-api/pom.xml | 2 +- cse-runner-spring-boot-starter/pom.xml | 2 +- pom.xml | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cse-cc-export-runner-app/pom.xml b/cse-cc-export-runner-app/pom.xml index 2d2c1711..1b406fc4 100644 --- a/cse-cc-export-runner-app/pom.xml +++ b/cse-cc-export-runner-app/pom.xml @@ -5,7 +5,7 @@ gridcapa-cse com.farao-community.farao - 1.25.0 + 1.25.1 4.0.0 diff --git a/cse-cc-import-runner-app/pom.xml b/cse-cc-import-runner-app/pom.xml index 4287b2c7..3f700ae2 100644 --- a/cse-cc-import-runner-app/pom.xml +++ b/cse-cc-import-runner-app/pom.xml @@ -5,7 +5,7 @@ gridcapa-cse com.farao-community.farao - 1.25.0 + 1.25.1 4.0.0 diff --git a/cse-lib/computation/pom.xml b/cse-lib/computation/pom.xml index 43342cf0..44114d4d 100644 --- a/cse-lib/computation/pom.xml +++ b/cse-lib/computation/pom.xml @@ -14,12 +14,12 @@ gridcapa-cse-lib com.farao-community.farao - 1.25.0 + 1.25.1 4.0.0 gridcapa-cse-computation - 1.25.0 + 1.25.1 jar Common CSE computation utilities Module that manages common computation for CSE processes diff --git a/cse-lib/data/pom.xml b/cse-lib/data/pom.xml index 66fb4ac8..43aa2f40 100644 --- a/cse-lib/data/pom.xml +++ b/cse-lib/data/pom.xml @@ -7,11 +7,11 @@ gridcapa-cse-lib com.farao-community.farao - 1.25.0 + 1.25.1 gridcapa-cse-data - 1.25.0 + 1.25.1 jar Common CSE data management Module that manages specific data format for CSE processes diff --git a/cse-lib/network-processing/pom.xml b/cse-lib/network-processing/pom.xml index 9c48ab76..be74d986 100644 --- a/cse-lib/network-processing/pom.xml +++ b/cse-lib/network-processing/pom.xml @@ -7,7 +7,7 @@ gridcapa-cse-lib com.farao-community.farao - 1.25.0 + 1.25.1 gridcapa-cse-network-processing diff --git a/cse-lib/pom.xml b/cse-lib/pom.xml index ad55bf0b..0fe0fcaf 100644 --- a/cse-lib/pom.xml +++ b/cse-lib/pom.xml @@ -5,7 +5,7 @@ gridcapa-cse com.farao-community.farao - 1.25.0 + 1.25.1 4.0.0 diff --git a/cse-runner-api/pom.xml b/cse-runner-api/pom.xml index 95e67e71..13420e83 100644 --- a/cse-runner-api/pom.xml +++ b/cse-runner-api/pom.xml @@ -7,7 +7,7 @@ com.farao-community.farao gridcapa-cse - 1.25.0 + 1.25.1 gridcapa-cse-runner-api diff --git a/cse-runner-spring-boot-starter/pom.xml b/cse-runner-spring-boot-starter/pom.xml index 598287ed..e1012107 100644 --- a/cse-runner-spring-boot-starter/pom.xml +++ b/cse-runner-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ gridcapa-cse com.farao-community.farao - 1.25.0 + 1.25.1 4.0.0 diff --git a/pom.xml b/pom.xml index 6b483883..1f7e6ff2 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ gridcapa-cse - 1.25.0 + 1.25.1 pom GridCapa CSE From 4d7220ff08469bfd72b05d3c2ba020f4b3c83e77 Mon Sep 17 00:00:00 2001 From: SCHWITZGUEBEL Marc Ext Date: Wed, 24 Apr 2024 11:01:04 +0200 Subject: [PATCH 3/6] Change initial shift to use same glsk logic as dichotomy --- .../app/dichotomy/ZonalScalableProvider.java | 4 ++-- .../app/services/InitialShiftService.java | 19 +++++++++++++++---- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/cse-cc-import-runner-app/src/main/java/com/farao_community/farao/cse/import_runner/app/dichotomy/ZonalScalableProvider.java b/cse-cc-import-runner-app/src/main/java/com/farao_community/farao/cse/import_runner/app/dichotomy/ZonalScalableProvider.java index 7e653e40..24f404c7 100644 --- a/cse-cc-import-runner-app/src/main/java/com/farao_community/farao/cse/import_runner/app/dichotomy/ZonalScalableProvider.java +++ b/cse-cc-import-runner-app/src/main/java/com/farao_community/farao/cse/import_runner/app/dichotomy/ZonalScalableProvider.java @@ -60,7 +60,7 @@ private static void stackScalableOnLoads(Network network, ZonalData zo private static double getZoneSumOfActiveLoads(Network network, CseCountry cseCountry) { return network.getLoadStream() .filter(load -> isLoadCorrespondingToTheCountry(load, cseCountry)) - .map(Load::getP0) + .map(Load::getP0).map(Math::abs) .reduce(0., Double::sum); } @@ -79,7 +79,7 @@ private static Scalable getStackedScalable(CseCountry cseCountry, Scalable scala network.getLoadStream() .filter(load -> isLoadCorrespondingToTheCountry(load, cseCountry)) .forEach(load -> { - percentageList.add((load.getP0() / sum) * 100); + percentageList.add(Math.abs(load.getP0() / sum) * 100); scalableList.add(Scalable.onLoad(load.getId())); }); diff --git a/cse-cc-import-runner-app/src/main/java/com/farao_community/farao/cse/import_runner/app/services/InitialShiftService.java b/cse-cc-import-runner-app/src/main/java/com/farao_community/farao/cse/import_runner/app/services/InitialShiftService.java index 663acafb..e46f5594 100644 --- a/cse-cc-import-runner-app/src/main/java/com/farao_community/farao/cse/import_runner/app/services/InitialShiftService.java +++ b/cse-cc-import-runner-app/src/main/java/com/farao_community/farao/cse/import_runner/app/services/InitialShiftService.java @@ -1,5 +1,7 @@ package com.farao_community.farao.cse.import_runner.app.services; +import com.farao_community.farao.cse.import_runner.app.dichotomy.ZonalScalableProvider; +import com.farao_community.farao.cse.runner.api.resource.ProcessType; import com.powsybl.openrao.commons.EICode; import com.farao_community.farao.cse.computation.BorderExchanges; import com.farao_community.farao.cse.import_runner.app.CseData; @@ -17,6 +19,7 @@ import org.slf4j.Logger; import org.springframework.stereotype.Service; +import java.io.IOException; import java.security.SecureRandom; import java.util.HashMap; import java.util.Map; @@ -29,16 +32,18 @@ public class InitialShiftService { private final FileExporter fileExporter; private final FileImporter fileImporter; private final ProcessConfiguration processConfiguration; + private final ZonalScalableProvider zonalScalableProvider; private static final Set BORDER_COUNTRIES = Set.of(CseCountry.FR.getEiCode(), CseCountry.CH.getEiCode(), CseCountry.AT.getEiCode(), CseCountry.SI.getEiCode()); - public InitialShiftService(Logger businessLogger, FileExporter fileExporter, FileImporter fileImporter, ProcessConfiguration processConfiguration) { + public InitialShiftService(ZonalScalableProvider zonalScalableProvider, Logger businessLogger, FileExporter fileExporter, FileImporter fileImporter, ProcessConfiguration processConfiguration) { this.businessLogger = businessLogger; this.fileExporter = fileExporter; this.fileImporter = fileImporter; this.processConfiguration = processConfiguration; + this.zonalScalableProvider = zonalScalableProvider; } - void performInitialShiftFromVulcanusLevelToNtcLevel(Network network, CseData cseData, CseRequest cseRequest, Map referenceExchanges, Map ntcsByEic) { + void performInitialShiftFromVulcanusLevelToNtcLevel(Network network, CseData cseData, CseRequest cseRequest, Map referenceExchanges, Map ntcsByEic) throws IOException { Map preprocessedNetworkNps = BorderExchanges.computeCseCountriesBalances(network); for (Map.Entry entry : preprocessedNetworkNps.entrySet()) { businessLogger.info("Summary : Net positions on preprocessed network : for area {} : net position is {}.", entry.getKey(), entry.getValue()); @@ -81,8 +86,8 @@ public Map getInitialShiftValues(CseData cseData, Map scalingValuesByCountry, CseRequest cseRequest, Network network) { - ZonalData zonalScalable = GlskDocumentImporters.importGlsk(fileImporter.openUrlStream(cseRequest.getMergedGlskUrl())).getZonalScalable(network); + private void shiftNetwork(Map scalingValuesByCountry, CseRequest cseRequest, Network network) throws IOException { + ZonalData zonalScalable = getZonalScalableForProcess(cseRequest, network); String initialVariantId = network.getVariantManager().getWorkingVariantId(); // SecureRandom used to be compliant with sonar String newVariant = "temporary-working-variant" + new SecureRandom().nextInt(100) + initialVariantId; @@ -112,4 +117,10 @@ private void shiftNetwork(Map scalingValuesByCountry, CseRequest } } + + private ZonalData getZonalScalableForProcess(CseRequest cseRequest, Network network) throws IOException { + return cseRequest.getProcessType().equals(ProcessType.D2CC) ? + zonalScalableProvider.get(cseRequest.getMergedGlskUrl(), network, ProcessType.D2CC) : + GlskDocumentImporters.importGlsk(fileImporter.openUrlStream(cseRequest.getMergedGlskUrl())).getZonalScalable(network); + } } From ca141ae25f75da603925a0e4b7373920a4cc55a1 Mon Sep 17 00:00:00 2001 From: SCHWITZGUEBEL Marc Ext Date: Thu, 25 Apr 2024 14:36:38 +0200 Subject: [PATCH 4/6] Change initial shift to use same glsk logic as dichotomy, with review taken into account --- .../cse/import_runner/app/dichotomy/ZonalScalableProvider.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cse-cc-import-runner-app/src/main/java/com/farao_community/farao/cse/import_runner/app/dichotomy/ZonalScalableProvider.java b/cse-cc-import-runner-app/src/main/java/com/farao_community/farao/cse/import_runner/app/dichotomy/ZonalScalableProvider.java index 24f404c7..8687502f 100644 --- a/cse-cc-import-runner-app/src/main/java/com/farao_community/farao/cse/import_runner/app/dichotomy/ZonalScalableProvider.java +++ b/cse-cc-import-runner-app/src/main/java/com/farao_community/farao/cse/import_runner/app/dichotomy/ZonalScalableProvider.java @@ -60,7 +60,8 @@ private static void stackScalableOnLoads(Network network, ZonalData zo private static double getZoneSumOfActiveLoads(Network network, CseCountry cseCountry) { return network.getLoadStream() .filter(load -> isLoadCorrespondingToTheCountry(load, cseCountry)) - .map(Load::getP0).map(Math::abs) + .map(Load::getP0) + .map(Math::abs) .reduce(0., Double::sum); } From b7441b875d7470f5213e92e1bca6a0e01d207489 Mon Sep 17 00:00:00 2001 From: schwitzguebel Date: Mon, 29 Apr 2024 14:09:08 +0000 Subject: [PATCH 5/6] Prepare release 1.25.2 --- cse-cc-export-runner-app/pom.xml | 2 +- cse-cc-import-runner-app/pom.xml | 2 +- cse-lib/computation/pom.xml | 4 ++-- cse-lib/data/pom.xml | 4 ++-- cse-lib/network-processing/pom.xml | 2 +- cse-lib/pom.xml | 2 +- cse-runner-api/pom.xml | 2 +- cse-runner-spring-boot-starter/pom.xml | 2 +- pom.xml | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cse-cc-export-runner-app/pom.xml b/cse-cc-export-runner-app/pom.xml index 1b406fc4..02043d42 100644 --- a/cse-cc-export-runner-app/pom.xml +++ b/cse-cc-export-runner-app/pom.xml @@ -5,7 +5,7 @@ gridcapa-cse com.farao-community.farao - 1.25.1 + 1.25.2 4.0.0 diff --git a/cse-cc-import-runner-app/pom.xml b/cse-cc-import-runner-app/pom.xml index 3f700ae2..bfae51ff 100644 --- a/cse-cc-import-runner-app/pom.xml +++ b/cse-cc-import-runner-app/pom.xml @@ -5,7 +5,7 @@ gridcapa-cse com.farao-community.farao - 1.25.1 + 1.25.2 4.0.0 diff --git a/cse-lib/computation/pom.xml b/cse-lib/computation/pom.xml index 44114d4d..76cd70eb 100644 --- a/cse-lib/computation/pom.xml +++ b/cse-lib/computation/pom.xml @@ -14,12 +14,12 @@ gridcapa-cse-lib com.farao-community.farao - 1.25.1 + 1.25.2 4.0.0 gridcapa-cse-computation - 1.25.1 + 1.25.2 jar Common CSE computation utilities Module that manages common computation for CSE processes diff --git a/cse-lib/data/pom.xml b/cse-lib/data/pom.xml index 43aa2f40..13c87df4 100644 --- a/cse-lib/data/pom.xml +++ b/cse-lib/data/pom.xml @@ -7,11 +7,11 @@ gridcapa-cse-lib com.farao-community.farao - 1.25.1 + 1.25.2 gridcapa-cse-data - 1.25.1 + 1.25.2 jar Common CSE data management Module that manages specific data format for CSE processes diff --git a/cse-lib/network-processing/pom.xml b/cse-lib/network-processing/pom.xml index be74d986..2f9be8f0 100644 --- a/cse-lib/network-processing/pom.xml +++ b/cse-lib/network-processing/pom.xml @@ -7,7 +7,7 @@ gridcapa-cse-lib com.farao-community.farao - 1.25.1 + 1.25.2 gridcapa-cse-network-processing diff --git a/cse-lib/pom.xml b/cse-lib/pom.xml index 0fe0fcaf..324764d4 100644 --- a/cse-lib/pom.xml +++ b/cse-lib/pom.xml @@ -5,7 +5,7 @@ gridcapa-cse com.farao-community.farao - 1.25.1 + 1.25.2 4.0.0 diff --git a/cse-runner-api/pom.xml b/cse-runner-api/pom.xml index 13420e83..4ae7152b 100644 --- a/cse-runner-api/pom.xml +++ b/cse-runner-api/pom.xml @@ -7,7 +7,7 @@ com.farao-community.farao gridcapa-cse - 1.25.1 + 1.25.2 gridcapa-cse-runner-api diff --git a/cse-runner-spring-boot-starter/pom.xml b/cse-runner-spring-boot-starter/pom.xml index e1012107..89fb4bf4 100644 --- a/cse-runner-spring-boot-starter/pom.xml +++ b/cse-runner-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ gridcapa-cse com.farao-community.farao - 1.25.1 + 1.25.2 4.0.0 diff --git a/pom.xml b/pom.xml index 1f7e6ff2..2482cc08 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ gridcapa-cse - 1.25.1 + 1.25.2 pom GridCapa CSE From c863c1a714db51b7e2cbf53ea23784ce1a73c1fd Mon Sep 17 00:00:00 2001 From: schwitzguebel Date: Mon, 29 Apr 2024 14:13:32 +0000 Subject: [PATCH 6/6] Prepare next release 1.25.3 --- cse-cc-export-runner-app/pom.xml | 2 +- cse-cc-import-runner-app/pom.xml | 2 +- cse-lib/computation/pom.xml | 4 ++-- cse-lib/data/pom.xml | 4 ++-- cse-lib/network-processing/pom.xml | 2 +- cse-lib/pom.xml | 2 +- cse-runner-api/pom.xml | 2 +- cse-runner-spring-boot-starter/pom.xml | 2 +- pom.xml | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cse-cc-export-runner-app/pom.xml b/cse-cc-export-runner-app/pom.xml index 02043d42..96be4c27 100644 --- a/cse-cc-export-runner-app/pom.xml +++ b/cse-cc-export-runner-app/pom.xml @@ -5,7 +5,7 @@ gridcapa-cse com.farao-community.farao - 1.25.2 + 1.25.3-SNAPSHOT 4.0.0 diff --git a/cse-cc-import-runner-app/pom.xml b/cse-cc-import-runner-app/pom.xml index bfae51ff..edd0640b 100644 --- a/cse-cc-import-runner-app/pom.xml +++ b/cse-cc-import-runner-app/pom.xml @@ -5,7 +5,7 @@ gridcapa-cse com.farao-community.farao - 1.25.2 + 1.25.3-SNAPSHOT 4.0.0 diff --git a/cse-lib/computation/pom.xml b/cse-lib/computation/pom.xml index 76cd70eb..3cbd2ab3 100644 --- a/cse-lib/computation/pom.xml +++ b/cse-lib/computation/pom.xml @@ -14,12 +14,12 @@ gridcapa-cse-lib com.farao-community.farao - 1.25.2 + 1.25.3-SNAPSHOT 4.0.0 gridcapa-cse-computation - 1.25.2 + 1.25.3-SNAPSHOT jar Common CSE computation utilities Module that manages common computation for CSE processes diff --git a/cse-lib/data/pom.xml b/cse-lib/data/pom.xml index 13c87df4..1cf22724 100644 --- a/cse-lib/data/pom.xml +++ b/cse-lib/data/pom.xml @@ -7,11 +7,11 @@ gridcapa-cse-lib com.farao-community.farao - 1.25.2 + 1.25.3-SNAPSHOT gridcapa-cse-data - 1.25.2 + 1.25.3-SNAPSHOT jar Common CSE data management Module that manages specific data format for CSE processes diff --git a/cse-lib/network-processing/pom.xml b/cse-lib/network-processing/pom.xml index 2f9be8f0..309453ac 100644 --- a/cse-lib/network-processing/pom.xml +++ b/cse-lib/network-processing/pom.xml @@ -7,7 +7,7 @@ gridcapa-cse-lib com.farao-community.farao - 1.25.2 + 1.25.3-SNAPSHOT gridcapa-cse-network-processing diff --git a/cse-lib/pom.xml b/cse-lib/pom.xml index 324764d4..6511b562 100644 --- a/cse-lib/pom.xml +++ b/cse-lib/pom.xml @@ -5,7 +5,7 @@ gridcapa-cse com.farao-community.farao - 1.25.2 + 1.25.3-SNAPSHOT 4.0.0 diff --git a/cse-runner-api/pom.xml b/cse-runner-api/pom.xml index 4ae7152b..bde1a186 100644 --- a/cse-runner-api/pom.xml +++ b/cse-runner-api/pom.xml @@ -7,7 +7,7 @@ com.farao-community.farao gridcapa-cse - 1.25.2 + 1.25.3-SNAPSHOT gridcapa-cse-runner-api diff --git a/cse-runner-spring-boot-starter/pom.xml b/cse-runner-spring-boot-starter/pom.xml index 89fb4bf4..98d0ce43 100644 --- a/cse-runner-spring-boot-starter/pom.xml +++ b/cse-runner-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ gridcapa-cse com.farao-community.farao - 1.25.2 + 1.25.3-SNAPSHOT 4.0.0 diff --git a/pom.xml b/pom.xml index 2482cc08..fc3bb40f 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ gridcapa-cse - 1.25.2 + 1.25.3-SNAPSHOT pom GridCapa CSE