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 to powsybl dependencies 2024.2.0 #136

Merged
merged 1 commit into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 1 addition & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,9 @@

<properties>
<jib.from.image>powsybl/java-dynawo:2.1.0</jib.from.image>
<gridsuite-dependencies.version>30</gridsuite-dependencies.version>
<gridsuite-dependencies.version>31</gridsuite-dependencies.version>
<liquibase-hibernate-package>org.gridsuite.securityanalysis.server</liquibase-hibernate-package>
<db-util.version>1.0.5</db-util.version>
<powsybl-ws-commons.version>1.11.0</powsybl-ws-commons.version><!-- should be removed once gridsuite-dependencies is upgraded-->
</properties>

<build>
Expand Down Expand Up @@ -133,7 +132,6 @@
<dependency>
<groupId>com.powsybl</groupId>
<artifactId>powsybl-ws-commons</artifactId>
<version>${powsybl-ws-commons.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import com.powsybl.loadflow.LoadFlowResult;
import com.powsybl.network.store.client.NetworkStoreService;
import com.powsybl.security.*;
import com.powsybl.security.detectors.DefaultLimitViolationDetector;
import com.powsybl.ws.commons.LogUtils;
import com.powsybl.ws.commons.computation.service.*;
import org.gridsuite.securityanalysis.server.dto.ContingencyInfos;
Expand All @@ -28,7 +27,6 @@
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.UUID;
Expand Down Expand Up @@ -69,7 +67,8 @@ public SecurityAnalysisResult run(SecurityAnalysisRunContext runContext) {
Network network = getNetwork(runContext.getNetworkUuid(),
runContext.getVariantId());
runContext.setNetwork(network);
return run(runContext, null);
AtomicReference<ReportNode> rootReporter = new AtomicReference<>();
return run(runContext, null, rootReporter);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
return null;
Expand All @@ -94,20 +93,17 @@ protected CompletableFuture<SecurityAnalysisResult> getCompletableFuture(Securit
.filter(Objects::nonNull)
.toList();

SecurityAnalysisRunParameters runParameters = new SecurityAnalysisRunParameters()
.setSecurityAnalysisParameters(runContext.getParameters())
.setComputationManager(executionService.getComputationManager())
.setFilter(LimitViolationFilter.load())
.setReportNode(runContext.getReportNode());

return securityAnalysisRunner.runAsync(
runContext.getNetwork(),
variantId,
n -> contingencies,
runContext.getParameters(),
executionService.getComputationManager(),
LimitViolationFilter.load(),
new DefaultLimitViolationDetector(),
Collections.emptyList(),
Collections.emptyList(),
Collections.emptyList(),
Collections.emptyList(),
Collections.emptyList(),
runContext.getReportNode())
runParameters)
.thenApply(SecurityAnalysisReport::getResult);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,12 @@
*/
package org.gridsuite.securityanalysis.server;

import com.powsybl.commons.report.ReportNode;
import com.powsybl.computation.ComputationManager;
import com.powsybl.contingency.*;
import com.powsybl.iidm.network.Network;
import com.powsybl.iidm.network.TwoSides;
import com.powsybl.loadflow.LoadFlowResult;
import com.powsybl.security.*;
import com.powsybl.action.Action;
import com.powsybl.security.interceptors.SecurityAnalysisInterceptor;
import com.powsybl.security.limitreduction.LimitReduction;
import com.powsybl.security.monitor.StateMonitor;
import com.powsybl.security.results.PostContingencyResult;
import com.powsybl.security.strategy.OperatorStrategy;
import org.gridsuite.securityanalysis.server.dto.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -199,17 +192,8 @@ static List<PreContingencyLimitViolationResultDTO> getResultPreContingencyWithNe

public CompletableFuture<SecurityAnalysisReport> run(Network network,
String workingVariantId,
LimitViolationDetector detector,
LimitViolationFilter filter,
ComputationManager computationManager,
SecurityAnalysisParameters parameters,
ContingenciesProvider contingenciesProvider,
List<SecurityAnalysisInterceptor> interceptors,
List<OperatorStrategy> operatorStrategies,
List<Action> actions,
List<StateMonitor> monitors,
List<LimitReduction> limitReductions,
ReportNode reportNode) {
SecurityAnalysisRunParameters parameters) {
LOGGER.info("Run security analysis mock");
switch (workingVariantId) {
case VARIANT_3_ID -> {
Expand Down
Loading