From be060eb1260d5fbacde5433abc216bc9c638f6f3 Mon Sep 17 00:00:00 2001 From: lisrte Date: Fri, 11 Oct 2024 14:41:08 +0200 Subject: [PATCH] Merge the 2 DynawoSimulationConstants classes Remove constants duplicate Move DynawoSimulationParameters.ExportMode to commons Signed-off-by: lisrte --- .../dynawo/commons/DynawoConstants.java | 14 ++++++- .../powsybl/dynawo/commons/ExportMode.java | 27 +++++++++++++ docs/dynamic_simulation/configuration.md | 2 +- .../powsybl/dynaflow/DynaFlowConstants.java | 5 --- .../com/powsybl/dynaflow/DynaFlowHandler.java | 14 ++++--- .../powsybl/dynaflow/DynaFlowProvider.java | 10 ++--- .../DynaFlowSecurityAnalysisHandler.java | 12 +++--- .../DynaFlowSecurityAnalysisProvider.java | 3 +- .../dynaflow/SecurityAnalysisConstants.java | 2 +- .../dynaflow/DynaFlowProviderTest.java | 10 ++--- .../DynaFlowSecurityAnalysisTest.java | 15 +++++--- .../dsl/ieee/DynawoLocalCommandExecutor.java | 8 ++-- .../dynawo/it/DynawoSimulationTest.java | 15 ++++---- .../DynawoSecurityAnalysisHandler.java | 18 ++++----- .../DynawoSecurityAnalysisProvider.java | 2 +- .../dynawo/security/xml/MultipleJobsXml.java | 4 +- .../security/xml/MultiplesJobsXmlTest.java | 2 +- .../dynawo/DynawoSimulationConstants.java | 32 +++++++++++++--- .../dynawo/DynawoSimulationHandler.java | 15 +++----- .../dynawo/DynawoSimulationParameters.java | 17 +-------- .../dynawo/DynawoSimulationProvider.java | 2 +- .../java/com/powsybl/dynawo/xml/DydXml.java | 2 +- .../dynawo/xml/DynawoSimulationConstants.java | 38 ------------------- .../java/com/powsybl/dynawo/xml/JobsXml.java | 13 ++++--- .../dynawo/xml/OutputVariablesXml.java | 4 +- .../powsybl/dynawo/DynawoParametersTest.java | 2 +- .../powsybl/dynawo/DynawoProviderTest.java | 6 +-- .../xml/ActivePowerVariationEventXmlTest.java | 1 + .../dynawo/xml/BaseGeneratorModelXmlTest.java | 1 + .../xml/DisconnectBranchEventXmlTest.java | 1 + .../dynawo/xml/DisconnectEventXmlTest.java | 1 + .../xml/DisconnectHvdcEventXmlTest.java | 1 + .../dynawo/xml/DynamicModelsXmlTest.java | 1 + ...cOverloadManagementSystemModelXmlTest.java | 1 + ...sOverloadManagementSystemModelXmlTest.java | 1 + .../EmptyPhaseShifterBlockingIXmlTest.java | 1 + ...mptyTapChangerAutomationSystemXmlTest.java | 1 + ...hangerBlockingAutomationSystemXmlTest.java | 1 + .../com/powsybl/dynawo/xml/EventXmlTest.java | 1 + .../com/powsybl/dynawo/xml/HvdcXmlTest.java | 1 + .../com/powsybl/dynawo/xml/JobsXmlTest.java | 1 + .../powsybl/dynawo/xml/LoadsModelXmlTest.java | 1 + .../dynawo/xml/NodeFaultEventXmlTest.java | 1 + .../dynawo/xml/OmegaRefModelXmlTest.java | 1 + .../dynawo/xml/OutputVariablesXmlTest.java | 1 + .../xml/PhaseShifterBlockingIXmlTest.java | 1 + .../dynawo/xml/PhaseShiftersXmlTest.java | 1 + .../xml/SetPointInfiniteBusModelXmlTest.java | 1 + .../powsybl/dynawo/xml/ShuntModelXmlTest.java | 1 + .../powsybl/dynawo/xml/SignalNXmlTest.java | 1 + .../dynawo/xml/SvarcModelWithSbaXmlTest.java | 1 + .../powsybl/dynawo/xml/SvarcModelXmlTest.java | 1 + .../TapChangerAutomationSystemXmlTest.java | 1 + ...hangerBlockingAutomationSystemXmlTest.java | 1 + ...ngToTapChangerAutomationSystemXmlTest.java | 1 + .../dynawo/xml/TransformerModelXmlTest.java | 1 + .../UnderVoltageAutomationSystemXmlTest.java | 1 + .../powsybl/dynawo/xml/WeccGenXmlTest.java | 1 + 58 files changed, 178 insertions(+), 147 deletions(-) create mode 100644 commons/src/main/java/com/powsybl/dynawo/commons/ExportMode.java delete mode 100644 dynawo-simulation/src/main/java/com/powsybl/dynawo/xml/DynawoSimulationConstants.java diff --git a/commons/src/main/java/com/powsybl/dynawo/commons/DynawoConstants.java b/commons/src/main/java/com/powsybl/dynawo/commons/DynawoConstants.java index a8061a831..d4581e8bf 100644 --- a/commons/src/main/java/com/powsybl/dynawo/commons/DynawoConstants.java +++ b/commons/src/main/java/com/powsybl/dynawo/commons/DynawoConstants.java @@ -24,8 +24,6 @@ private DynawoConstants() { */ public static final String IIDM_VERSION = IidmVersion.V_1_4.toString("."); - public static final String DYNAWO_TIMELINE_FOLDER = "timeLine"; - public static final DynawoVersion VERSION_MIN = new DynawoVersion(1, 5, 0); public static final List IIDM_EXTENSIONS = List.of( @@ -36,5 +34,17 @@ private DynawoConstants() { "hvdcOperatorActivePowerRange", "standbyAutomaton"); + public static final String NETWORK_FILENAME = "powsybl_dynawo.xiidm"; + + public static final String OUTPUTS_FOLDER = "outputs"; + public static final String OUTPUT_IIDM_FILENAME = "outputIIDM.xml"; + + public static final String FINAL_STATE_FOLDER = "finalState"; + + public static final String TIMELINE_FOLDER = "timeLine"; + + public static final String TIMELINE_FILENAME = "timeline"; + + public static final String OUTPUT_IIDM_FILENAME_FULL_PATH = OUTPUTS_FOLDER + "/" + FINAL_STATE_FOLDER + "/" + OUTPUT_IIDM_FILENAME; } diff --git a/commons/src/main/java/com/powsybl/dynawo/commons/ExportMode.java b/commons/src/main/java/com/powsybl/dynawo/commons/ExportMode.java new file mode 100644 index 000000000..869dddbc6 --- /dev/null +++ b/commons/src/main/java/com/powsybl/dynawo/commons/ExportMode.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) 2024, RTE (http://www.rte-france.com/) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * SPDX-License-Identifier: MPL-2.0 + */ +package com.powsybl.dynawo.commons; + +/** + * @author Laurent Issertial {@literal } + */ +public enum ExportMode { + CSV(".csv"), + TXT(".log"), + XML(".xml"); + + private final String fileExtension; + + ExportMode(String fileExtension) { + this.fileExtension = fileExtension; + } + + public String getFileExtension() { + return fileExtension; + } +} diff --git a/docs/dynamic_simulation/configuration.md b/docs/dynamic_simulation/configuration.md index e343d52e9..d84827274 100644 --- a/docs/dynamic_simulation/configuration.md +++ b/docs/dynamic_simulation/configuration.md @@ -87,7 +87,7 @@ The default value is `FALSE`. **timeline.exportMode** `timeline.exportMode` defines the file extension of the timeline export. -The available `com.powsybl.dynawo.DynawoSimulationParameters.ExportMode` values are: +The available `com.powsybl.dynawo.commons.ExportMode` values are: - `CSV` - `TXT`: same format as `CSV` but with `|` separator - `XML` diff --git a/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowConstants.java b/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowConstants.java index cc3e5dd17..bb5bdbcfd 100644 --- a/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowConstants.java +++ b/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowConstants.java @@ -16,12 +16,7 @@ public final class DynaFlowConstants { public static final String DYNAFLOW_NAME = "DynaFlow"; public static final String CONFIG_FILENAME = "config.json"; - public static final String IIDM_FILENAME = "network.xiidm"; - public static final String OUTPUT_IIDM_FILENAME = "outputIIDM.xml"; public static final String OUTPUT_RESULTS_FILENAME = "results.json"; - static final String DYNAFLOW_OUTPUTS_FOLDER = "outputs"; - static final String DYNAFLOW_TIMELINE_FILE = "timeline.xml"; - public enum OutputTypes { STEADYSTATE, diff --git a/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowHandler.java b/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowHandler.java index 0b937561c..6a0f5c7da 100644 --- a/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowHandler.java +++ b/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowHandler.java @@ -15,6 +15,7 @@ import com.powsybl.dynaflow.json.DynaFlowConfigSerializer; import com.powsybl.dynawo.commons.CommonReports; import com.powsybl.dynawo.commons.DynawoUtil; +import com.powsybl.dynawo.commons.ExportMode; import com.powsybl.dynawo.commons.NetworkResultsUpdater; import com.powsybl.dynawo.commons.loadmerge.LoadsMerger; import com.powsybl.dynawo.commons.timeline.TimelineEntry; @@ -35,7 +36,7 @@ import java.util.Map; import static com.powsybl.dynaflow.DynaFlowConstants.*; -import static com.powsybl.dynawo.commons.DynawoConstants.DYNAWO_TIMELINE_FOLDER; +import static com.powsybl.dynawo.commons.DynawoConstants.*; import static com.powsybl.dynawo.commons.DynawoUtil.getCommandExecutions; /** @@ -63,7 +64,7 @@ public DynaFlowHandler(Network network, String workingStateId, DynaFlowParameter @Override public List before(Path workingDir) throws IOException { network.getVariantManager().setWorkingVariant(workingStateId); - DynawoUtil.writeIidm(dynawoInput, workingDir.resolve(IIDM_FILENAME)); + DynawoUtil.writeIidm(dynawoInput, workingDir.resolve(NETWORK_FILENAME)); DynaFlowConfigSerializer.serialize(loadFlowParameters, dynaFlowParameters, Path.of("."), workingDir.resolve(CONFIG_FILENAME)); return getCommandExecutions(command); } @@ -75,7 +76,8 @@ public LoadFlowResult after(Path workingDir, ExecutionReport report) { report.log(); network.getVariantManager().setWorkingVariant(workingStateId); boolean status = true; - Path outputNetworkFile = workingDir.resolve("outputs").resolve("finalState").resolve(DynaFlowConstants.OUTPUT_IIDM_FILENAME); + Path outputNetworkFile = workingDir.resolve(OUTPUT_IIDM_FILENAME_FULL_PATH); + if (Files.exists(outputNetworkFile)) { NetworkResultsUpdater.update(network, NetworkSerDe.read(outputNetworkFile), dynaFlowParameters.isMergeLoads()); } else { @@ -99,9 +101,9 @@ public LoadFlowResult after(Path workingDir, ExecutionReport report) { private void reportTimeLine(Path workingDir) { ReportNode dfReporter = DynaflowReports.createDynaFlowReportNode(reportNode, network.getId()); - Path timelineFile = workingDir.resolve(DYNAFLOW_OUTPUTS_FOLDER) - .resolve(DYNAWO_TIMELINE_FOLDER) - .resolve(DYNAFLOW_TIMELINE_FILE); + Path timelineFile = workingDir.resolve(OUTPUTS_FOLDER) + .resolve(TIMELINE_FOLDER) + .resolve(TIMELINE_FILENAME + ExportMode.XML.getFileExtension()); List tl = new XmlTimeLineParser().parse(timelineFile); tl.forEach(e -> CommonReports.reportTimelineEntry(dfReporter, e)); } diff --git a/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowProvider.java b/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowProvider.java index b580df72b..62689d886 100644 --- a/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowProvider.java +++ b/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowProvider.java @@ -27,6 +27,8 @@ import java.util.concurrent.CompletableFuture; import static com.powsybl.dynaflow.DynaFlowConstants.*; +import static com.powsybl.dynawo.commons.DynawoConstants.NETWORK_FILENAME; +import static com.powsybl.dynawo.commons.DynawoConstants.OUTPUT_IIDM_FILENAME_FULL_PATH; /** * @@ -51,16 +53,14 @@ public DynaFlowProvider(Supplier configSupplier) { } public static Command getCommand(DynaFlowConfig config) { - List args = Arrays.asList("--network", IIDM_FILENAME, "--config", CONFIG_FILENAME); - return new SimpleCommandBuilder() .id("dynaflow_lf") .program(config.getProgram()) - .args(args) - .inputFiles(new InputFile(IIDM_FILENAME), + .args("--network", NETWORK_FILENAME, "--config", CONFIG_FILENAME) + .inputFiles(new InputFile(NETWORK_FILENAME), new InputFile(CONFIG_FILENAME)) .outputFiles(new OutputFile(OUTPUT_RESULTS_FILENAME), - new OutputFile("outputs/finalState/" + OUTPUT_IIDM_FILENAME)) + new OutputFile(OUTPUT_IIDM_FILENAME_FULL_PATH)) .build(); } diff --git a/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowSecurityAnalysisHandler.java b/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowSecurityAnalysisHandler.java index 314c2ed94..58cbd4f42 100644 --- a/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowSecurityAnalysisHandler.java +++ b/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowSecurityAnalysisHandler.java @@ -36,10 +36,10 @@ import java.util.List; import static com.powsybl.dynaflow.DynaFlowConstants.CONFIG_FILENAME; -import static com.powsybl.dynaflow.DynaFlowConstants.IIDM_FILENAME; import static com.powsybl.dynaflow.SecurityAnalysisConstants.CONTINGENCIES_FILENAME; -import static com.powsybl.dynaflow.SecurityAnalysisConstants.DYNAWO_CONSTRAINTS_FOLDER; -import static com.powsybl.dynawo.commons.DynawoConstants.DYNAWO_TIMELINE_FOLDER; +import static com.powsybl.dynaflow.SecurityAnalysisConstants.CONSTRAINTS_FOLDER; +import static com.powsybl.dynawo.commons.DynawoConstants.NETWORK_FILENAME; +import static com.powsybl.dynawo.commons.DynawoConstants.TIMELINE_FOLDER; import static com.powsybl.dynawo.commons.DynawoUtil.getCommandExecutions; /** @@ -74,7 +74,7 @@ public DynaFlowSecurityAnalysisHandler(Network network, String workingVariantId, public List before(Path workingDir) throws IOException { network.getVariantManager().setWorkingVariant(workingVariantId); - DynawoUtil.writeIidm(network, workingDir.resolve(IIDM_FILENAME)); + DynawoUtil.writeIidm(network, workingDir.resolve(NETWORK_FILENAME)); writeParameters(securityAnalysisParameters, workingDir); writeContingencies(contingencies, workingDir); return getCommandExecutions(command); @@ -84,11 +84,11 @@ public List before(Path workingDir) throws IOException { public SecurityAnalysisReport after(Path workingDir, ExecutionReport report) throws IOException { super.after(workingDir, report); network.getVariantManager().setWorkingVariant(workingVariantId); - ContingencyResultsUtils.reportContingenciesTimelines(contingencies, workingDir.resolve(DYNAWO_TIMELINE_FOLDER), reportNode); + ContingencyResultsUtils.reportContingenciesTimelines(contingencies, workingDir.resolve(TIMELINE_FOLDER), reportNode); return new SecurityAnalysisReport( new SecurityAnalysisResult( ContingencyResultsUtils.getPreContingencyResult(network, violationFilter), - ContingencyResultsUtils.getPostContingencyResults(network, violationFilter, workingDir.resolve(DYNAWO_CONSTRAINTS_FOLDER), contingencies), + ContingencyResultsUtils.getPostContingencyResults(network, violationFilter, workingDir.resolve(CONSTRAINTS_FOLDER), contingencies), Collections.emptyList()) ); } diff --git a/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowSecurityAnalysisProvider.java b/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowSecurityAnalysisProvider.java index fb02e1bde..bf1eac251 100644 --- a/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowSecurityAnalysisProvider.java +++ b/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowSecurityAnalysisProvider.java @@ -31,6 +31,7 @@ import static com.powsybl.dynaflow.DynaFlowConstants.*; import static com.powsybl.dynaflow.SecurityAnalysisConstants.CONTINGENCIES_FILENAME; import static com.powsybl.dynaflow.DynaFlowConstants.DYNAFLOW_NAME; +import static com.powsybl.dynawo.commons.DynawoConstants.NETWORK_FILENAME; /** * @author Marcos de Miguel {@literal } @@ -89,7 +90,7 @@ public String getVersion() { } public static Command getCommand(DynaFlowConfig config) { - List args = Arrays.asList("--network", IIDM_FILENAME, + List args = Arrays.asList("--network", NETWORK_FILENAME, "--config", CONFIG_FILENAME, "--contingencies", CONTINGENCIES_FILENAME); return new SimpleCommandBuilder() diff --git a/dynaflow/src/main/java/com/powsybl/dynaflow/SecurityAnalysisConstants.java b/dynaflow/src/main/java/com/powsybl/dynaflow/SecurityAnalysisConstants.java index 3d4e3f377..e50d9b274 100644 --- a/dynaflow/src/main/java/com/powsybl/dynaflow/SecurityAnalysisConstants.java +++ b/dynaflow/src/main/java/com/powsybl/dynaflow/SecurityAnalysisConstants.java @@ -12,7 +12,7 @@ */ public final class SecurityAnalysisConstants { - public static final String DYNAWO_CONSTRAINTS_FOLDER = "constraints"; + public static final String CONSTRAINTS_FOLDER = "constraints"; public static final String CONTINGENCIES_FILENAME = "contingencies.json"; diff --git a/dynaflow/src/test/java/com/powsybl/dynaflow/DynaFlowProviderTest.java b/dynaflow/src/test/java/com/powsybl/dynaflow/DynaFlowProviderTest.java index 6bb76f9b2..772c0155d 100644 --- a/dynaflow/src/test/java/com/powsybl/dynaflow/DynaFlowProviderTest.java +++ b/dynaflow/src/test/java/com/powsybl/dynaflow/DynaFlowProviderTest.java @@ -34,7 +34,7 @@ import static com.powsybl.commons.test.ComparisonUtils.assertXmlEquals; import static com.powsybl.dynaflow.DynaFlowConstants.*; -import static com.powsybl.dynawo.commons.DynawoConstants.OUTPUT_IIDM_FILENAME; +import static com.powsybl.dynawo.commons.DynawoConstants.*; import static com.powsybl.loadflow.LoadFlowResult.Status.FAILED; import static com.powsybl.loadflow.LoadFlowResult.Status.FULLY_CONVERGED; import static org.assertj.core.api.Assertions.assertThat; @@ -68,7 +68,7 @@ void checkVersionCommand() { @Test void checkExecutionCommand() { String executionCommand = DynaFlowProvider.getCommand(config).toString(0); - String expectedExecutionCommand = "[" + getProgram(homeDir) + ", --network, " + IIDM_FILENAME + ", --config, " + CONFIG_FILENAME + "]"; + String expectedExecutionCommand = "[" + getProgram(homeDir) + ", --network, " + NETWORK_FILENAME + ", --config, " + CONFIG_FILENAME + "]"; assertEquals(expectedExecutionCommand, executionCommand); } @@ -93,8 +93,8 @@ public int execute(String program, List args, Path outFile, Path errFile try { copyFile(stdOutFileRef, errFile); copyFile(outputResults, workingDir.resolve(OUTPUT_RESULTS_FILENAME)); - Files.createDirectories(workingDir.resolve("outputs").resolve("finalState")); - copyFile(outputIidm, workingDir.resolve("outputs").resolve("finalState").resolve(OUTPUT_IIDM_FILENAME)); + Path finalState = Files.createDirectories(workingDir.resolve(OUTPUTS_FOLDER).resolve(FINAL_STATE_FOLDER)); + copyFile(outputIidm, finalState.resolve(OUTPUT_IIDM_FILENAME)); return 0; } catch (IOException e) { @@ -115,7 +115,7 @@ public EmptyLocalCommandExecutorMock(String stdoutFileRef) { public int execute(String program, List args, Path outFile, Path errFile, Path workingDir, Map env) { try { copyFile(stdOutFileRef, errFile); - Files.createDirectories(workingDir.resolve("outputs").resolve("finalState")); + Files.createDirectories(workingDir.resolve(OUTPUTS_FOLDER).resolve(FINAL_STATE_FOLDER)); return 0; } catch (IOException e) { throw new UncheckedIOException(e); diff --git a/dynaflow/src/test/java/com/powsybl/dynaflow/DynaFlowSecurityAnalysisTest.java b/dynaflow/src/test/java/com/powsybl/dynaflow/DynaFlowSecurityAnalysisTest.java index 75c9b4ced..c0dd67d2e 100644 --- a/dynaflow/src/test/java/com/powsybl/dynaflow/DynaFlowSecurityAnalysisTest.java +++ b/dynaflow/src/test/java/com/powsybl/dynaflow/DynaFlowSecurityAnalysisTest.java @@ -33,8 +33,10 @@ import static com.powsybl.commons.test.ComparisonUtils.assertTxtEquals; import static com.powsybl.commons.test.ComparisonUtils.assertXmlEquals; -import static com.powsybl.dynaflow.DynaFlowConstants.DYNAFLOW_NAME; -import static com.powsybl.dynaflow.DynaFlowConstants.IIDM_FILENAME; +import static com.powsybl.dynaflow.DynaFlowConstants.*; +import static com.powsybl.dynaflow.SecurityAnalysisConstants.CONTINGENCIES_FILENAME; +import static com.powsybl.dynaflow.SecurityAnalysisConstants.CONSTRAINTS_FOLDER; +import static com.powsybl.dynawo.commons.DynawoConstants.NETWORK_FILENAME; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -69,7 +71,8 @@ public int execute(String program, List args, Path outFile, Path errFile if (args.get(0).equals("--version")) { copyFile(stdOutFileRef, errFile); } else { - assertEquals("--network network.xiidm --config config.json --contingencies contingencies.json", String.join(" ", args)); + assertEquals("--network %s --config %s --contingencies %s".formatted(NETWORK_FILENAME, CONFIG_FILENAME, CONTINGENCIES_FILENAME), + String.join(" ", args)); validateInputs(workingDir); copyOutputs(workingDir); } @@ -81,16 +84,16 @@ public int execute(String program, List args, Path outFile, Path errFile private void validateInputs(Path workingDir) throws IOException { if (inputFile != null) { - assertXmlEquals(getClass().getResourceAsStream(inputFile), Files.newInputStream(workingDir.resolve(IIDM_FILENAME))); + assertXmlEquals(getClass().getResourceAsStream(inputFile), Files.newInputStream(workingDir.resolve(NETWORK_FILENAME))); } if (contingencyFile != null) { InputStream contingencyIs = Objects.requireNonNull(getClass().getResourceAsStream(contingencyFile)); - assertTxtEquals(contingencyIs, Files.newInputStream(workingDir.resolve("contingencies.json"))); + assertTxtEquals(contingencyIs, Files.newInputStream(workingDir.resolve(CONTINGENCIES_FILENAME))); } } private void copyOutputs(Path workingDir) throws IOException { - Path constraintsFolder = Files.createDirectories(workingDir.resolve("constraints")); + Path constraintsFolder = Files.createDirectories(workingDir.resolve(CONSTRAINTS_FOLDER)); for (int i = 0; i < contingencyIds.size(); i++) { copyFile(constraints.get(i), constraintsFolder.resolve("constraints_" + contingencyIds.get(i) + ".xml")); } diff --git a/dynawo-dsl/src/test/java/com/powsybl/dynawo/dsl/ieee/DynawoLocalCommandExecutor.java b/dynawo-dsl/src/test/java/com/powsybl/dynawo/dsl/ieee/DynawoLocalCommandExecutor.java index 5a16a0a25..505bd11e5 100644 --- a/dynawo-dsl/src/test/java/com/powsybl/dynawo/dsl/ieee/DynawoLocalCommandExecutor.java +++ b/dynawo-dsl/src/test/java/com/powsybl/dynawo/dsl/ieee/DynawoLocalCommandExecutor.java @@ -25,7 +25,9 @@ import java.util.Map; import java.util.Objects; -import static com.powsybl.dynawo.xml.DynawoSimulationConstants.*; +import static com.powsybl.dynawo.DynawoSimulationConstants.*; +import static com.powsybl.dynawo.commons.DynawoConstants.NETWORK_FILENAME; +import static com.powsybl.dynawo.commons.DynawoConstants.OUTPUTS_FOLDER; import static org.junit.jupiter.api.Assertions.assertFalse; /** @@ -61,8 +63,8 @@ protected void validateInputs(Path workingDir) throws IOException { } protected void copyOutputs(Path workingDir) throws IOException { - Path output = Files.createDirectories(workingDir.resolve("outputs/outputVariables").toAbsolutePath()); - Files.copy(Objects.requireNonNull(getClass().getResourceAsStream("/" + baseDirName + "/dynawo-outputs/outputVariables.csv")), output.resolve("curves.csv")); + Path output = Files.createDirectories(workingDir.resolve(OUTPUTS_FOLDER).resolve(CURVES_OUTPUT_PATH).toAbsolutePath()); + Files.copy(Objects.requireNonNull(getClass().getResourceAsStream("/" + baseDirName + "/dynawo-outputs/curves.csv")), output.resolve(CURVES_FILENAME)); } @Override diff --git a/dynawo-integration-tests/src/test/java/com/powsybl/dynawo/it/DynawoSimulationTest.java b/dynawo-integration-tests/src/test/java/com/powsybl/dynawo/it/DynawoSimulationTest.java index 1dd837e70..2e5a30996 100644 --- a/dynawo-integration-tests/src/test/java/com/powsybl/dynawo/it/DynawoSimulationTest.java +++ b/dynawo-integration-tests/src/test/java/com/powsybl/dynawo/it/DynawoSimulationTest.java @@ -11,10 +11,8 @@ import com.powsybl.commons.report.ReportNode; import com.powsybl.dynamicsimulation.*; import com.powsybl.dynamicsimulation.groovy.*; -import com.powsybl.dynawo.DumpFileParameters; -import com.powsybl.dynawo.DynawoSimulationConfig; -import com.powsybl.dynawo.DynawoSimulationParameters; -import com.powsybl.dynawo.DynawoSimulationProvider; +import com.powsybl.dynawo.*; +import com.powsybl.dynawo.commons.ExportMode; import com.powsybl.dynawo.parameters.ParametersSet; import com.powsybl.dynawo.suppliers.dynamicmodels.DynawoModelsSupplier; import com.powsybl.dynawo.suppliers.events.DynawoEventModelsSupplier; @@ -37,6 +35,7 @@ import static com.powsybl.commons.report.ReportNode.NO_OP; import static com.powsybl.commons.report.ReportNode.newRootReportNode; +import static com.powsybl.dynawo.commons.DynawoConstants.NETWORK_FILENAME; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.*; @@ -216,7 +215,7 @@ void testSmib() { @Test void testSimulationError() { - Network network = Network.read(new ResourceDataSource("powsybl_dynawo", new ResourceSet("/error", "powsybl_dynawo.xiidm"))); + Network network = Network.read(new ResourceDataSource("powsybl_dynawo", new ResourceSet("/error", NETWORK_FILENAME))); GroovyDynamicModelsSupplier dynamicModelsSupplier = new GroovyDynamicModelsSupplier( getResourceAsStream("/error/models.groovy"), @@ -256,7 +255,7 @@ void testIeee14DynawoSuppliers() { .setNetworkParameters(networkParameters) .setSolverParameters(solverParameters) .setSolverType(DynawoSimulationParameters.SolverType.IDA) - .setTimelineExportMode(DynawoSimulationParameters.ExportMode.XML); + .setTimelineExportMode(ExportMode.XML); DynamicSimulationResult result = provider.run(network, dynamicModelsSupplier, eventModelsSupplier, OutputVariablesSupplier.empty(), VariantManagerConstants.INITIAL_VARIANT_ID, computationManager, parameters, NO_OP) @@ -292,7 +291,7 @@ void testIEEE14SignalN() { .setSolverParameters(ParametersXml.load(getResourceAsStream("/ieee14/signal_n/IEEE14.par"), "SimplifiedSolver")) .setLogLevelFilter(DynawoSimulationParameters.LogLevel.DEBUG) .setSolverType(DynawoSimulationParameters.SolverType.SIM) - .setTimelineExportMode(DynawoSimulationParameters.ExportMode.XML); + .setTimelineExportMode(ExportMode.XML); DynamicSimulationResult result = provider.run(network, dynamicModelsSupplier, eventModelsSupplier, OutputVariablesSupplier.empty(), VariantManagerConstants.INITIAL_VARIANT_ID, computationManager, parameters, NO_OP) @@ -332,7 +331,7 @@ private Supplier setupIEEE14Simulation(ReportNode repor .setNetworkParameters(networkParameters) .setSolverParameters(solverParameters) .setSolverType(DynawoSimulationParameters.SolverType.IDA) - .setTimelineExportMode(DynawoSimulationParameters.ExportMode.XML); + .setTimelineExportMode(ExportMode.XML); return () -> provider.run(network, dynamicModelsSupplier, eventModelsSupplier, outputVariablesSupplier, VariantManagerConstants.INITIAL_VARIANT_ID, computationManager, parameters, reportNode) diff --git a/dynawo-security-analysis/src/main/java/com/powsybl/dynawo/security/DynawoSecurityAnalysisHandler.java b/dynawo-security-analysis/src/main/java/com/powsybl/dynawo/security/DynawoSecurityAnalysisHandler.java index aedb25440..ab0e86ae1 100644 --- a/dynawo-security-analysis/src/main/java/com/powsybl/dynawo/security/DynawoSecurityAnalysisHandler.java +++ b/dynawo-security-analysis/src/main/java/com/powsybl/dynawo/security/DynawoSecurityAnalysisHandler.java @@ -15,10 +15,8 @@ import com.powsybl.computation.ExecutionReport; import com.powsybl.dynaflow.ContingencyResultsUtils; import com.powsybl.dynawo.xml.DydXml; -import com.powsybl.dynawo.xml.DynawoSimulationConstants; import com.powsybl.dynawo.xml.JobsXml; import com.powsybl.dynawo.xml.ParametersXml; -import com.powsybl.dynawo.commons.DynawoConstants; import com.powsybl.dynawo.commons.DynawoUtil; import com.powsybl.dynawo.commons.NetworkResultsUpdater; import com.powsybl.dynawo.security.xml.ContingenciesDydXml; @@ -39,10 +37,8 @@ import java.util.Collections; import java.util.List; -import static com.powsybl.dynaflow.SecurityAnalysisConstants.DYNAWO_CONSTRAINTS_FOLDER; -import static com.powsybl.dynawo.DynawoSimulationConstants.FINAL_STATE_FOLDER; -import static com.powsybl.dynawo.DynawoSimulationConstants.OUTPUTS_FOLDER; -import static com.powsybl.dynawo.commons.DynawoConstants.DYNAWO_TIMELINE_FOLDER; +import static com.powsybl.dynaflow.SecurityAnalysisConstants.CONSTRAINTS_FOLDER; +import static com.powsybl.dynawo.commons.DynawoConstants.*; import static com.powsybl.dynawo.commons.DynawoUtil.getCommandExecutions; /** @@ -71,7 +67,7 @@ public DynawoSecurityAnalysisHandler(SecurityAnalysisContext context, Command co @Override public List before(Path workingDir) throws IOException { network.getVariantManager().setWorkingVariant(context.getWorkingVariantId()); - Path outputNetworkFile = workingDir.resolve(OUTPUTS_FOLDER).resolve(FINAL_STATE_FOLDER).resolve(DynawoConstants.OUTPUT_IIDM_FILENAME); + Path outputNetworkFile = workingDir.resolve(OUTPUT_IIDM_FILENAME_FULL_PATH); if (Files.exists(outputNetworkFile)) { Files.delete(outputNetworkFile); } @@ -83,23 +79,23 @@ public List before(Path workingDir) throws IOException { public SecurityAnalysisReport after(Path workingDir, ExecutionReport report) throws IOException { super.after(workingDir, report); context.getNetwork().getVariantManager().setWorkingVariant(context.getWorkingVariantId()); - Path outputNetworkFile = workingDir.resolve(OUTPUTS_FOLDER).resolve(FINAL_STATE_FOLDER).resolve(DynawoConstants.OUTPUT_IIDM_FILENAME); + Path outputNetworkFile = workingDir.resolve(OUTPUT_IIDM_FILENAME_FULL_PATH); if (Files.exists(outputNetworkFile)) { NetworkResultsUpdater.update(context.getNetwork(), NetworkSerDe.read(outputNetworkFile), context.getDynawoSimulationParameters().isMergeLoads()); } - ContingencyResultsUtils.reportContingenciesTimelines(context.getContingencies(), workingDir.resolve(DYNAWO_TIMELINE_FOLDER), reportNode); + ContingencyResultsUtils.reportContingenciesTimelines(context.getContingencies(), workingDir.resolve(TIMELINE_FOLDER), reportNode); return new SecurityAnalysisReport( new SecurityAnalysisResult( ContingencyResultsUtils.getPreContingencyResult(network, violationFilter), - ContingencyResultsUtils.getPostContingencyResults(network, violationFilter, workingDir.resolve(DYNAWO_CONSTRAINTS_FOLDER), context.getContingencies()), + ContingencyResultsUtils.getPostContingencyResults(network, violationFilter, workingDir.resolve(CONSTRAINTS_FOLDER), context.getContingencies()), Collections.emptyList()) ); } private void writeInputFiles(Path workingDir) { try { - DynawoUtil.writeIidm(network, workingDir.resolve(DynawoSimulationConstants.NETWORK_FILENAME)); + DynawoUtil.writeIidm(network, workingDir.resolve(NETWORK_FILENAME)); JobsXml.write(workingDir, context); DydXml.write(workingDir, context); ParametersXml.write(workingDir, context); diff --git a/dynawo-security-analysis/src/main/java/com/powsybl/dynawo/security/DynawoSecurityAnalysisProvider.java b/dynawo-security-analysis/src/main/java/com/powsybl/dynawo/security/DynawoSecurityAnalysisProvider.java index 3dcd4271e..273bc7817 100644 --- a/dynawo-security-analysis/src/main/java/com/powsybl/dynawo/security/DynawoSecurityAnalysisProvider.java +++ b/dynawo-security-analysis/src/main/java/com/powsybl/dynawo/security/DynawoSecurityAnalysisProvider.java @@ -20,7 +20,7 @@ import com.powsybl.dynawo.DynawoSimulationProvider; import com.powsybl.dynawo.commons.DynawoVersion; import com.powsybl.dynawo.models.utils.BlackBoxSupplierUtils; -import com.powsybl.dynawo.xml.DynawoSimulationConstants; +import com.powsybl.dynawo.DynawoSimulationConstants; import com.powsybl.dynawo.commons.DynawoUtil; import com.powsybl.dynawo.commons.PowsyblDynawoVersion; import com.powsybl.iidm.network.Network; diff --git a/dynawo-security-analysis/src/main/java/com/powsybl/dynawo/security/xml/MultipleJobsXml.java b/dynawo-security-analysis/src/main/java/com/powsybl/dynawo/security/xml/MultipleJobsXml.java index 892c8ebbf..e98a507c5 100644 --- a/dynawo-security-analysis/src/main/java/com/powsybl/dynawo/security/xml/MultipleJobsXml.java +++ b/dynawo-security-analysis/src/main/java/com/powsybl/dynawo/security/xml/MultipleJobsXml.java @@ -16,8 +16,8 @@ import java.nio.file.Path; import java.util.Objects; -import static com.powsybl.dynawo.xml.DynawoSimulationConstants.JOBS_FILENAME; -import static com.powsybl.dynawo.xml.DynawoSimulationConstants.MULTIPLE_JOBS_FILENAME; +import static com.powsybl.dynawo.DynawoSimulationConstants.JOBS_FILENAME; +import static com.powsybl.dynawo.DynawoSimulationConstants.MULTIPLE_JOBS_FILENAME; /** * @author Laurent Issertial diff --git a/dynawo-security-analysis/src/test/java/com/powsybl/dynawo/security/xml/MultiplesJobsXmlTest.java b/dynawo-security-analysis/src/test/java/com/powsybl/dynawo/security/xml/MultiplesJobsXmlTest.java index 91c35df11..7aac2307a 100644 --- a/dynawo-security-analysis/src/test/java/com/powsybl/dynawo/security/xml/MultiplesJobsXmlTest.java +++ b/dynawo-security-analysis/src/test/java/com/powsybl/dynawo/security/xml/MultiplesJobsXmlTest.java @@ -10,7 +10,7 @@ import com.powsybl.contingency.Contingency; import com.powsybl.dynawo.DynawoSimulationParameters; import com.powsybl.dynawo.security.SecurityAnalysisContext; -import com.powsybl.dynawo.xml.DynawoSimulationConstants; +import com.powsybl.dynawo.DynawoSimulationConstants; import com.powsybl.dynawo.xml.DynawoTestUtil; import com.powsybl.security.dynamic.DynamicSecurityAnalysisParameters; import org.junit.jupiter.api.Test; diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/DynawoSimulationConstants.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/DynawoSimulationConstants.java index b821f29c8..e75fe6a99 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/DynawoSimulationConstants.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/DynawoSimulationConstants.java @@ -1,20 +1,40 @@ /** - * Copyright (c) 2024, RTE (http://www.rte-france.com) + * Copyright (c) 2020, RTE (http://www.rte-france.com) * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * SPDX-License-Identifier: MPL-2.0 */ package com.powsybl.dynawo; /** - * @author Laurent Issertial + * @author Marcos de Miguel {@literal } */ public final class DynawoSimulationConstants { + public static final String JOBS_FILENAME = "powsybl_dynawo.jobs"; + + public static final String DYD_FILENAME = "powsybl_dynawo.dyd"; + + public static final String CRV_FILENAME = "powsybl_dynawo.crv"; + + public static final String FSV_FILENAME = "powsybl_dynawo.fsv"; + + public static final String CURVES_OUTPUT_PATH = "curves"; + + public static final String CURVES_FILENAME = "curves.csv"; + + public static final String FSV_OUTPUT_PATH = "finalStateValues"; + + public static final String FSV_OUTPUT_FILENAME = "finalStateValues.csv"; + + public static final String MULTIPLE_JOBS_FILENAME = "multiple_jobs.xml"; + + public static final String AGGREGATED_RESULTS = "aggregatedResults.xml"; + + public static final String LOGS_FOLDER = "logs"; + + public static final String LOGS_FILENAME = "dynawo.log"; + private DynawoSimulationConstants() { } - - public static final String OUTPUTS_FOLDER = "outputs"; - public static final String FINAL_STATE_FOLDER = "finalState"; } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/DynawoSimulationHandler.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/DynawoSimulationHandler.java index b224e70b6..0e02d32d2 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/DynawoSimulationHandler.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/DynawoSimulationHandler.java @@ -16,6 +16,7 @@ import com.powsybl.dynamicsimulation.DynamicSimulationResult; import com.powsybl.dynamicsimulation.DynamicSimulationResultImpl; import com.powsybl.dynamicsimulation.TimelineEvent; +import com.powsybl.dynawo.commons.ExportMode; import com.powsybl.dynawo.outputvariables.CsvFsvParser; import com.powsybl.dynawo.xml.OutputVariablesXml; import com.powsybl.dynawo.xml.DydXml; @@ -46,10 +47,8 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import static com.powsybl.dynawo.DynawoSimulationConstants.FINAL_STATE_FOLDER; -import static com.powsybl.dynawo.DynawoSimulationConstants.OUTPUTS_FOLDER; -import static com.powsybl.dynawo.xml.DynawoSimulationConstants.*; -import static com.powsybl.dynawo.commons.DynawoConstants.DYNAWO_TIMELINE_FOLDER; +import static com.powsybl.dynawo.DynawoSimulationConstants.*; +import static com.powsybl.dynawo.commons.DynawoConstants.*; import static com.powsybl.dynawo.commons.DynawoUtil.getCommandExecutions; /** @@ -58,11 +57,7 @@ public final class DynawoSimulationHandler extends AbstractExecutionHandler { private static final Logger LOGGER = LoggerFactory.getLogger(DynawoSimulationHandler.class); - private static final String LOGS_FOLDER = "logs"; - private static final String OUTPUT_IIDM_FILENAME = "outputIIDM.xml"; private static final String OUTPUT_DUMP_FILENAME = "outputState.dmp"; - private static final String TIMELINE_FILENAME = "timeline"; - private static final String LOGS_FILENAME = "dynawo.log"; private static final String ERROR_FILENAME = "dyn_fs_0.err"; private static final String DYNAWO_ERROR_PATTERN = "DYN Error: "; @@ -177,8 +172,8 @@ private void setDumpFile(Path outputsFolder, Path dumpFileFolder, Path fileName) } private void setTimeline(Path outputsFolder) { - DynawoSimulationParameters.ExportMode exportMode = context.getDynawoSimulationParameters().getTimelineExportMode(); - Path timelineFile = outputsFolder.resolve(DYNAWO_TIMELINE_FOLDER).resolve(TIMELINE_FILENAME + exportMode.getFileExtension()); + ExportMode exportMode = context.getDynawoSimulationParameters().getTimelineExportMode(); + Path timelineFile = outputsFolder.resolve(TIMELINE_FOLDER).resolve(TIMELINE_FILENAME + exportMode.getFileExtension()); if (Files.exists(timelineFile)) { TimeLineParser parser = switch (exportMode) { case CSV -> new CsvTimeLineParser(';'); diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/DynawoSimulationParameters.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/DynawoSimulationParameters.java index 8dd1eec26..69e739e32 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/DynawoSimulationParameters.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/DynawoSimulationParameters.java @@ -14,6 +14,7 @@ import com.powsybl.commons.config.PlatformConfig; import com.powsybl.commons.extensions.AbstractExtension; import com.powsybl.dynamicsimulation.DynamicSimulationParameters; +import com.powsybl.dynawo.commons.ExportMode; import com.powsybl.dynawo.parameters.ParametersSet; import com.powsybl.dynawo.xml.ParametersXml; @@ -60,22 +61,6 @@ public enum SolverType { IDA } - public enum ExportMode { - CSV(".csv"), - TXT(".log"), - XML(".xml"); - - private final String fileExtension; - - ExportMode(String fileExtension) { - this.fileExtension = fileExtension; - } - - public String getFileExtension() { - return fileExtension; - } - } - public enum LogLevel { DEBUG, INFO, diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/DynawoSimulationProvider.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/DynawoSimulationProvider.java index eb2245125..a68a329b0 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/DynawoSimulationProvider.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/DynawoSimulationProvider.java @@ -22,7 +22,7 @@ import java.util.Objects; import java.util.concurrent.CompletableFuture; -import static com.powsybl.dynawo.xml.DynawoSimulationConstants.JOBS_FILENAME; +import static com.powsybl.dynawo.DynawoSimulationConstants.JOBS_FILENAME; /** * @author Marcos de Miguel {@literal } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/xml/DydXml.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/xml/DydXml.java index 79ede7cd3..330ac5ed2 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/xml/DydXml.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/xml/DydXml.java @@ -17,7 +17,7 @@ import java.io.IOException; import java.nio.file.Path; -import static com.powsybl.dynawo.xml.DynawoSimulationConstants.DYD_FILENAME; +import static com.powsybl.dynawo.DynawoSimulationConstants.DYD_FILENAME; /** * @author Mathieu Bague {@literal } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/xml/DynawoSimulationConstants.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/xml/DynawoSimulationConstants.java deleted file mode 100644 index 8fe746bd8..000000000 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/xml/DynawoSimulationConstants.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Copyright (c) 2020, RTE (http://www.rte-france.com) - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ -package com.powsybl.dynawo.xml; - -/** - * @author Marcos de Miguel {@literal } - */ -public final class DynawoSimulationConstants { - - public static final String JOBS_FILENAME = "powsybl_dynawo.jobs"; - - public static final String NETWORK_FILENAME = "powsybl_dynawo.xiidm"; - - public static final String DYD_FILENAME = "powsybl_dynawo.dyd"; - - public static final String CRV_FILENAME = "powsybl_dynawo.crv"; - - public static final String FSV_FILENAME = "powsybl_dynawo.fsv"; - - public static final String CURVES_OUTPUT_PATH = "curves"; - - public static final String CURVES_FILENAME = "curves.csv"; - - public static final String FSV_OUTPUT_PATH = "finalStateValues"; - - public static final String FSV_OUTPUT_FILENAME = "finalStateValues.csv"; - - public static final String MULTIPLE_JOBS_FILENAME = "multiple_jobs.xml"; - - public static final String AGGREGATED_RESULTS = "aggregatedResults.xml"; - - private DynawoSimulationConstants() { - } -} diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/xml/JobsXml.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/xml/JobsXml.java index e78a60af1..35b3ef86e 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/xml/JobsXml.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/xml/JobsXml.java @@ -11,6 +11,7 @@ import com.powsybl.dynawo.DynawoSimulationContext; import com.powsybl.dynawo.DynawoSimulationParameters; import com.powsybl.dynawo.DynawoSimulationParameters.SolverType; +import com.powsybl.dynawo.commons.ExportMode; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; @@ -18,7 +19,9 @@ import java.nio.file.Path; import java.util.Optional; -import static com.powsybl.dynawo.xml.DynawoSimulationConstants.*; +import static com.powsybl.dynawo.DynawoSimulationConstants.*; +import static com.powsybl.dynawo.commons.DynawoConstants.NETWORK_FILENAME; +import static com.powsybl.dynawo.commons.DynawoConstants.OUTPUTS_FOLDER; import static com.powsybl.dynawo.xml.DynawoSimulationXmlConstants.DYN_URI; /** @@ -102,7 +105,7 @@ private static void writeSimulation(XMLStreamWriter writer, DynawoSimulationPara private static void writeOutput(XMLStreamWriter writer, DynawoSimulationContext context) throws XMLStreamException { DynawoSimulationParameters parameters = context.getDynawoSimulationParameters(); writer.writeStartElement(DYN_URI, "outputs"); - writer.writeAttribute("directory", "outputs"); + writer.writeAttribute("directory", OUTPUTS_FOLDER); writer.writeEmptyElement(DYN_URI, "dumpInitValues"); writer.writeAttribute("local", Boolean.toString(false)); @@ -118,13 +121,13 @@ private static void writeOutput(XMLStreamWriter writer, DynawoSimulationContext if (context.withCurveVariables()) { writer.writeEmptyElement(DYN_URI, "curves"); writer.writeAttribute("inputFile", CRV_FILENAME); - writer.writeAttribute(EXPORT_MODE, DynawoSimulationParameters.ExportMode.CSV.toString()); + writer.writeAttribute(EXPORT_MODE, ExportMode.CSV.toString()); } if (context.withFsvVariables()) { writer.writeEmptyElement(DYN_URI, "finalStateValues"); writer.writeAttribute("inputFile", FSV_FILENAME); - writer.writeAttribute(EXPORT_MODE, DynawoSimulationParameters.ExportMode.CSV.toString()); + writer.writeAttribute(EXPORT_MODE, ExportMode.CSV.toString()); } writer.writeStartElement(DYN_URI, "logs"); @@ -137,7 +140,7 @@ private static void writeOutput(XMLStreamWriter writer, DynawoSimulationContext private static void writeAppender(XMLStreamWriter writer, DynawoSimulationParameters parameters) throws XMLStreamException { writer.writeEmptyElement(DYN_URI, "appender"); writer.writeAttribute("tag", ""); - writer.writeAttribute("file", "dynawo.log"); + writer.writeAttribute("file", LOGS_FILENAME); writer.writeAttribute("lvlFilter", parameters.getLogLevelFilter().toString()); for (DynawoSimulationParameters.SpecificLog log : parameters.getSpecificLogs()) { writeSpecificAppender(writer, log); diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/xml/OutputVariablesXml.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/xml/OutputVariablesXml.java index 569ebe6f1..2df3504fb 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/xml/OutputVariablesXml.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/xml/OutputVariablesXml.java @@ -14,8 +14,8 @@ import java.io.IOException; import java.nio.file.Path; -import static com.powsybl.dynawo.xml.DynawoSimulationConstants.CRV_FILENAME; -import static com.powsybl.dynawo.xml.DynawoSimulationConstants.FSV_FILENAME; +import static com.powsybl.dynawo.DynawoSimulationConstants.CRV_FILENAME; +import static com.powsybl.dynawo.DynawoSimulationConstants.FSV_FILENAME; import static com.powsybl.dynawo.xml.DynawoSimulationXmlConstants.DYN_URI; /** diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/DynawoParametersTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/DynawoParametersTest.java index 462a47e28..f0c204e29 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/DynawoParametersTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/DynawoParametersTest.java @@ -12,10 +12,10 @@ import com.powsybl.commons.test.AbstractSerDeTest; import com.powsybl.dynamicsimulation.DynamicSimulationParameters; import com.powsybl.dynamicsimulation.json.JsonDynamicSimulationParameters; -import com.powsybl.dynawo.DynawoSimulationParameters.ExportMode; import com.powsybl.dynawo.DynawoSimulationParameters.LogLevel; import com.powsybl.dynawo.DynawoSimulationParameters.SolverType; import com.powsybl.dynawo.DynawoSimulationParameters.SpecificLog; +import com.powsybl.dynawo.commons.ExportMode; import com.powsybl.dynawo.parameters.Parameter; import com.powsybl.dynawo.parameters.ParameterType; import com.powsybl.dynawo.xml.ParametersXml; diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/DynawoProviderTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/DynawoProviderTest.java index cb584114c..7b0db122c 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/DynawoProviderTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/DynawoProviderTest.java @@ -35,6 +35,7 @@ import static com.powsybl.commons.report.ReportNode.NO_OP; import static com.powsybl.dynamicsimulation.DynamicSimulationResult.Status.FAILURE; +import static com.powsybl.dynawo.commons.DynawoConstants.*; import static org.junit.jupiter.api.Assertions.*; /** @@ -43,7 +44,6 @@ */ class DynawoProviderTest extends AbstractSerDeTest { - private static final String OUTPUT_IIDM_FILENAME = "outputIIDM.xml"; private DynawoSimulationConfig config; @BeforeEach @@ -74,8 +74,8 @@ public LocalCommandExecutorMock(String stdOutFileRef, String outputIidm) { public int execute(String program, List args, Path outFile, Path errFile, Path workingDir, Map env) { try { copyFile(stdOutFileRef, outFile); - Files.createDirectories(workingDir.resolve("outputs").resolve("finalState")); - copyFile(outputIidm, workingDir.resolve("outputs").resolve("finalState").resolve(OUTPUT_IIDM_FILENAME)); + Path finalState = Files.createDirectories(workingDir.resolve(OUTPUTS_FOLDER).resolve(FINAL_STATE_FOLDER)); + copyFile(outputIidm, finalState.resolve(OUTPUT_IIDM_FILENAME)); return 0; } catch (IOException e) { throw new UncheckedIOException(e); diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/ActivePowerVariationEventXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/ActivePowerVariationEventXmlTest.java index 7c962babf..a21daa3a1 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/ActivePowerVariationEventXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/ActivePowerVariationEventXmlTest.java @@ -7,6 +7,7 @@ */ package com.powsybl.dynawo.xml; +import com.powsybl.dynawo.DynawoSimulationConstants; import com.powsybl.dynawo.models.events.EventActivePowerVariationBuilder; import com.powsybl.dynawo.models.loads.BaseLoadBuilder; import com.powsybl.dynawo.models.generators.SynchronizedGeneratorBuilder; diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/BaseGeneratorModelXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/BaseGeneratorModelXmlTest.java index 3443a34c7..df8ce260d 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/BaseGeneratorModelXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/BaseGeneratorModelXmlTest.java @@ -7,6 +7,7 @@ */ package com.powsybl.dynawo.xml; +import com.powsybl.dynawo.DynawoSimulationConstants; import com.powsybl.dynawo.models.generators.BaseGeneratorBuilder; import com.powsybl.iidm.network.test.EurostagTutorialExample1Factory; import org.junit.jupiter.api.Test; diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DisconnectBranchEventXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DisconnectBranchEventXmlTest.java index d20a59408..72774d54d 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DisconnectBranchEventXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DisconnectBranchEventXmlTest.java @@ -7,6 +7,7 @@ */ package com.powsybl.dynawo.xml; +import com.powsybl.dynawo.DynawoSimulationConstants; import com.powsybl.dynawo.models.events.EventDisconnectionBuilder; import com.powsybl.iidm.network.TwoSides; import com.powsybl.iidm.network.test.EurostagTutorialExample1Factory; diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DisconnectEventXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DisconnectEventXmlTest.java index 0f3051068..bcbb5baa9 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DisconnectEventXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DisconnectEventXmlTest.java @@ -7,6 +7,7 @@ */ package com.powsybl.dynawo.xml; +import com.powsybl.dynawo.DynawoSimulationConstants; import com.powsybl.dynawo.models.events.EventDisconnectionBuilder; import com.powsybl.dynawo.models.generators.BaseGeneratorBuilder; import com.powsybl.dynawo.models.shunts.BaseShuntBuilder; diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DisconnectHvdcEventXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DisconnectHvdcEventXmlTest.java index 08857d5d9..02a3b5604 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DisconnectHvdcEventXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DisconnectHvdcEventXmlTest.java @@ -7,6 +7,7 @@ */ package com.powsybl.dynawo.xml; +import com.powsybl.dynawo.DynawoSimulationConstants; import com.powsybl.dynawo.models.events.EventDisconnectionBuilder; import com.powsybl.dynawo.models.hvdc.HvdcPBuilder; import com.powsybl.dynawo.models.hvdc.HvdcVscBuilder; diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DynamicModelsXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DynamicModelsXmlTest.java index 02a601bd9..df078a515 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DynamicModelsXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DynamicModelsXmlTest.java @@ -9,6 +9,7 @@ import com.powsybl.commons.PowsyblException; import com.powsybl.commons.report.ReportNode; import com.powsybl.dynamicsimulation.DynamicSimulationParameters; +import com.powsybl.dynawo.DynawoSimulationConstants; import com.powsybl.dynawo.DynawoSimulationContext; import com.powsybl.dynawo.DynawoSimulationParameters; import com.powsybl.dynawo.commons.DynawoVersion; diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DynamicOverloadManagementSystemModelXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DynamicOverloadManagementSystemModelXmlTest.java index 86695a7b9..5e4c7c4e1 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DynamicOverloadManagementSystemModelXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DynamicOverloadManagementSystemModelXmlTest.java @@ -7,6 +7,7 @@ */ package com.powsybl.dynawo.xml; +import com.powsybl.dynawo.DynawoSimulationConstants; import com.powsybl.dynawo.models.transformers.TransformerFixedRatioBuilder; import com.powsybl.dynawo.models.automationsystems.overloadmanagments.DynamicOverloadManagementSystemBuilder; import com.powsybl.iidm.network.TwoSides; diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DynamicTwoLevelsOverloadManagementSystemModelXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DynamicTwoLevelsOverloadManagementSystemModelXmlTest.java index ad05587f0..cd5dcc7b2 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DynamicTwoLevelsOverloadManagementSystemModelXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DynamicTwoLevelsOverloadManagementSystemModelXmlTest.java @@ -7,6 +7,7 @@ */ package com.powsybl.dynawo.xml; +import com.powsybl.dynawo.DynawoSimulationConstants; import com.powsybl.dynawo.models.automationsystems.overloadmanagments.DynamicTwoLevelsOverloadManagementSystemBuilder; import com.powsybl.iidm.network.TwoSides; import com.powsybl.iidm.network.test.EurostagTutorialExample1Factory; diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/EmptyPhaseShifterBlockingIXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/EmptyPhaseShifterBlockingIXmlTest.java index 3d8bb13a5..d1f2ecf5b 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/EmptyPhaseShifterBlockingIXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/EmptyPhaseShifterBlockingIXmlTest.java @@ -7,6 +7,7 @@ */ package com.powsybl.dynawo.xml; +import com.powsybl.dynawo.DynawoSimulationConstants; import com.powsybl.dynawo.models.automationsystems.phaseshifters.PhaseShifterBlockingIAutomationSystemBuilder; import com.powsybl.dynawo.models.automationsystems.phaseshifters.PhaseShifterIAutomationSystemBuilder; import com.powsybl.iidm.network.test.EurostagTutorialExample1Factory; diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/EmptyTapChangerAutomationSystemXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/EmptyTapChangerAutomationSystemXmlTest.java index c1f4d73d7..25bf3939a 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/EmptyTapChangerAutomationSystemXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/EmptyTapChangerAutomationSystemXmlTest.java @@ -7,6 +7,7 @@ */ package com.powsybl.dynawo.xml; +import com.powsybl.dynawo.DynawoSimulationConstants; import com.powsybl.dynawo.models.automationsystems.TapChangerAutomationSystemBuilder; import com.powsybl.dynawo.models.loads.BaseLoadBuilder; import com.powsybl.iidm.network.test.EurostagTutorialExample1Factory; diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/EmptyTapChangerBlockingAutomationSystemXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/EmptyTapChangerBlockingAutomationSystemXmlTest.java index 926248298..4eef78aa2 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/EmptyTapChangerBlockingAutomationSystemXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/EmptyTapChangerBlockingAutomationSystemXmlTest.java @@ -7,6 +7,7 @@ */ package com.powsybl.dynawo.xml; +import com.powsybl.dynawo.DynawoSimulationConstants; import com.powsybl.dynawo.models.automationsystems.TapChangerAutomationSystemBuilder; import com.powsybl.dynawo.models.automationsystems.TapChangerBlockingAutomationSystemBuilder; import com.powsybl.dynawo.models.loads.LoadOneTransformerBuilder; diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/EventXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/EventXmlTest.java index e2c58f790..9d2370c5b 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/EventXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/EventXmlTest.java @@ -7,6 +7,7 @@ package com.powsybl.dynawo.xml; import com.powsybl.dynamicsimulation.DynamicSimulationParameters; +import com.powsybl.dynawo.DynawoSimulationConstants; import com.powsybl.dynawo.DynawoSimulationContext; import com.powsybl.dynawo.DynawoSimulationParameters; import com.powsybl.dynawo.models.BlackBoxModel; diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/HvdcXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/HvdcXmlTest.java index ce1016806..a38607dff 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/HvdcXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/HvdcXmlTest.java @@ -7,6 +7,7 @@ */ package com.powsybl.dynawo.xml; +import com.powsybl.dynawo.DynawoSimulationConstants; import com.powsybl.dynawo.models.hvdc.HvdcPBuilder; import com.powsybl.dynawo.models.hvdc.HvdcVscBuilder; import com.powsybl.dynawo.models.BlackBoxModel; diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/JobsXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/JobsXmlTest.java index fdb4c98ac..24121c1fe 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/JobsXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/JobsXmlTest.java @@ -8,6 +8,7 @@ import com.powsybl.dynamicsimulation.DynamicSimulationParameters; import com.powsybl.dynawo.DumpFileParameters; +import com.powsybl.dynawo.DynawoSimulationConstants; import com.powsybl.dynawo.DynawoSimulationContext; import com.powsybl.dynawo.DynawoSimulationParameters; import org.junit.jupiter.params.ParameterizedTest; diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/LoadsModelXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/LoadsModelXmlTest.java index 48f4ab0e0..d74c8877f 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/LoadsModelXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/LoadsModelXmlTest.java @@ -7,6 +7,7 @@ */ package com.powsybl.dynawo.xml; +import com.powsybl.dynawo.DynawoSimulationConstants; import com.powsybl.dynawo.models.BlackBoxModel; import com.powsybl.dynawo.models.loads.*; import com.powsybl.iidm.network.Network; diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/NodeFaultEventXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/NodeFaultEventXmlTest.java index ac34e76be..81256e5aa 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/NodeFaultEventXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/NodeFaultEventXmlTest.java @@ -7,6 +7,7 @@ */ package com.powsybl.dynawo.xml; +import com.powsybl.dynawo.DynawoSimulationConstants; import com.powsybl.dynawo.models.events.NodeFaultEventBuilder; import com.powsybl.iidm.network.test.EurostagTutorialExample1Factory; import org.junit.jupiter.api.Test; diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/OmegaRefModelXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/OmegaRefModelXmlTest.java index 61e8faa6c..41a179667 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/OmegaRefModelXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/OmegaRefModelXmlTest.java @@ -7,6 +7,7 @@ */ package com.powsybl.dynawo.xml; +import com.powsybl.dynawo.DynawoSimulationConstants; import com.powsybl.dynawo.models.generators.SynchronizedGeneratorBuilder; import com.powsybl.dynawo.models.generators.SynchronousGeneratorBuilder; import com.powsybl.iidm.network.test.EurostagTutorialExample1Factory; diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/OutputVariablesXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/OutputVariablesXmlTest.java index 7cc50512e..2129a2f68 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/OutputVariablesXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/OutputVariablesXmlTest.java @@ -7,6 +7,7 @@ package com.powsybl.dynawo.xml; import com.powsybl.dynamicsimulation.DynamicSimulationParameters; +import com.powsybl.dynawo.DynawoSimulationConstants; import com.powsybl.dynawo.DynawoSimulationContext; import com.powsybl.dynawo.DynawoSimulationParameters; import org.junit.jupiter.api.Test; diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/PhaseShifterBlockingIXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/PhaseShifterBlockingIXmlTest.java index 91aef6f4b..fa59ce4cb 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/PhaseShifterBlockingIXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/PhaseShifterBlockingIXmlTest.java @@ -7,6 +7,7 @@ */ package com.powsybl.dynawo.xml; +import com.powsybl.dynawo.DynawoSimulationConstants; import com.powsybl.dynawo.models.automationsystems.phaseshifters.PhaseShifterBlockingIAutomationSystemBuilder; import com.powsybl.dynawo.models.automationsystems.phaseshifters.PhaseShifterIAutomationSystemBuilder; import com.powsybl.iidm.network.test.EurostagTutorialExample1Factory; diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/PhaseShiftersXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/PhaseShiftersXmlTest.java index e451a9055..19c909bfb 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/PhaseShiftersXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/PhaseShiftersXmlTest.java @@ -7,6 +7,7 @@ */ package com.powsybl.dynawo.xml; +import com.powsybl.dynawo.DynawoSimulationConstants; import com.powsybl.dynawo.models.transformers.TransformerFixedRatioBuilder; import com.powsybl.dynawo.models.BlackBoxModel; import com.powsybl.dynawo.models.automationsystems.phaseshifters.PhaseShifterIAutomationSystemBuilder; diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/SetPointInfiniteBusModelXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/SetPointInfiniteBusModelXmlTest.java index cc82f66b9..5a85a1dba 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/SetPointInfiniteBusModelXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/SetPointInfiniteBusModelXmlTest.java @@ -7,6 +7,7 @@ */ package com.powsybl.dynawo.xml; +import com.powsybl.dynawo.DynawoSimulationConstants; import com.powsybl.dynawo.models.buses.InfiniteBusBuilder; import com.powsybl.dynawo.models.generators.SynchronizedGeneratorBuilder; import com.powsybl.dynawo.models.transformers.TransformerFixedRatioBuilder; diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/ShuntModelXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/ShuntModelXmlTest.java index 68e976969..2363a3756 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/ShuntModelXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/ShuntModelXmlTest.java @@ -7,6 +7,7 @@ */ package com.powsybl.dynawo.xml; +import com.powsybl.dynawo.DynawoSimulationConstants; import com.powsybl.dynawo.models.shunts.BaseShuntBuilder; import com.powsybl.iidm.network.test.ShuntTestCaseFactory; import org.junit.jupiter.api.Test; diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/SignalNXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/SignalNXmlTest.java index a51e0864e..a01674a56 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/SignalNXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/SignalNXmlTest.java @@ -7,6 +7,7 @@ */ package com.powsybl.dynawo.xml; +import com.powsybl.dynawo.DynawoSimulationConstants; import com.powsybl.dynawo.models.generators.SignalNGeneratorBuilder; import com.powsybl.iidm.network.test.EurostagTutorialExample1Factory; import org.junit.jupiter.api.Test; diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/SvarcModelWithSbaXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/SvarcModelWithSbaXmlTest.java index 293daa8aa..c44b6633a 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/SvarcModelWithSbaXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/SvarcModelWithSbaXmlTest.java @@ -7,6 +7,7 @@ */ package com.powsybl.dynawo.xml; +import com.powsybl.dynawo.DynawoSimulationConstants; import com.powsybl.dynawo.models.svarcs.BaseStaticVarCompensatorBuilder; import com.powsybl.iidm.network.extensions.StandbyAutomatonAdder; import com.powsybl.iidm.network.test.SvcTestCaseFactory; diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/SvarcModelXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/SvarcModelXmlTest.java index 83a747299..6ab88b8c4 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/SvarcModelXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/SvarcModelXmlTest.java @@ -7,6 +7,7 @@ */ package com.powsybl.dynawo.xml; +import com.powsybl.dynawo.DynawoSimulationConstants; import com.powsybl.dynawo.models.svarcs.BaseStaticVarCompensatorBuilder; import com.powsybl.iidm.network.test.SvcTestCaseFactory; import org.junit.jupiter.api.Test; diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/TapChangerAutomationSystemXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/TapChangerAutomationSystemXmlTest.java index e04f9dddc..b527d9c17 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/TapChangerAutomationSystemXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/TapChangerAutomationSystemXmlTest.java @@ -7,6 +7,7 @@ */ package com.powsybl.dynawo.xml; +import com.powsybl.dynawo.DynawoSimulationConstants; import com.powsybl.dynawo.models.TransformerSide; import com.powsybl.dynawo.models.automationsystems.TapChangerAutomationSystemBuilder; import com.powsybl.dynawo.models.loads.LoadOneTransformerBuilder; diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/TapChangerBlockingAutomationSystemXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/TapChangerBlockingAutomationSystemXmlTest.java index aaa1f105e..a34f9248b 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/TapChangerBlockingAutomationSystemXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/TapChangerBlockingAutomationSystemXmlTest.java @@ -8,6 +8,7 @@ package com.powsybl.dynawo.xml; import com.powsybl.commons.PowsyblException; +import com.powsybl.dynawo.DynawoSimulationConstants; import com.powsybl.dynawo.models.loads.LoadOneTransformerTapChangerBuilder; import com.powsybl.dynawo.models.loads.LoadTwoTransformersTapChangersBuilder; import com.powsybl.dynawo.models.transformers.TransformerFixedRatioBuilder; diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/TapChangerBlockingToTapChangerAutomationSystemXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/TapChangerBlockingToTapChangerAutomationSystemXmlTest.java index ec8e3bf3f..c0faa29de 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/TapChangerBlockingToTapChangerAutomationSystemXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/TapChangerBlockingToTapChangerAutomationSystemXmlTest.java @@ -7,6 +7,7 @@ */ package com.powsybl.dynawo.xml; +import com.powsybl.dynawo.DynawoSimulationConstants; import com.powsybl.dynawo.models.automationsystems.TapChangerBlockingAutomationSystemBuilder; import org.junit.jupiter.api.Test; import org.xml.sax.SAXException; diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/TransformerModelXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/TransformerModelXmlTest.java index 6808221b1..289b311fe 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/TransformerModelXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/TransformerModelXmlTest.java @@ -7,6 +7,7 @@ */ package com.powsybl.dynawo.xml; +import com.powsybl.dynawo.DynawoSimulationConstants; import com.powsybl.dynawo.models.transformers.TransformerFixedRatioBuilder; import com.powsybl.iidm.network.test.EurostagTutorialExample1Factory; import org.junit.jupiter.api.Test; diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/UnderVoltageAutomationSystemXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/UnderVoltageAutomationSystemXmlTest.java index fd79320f7..fab55a093 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/UnderVoltageAutomationSystemXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/UnderVoltageAutomationSystemXmlTest.java @@ -7,6 +7,7 @@ */ package com.powsybl.dynawo.xml; +import com.powsybl.dynawo.DynawoSimulationConstants; import com.powsybl.dynawo.models.automationsystems.UnderVoltageAutomationSystemBuilder; import com.powsybl.iidm.network.test.EurostagTutorialExample1Factory; import org.junit.jupiter.api.Test; diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/WeccGenXmlTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/WeccGenXmlTest.java index ccd88aa58..b83a3d3db 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/WeccGenXmlTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/WeccGenXmlTest.java @@ -7,6 +7,7 @@ */ package com.powsybl.dynawo.xml; +import com.powsybl.dynawo.DynawoSimulationConstants; import com.powsybl.dynawo.models.generators.GridFormingConverterBuilder; import com.powsybl.dynawo.models.BlackBoxModel; import com.powsybl.dynawo.models.generators.WeccBuilder;