Skip to content

Commit

Permalink
#810 Addition of tests with a zip archive in input for N, SA and NSA …
Browse files Browse the repository at this point in the history
…modes

Signed-off-by: Dimitri Baron <[email protected]>
  • Loading branch information
barondim committed Jan 14, 2025
1 parent efc0b5b commit c1922bc
Show file tree
Hide file tree
Showing 187 changed files with 351,172 additions and 44 deletions.
3 changes: 3 additions & 0 deletions cmake/TestMain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
#

set(_command ${EXE} --network=res/TestIIDM_${TEST_NAME}.iidm --config=res/config_${TEST_NAME}.json)
if(${USE_ZIP} STREQUAL "YES")
list(APPEND _command --input-archive=res/${TEST_NAME}.zip)
endif()
message(STATUS "Execute process: ${_command}")
execute_process(COMMAND ${_command} RESULT_VARIABLE _result)
if(_result)
Expand Down
3 changes: 3 additions & 0 deletions cmake/TestMainNSA.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
#

set(_dfl_cmd ${EXE} --network=res/TestIIDM_${TEST_NAME}.iidm --config=res/config_${TEST_NAME}.json --contingencies=res/contingencies_${TEST_NAME}.json --nsa)
if(${USE_ZIP} STREQUAL "YES")
list(APPEND _dfl_cmd --input-archive=res/${TEST_NAME}.zip)
endif()
if(NOT DEFINED USE_MPI OR USE_MPI STREQUAL "")
message(FATAL_ERROR "USE_MPI is not defined")
endif()
Expand Down
3 changes: 3 additions & 0 deletions cmake/TestMainSA.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
#

set(_dfl_cmd ${EXE} --network=res/TestIIDM_${TEST_NAME}.iidm --config=res/config_${TEST_NAME}.json --contingencies=res/contingencies_${TEST_NAME}.json)
if(${USE_ZIP} STREQUAL "YES")
list(APPEND _dfl_cmd --input-archive=res/${TEST_NAME}.zip)
endif()
if(NOT DEFINED USE_MPI OR USE_MPI STREQUAL "")
message(FATAL_ERROR "USE_MPI is not defined")
endif()
Expand Down
1 change: 0 additions & 1 deletion sources/Outputs/include/Dyd.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
#include <DYDMacroStaticReference.h>
#include <boost/shared_ptr.hpp>
#include <string>
#include <unordered_map>
#include <vector>

namespace dfl {
Expand Down
74 changes: 38 additions & 36 deletions tests/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,62 +16,64 @@ DEFINE_TEST(help MAIN COMMAND $<TARGET_FILE:DynaFlowLauncher> --help)

DEFINE_TEST(version MAIN COMMAND $<TARGET_FILE:DynaFlowLauncher> --version)

macro(DEFINE_LAUNCH_TEST _name)
macro(DEFINE_LAUNCH_TEST _name _use_zip)
DEFINE_TEST_FULLENV(${_name} MAIN
COMMAND ${CMAKE_COMMAND}
-DPYTHON_COMMAND=${PYTHON_EXECUTABLE}
-DEXE=$<TARGET_FILE:DynaFlowLauncher>
-DTEST_NAME=${_name}
-DDIFF_SCRIPT=${CMAKE_SOURCE_DIR}/scripts/diff.py
-DUSE_ZIP=${_use_zip}
-P ${CMAKE_SOURCE_DIR}/cmake/TestMain.cmake
)
endmacro()

DEFINE_LAUNCH_TEST(launch)
DEFINE_LAUNCH_TEST(launch_slack)
DEFINE_LAUNCH_TEST(launch_diagram)
DEFINE_LAUNCH_TEST(launch_diagram_tfo)
DEFINE_LAUNCH_TEST(launch NO)
DEFINE_LAUNCH_TEST(launch_archive YES)
DEFINE_LAUNCH_TEST(launch_slack NO)
DEFINE_LAUNCH_TEST(launch_diagram NO)
DEFINE_LAUNCH_TEST(launch_diagram_tfo NO)

DEFINE_LAUNCH_TEST(launch_P)
DEFINE_LAUNCH_TEST(launch_P NO)

DEFINE_LAUNCH_TEST(launch_infinite)
DEFINE_LAUNCH_TEST(launch_infinite NO NO)

DEFINE_LAUNCH_TEST(node_breaker)
DEFINE_LAUNCH_TEST(node_breaker NO)

DEFINE_LAUNCH_TEST(hvdc_line_normal)
DEFINE_LAUNCH_TEST(hvdc_dangling)
DEFINE_LAUNCH_TEST(hvdc)
DEFINE_LAUNCH_TEST(hvdc_HvdcPQProp)
DEFINE_LAUNCH_TEST(hvdc_HvdcPQProp_multiple_bus)
DEFINE_LAUNCH_TEST(hvdc_HvdcPQPropSwitch)
DEFINE_LAUNCH_TEST(hvdc_HvdcPQPropDangling)
DEFINE_LAUNCH_TEST(hvdc_HvdcPV_HvdcPTanPhi)
DEFINE_LAUNCH_TEST(hvdc_HvdcPVDangling_HvdcPTanPhiDangling)
DEFINE_LAUNCH_TEST(hvdc_diagrams)
DEFINE_LAUNCH_TEST(hvdc_diagrams_flat_start)
DEFINE_LAUNCH_TEST(hvdc_HvdcPQProp_diagrams)
DEFINE_LAUNCH_TEST(hvdc_HvdcPQPropDangling_diagrams)
DEFINE_LAUNCH_TEST(hvdc_HvdcPV_HvdcPTanPhi_diagrams)
DEFINE_LAUNCH_TEST(hvdc_HvdcPVDangling_HvdcPTanPhiDangling_diagrams)
DEFINE_LAUNCH_TEST(hvdc_svc)
DEFINE_LAUNCH_TEST(hvdc_svc_side2)
DEFINE_LAUNCH_TEST(hvdc_line_normal NO)
DEFINE_LAUNCH_TEST(hvdc_dangling NO)
DEFINE_LAUNCH_TEST(hvdc NO)
DEFINE_LAUNCH_TEST(hvdc_HvdcPQProp NO)
DEFINE_LAUNCH_TEST(hvdc_HvdcPQProp_multiple_bus NO)
DEFINE_LAUNCH_TEST(hvdc_HvdcPQPropSwitch NO)
DEFINE_LAUNCH_TEST(hvdc_HvdcPQPropDangling NO)
DEFINE_LAUNCH_TEST(hvdc_HvdcPV_HvdcPTanPhi NO)
DEFINE_LAUNCH_TEST(hvdc_HvdcPVDangling_HvdcPTanPhiDangling NO)
DEFINE_LAUNCH_TEST(hvdc_diagrams NO)
DEFINE_LAUNCH_TEST(hvdc_diagrams_flat_start NO)
DEFINE_LAUNCH_TEST(hvdc_HvdcPQProp_diagrams NO)
DEFINE_LAUNCH_TEST(hvdc_HvdcPQPropDangling_diagrams NO)
DEFINE_LAUNCH_TEST(hvdc_HvdcPV_HvdcPTanPhi_diagrams NO)
DEFINE_LAUNCH_TEST(hvdc_HvdcPVDangling_HvdcPTanPhiDangling_diagrams NO)
DEFINE_LAUNCH_TEST(hvdc_svc NO)
DEFINE_LAUNCH_TEST(hvdc_svc_side2 NO)

DEFINE_LAUNCH_TEST(distant_regulation)
DEFINE_LAUNCH_TEST(distant_regulation NO)


DEFINE_LAUNCH_TEST(special_characters)
DEFINE_LAUNCH_TEST(special_characters NO)

DEFINE_LAUNCH_TEST(phase_shifter)
DEFINE_LAUNCH_TEST(phase_shifter NO)

DEFINE_LAUNCH_TEST(launch_fail_generators)
DEFINE_LAUNCH_TEST(launch_fail_generators NO)
## Expected to fail because no generator regulates the voltage in the main connected component
set_tests_properties(MAIN.launch_fail_generators PROPERTIES WILL_FAIL TRUE)

DEFINE_LAUNCH_TEST(no_SVarC_regulation)
DEFINE_LAUNCH_TEST(no_SVarC_regulation NO)

DEFINE_LAUNCH_TEST(launch_svc)
DEFINE_LAUNCH_TEST(launch_svc_network)
DEFINE_LAUNCH_TEST(launch_svc_tfo)
DEFINE_LAUNCH_TEST(launch_svc_infinite)
DEFINE_LAUNCH_TEST(launch_svc_tfo_infinite)
DEFINE_LAUNCH_TEST(launch_svc_regulation)
DEFINE_LAUNCH_TEST(launch_svc NO)
DEFINE_LAUNCH_TEST(launch_svc_network NO)
DEFINE_LAUNCH_TEST(launch_svc_tfo NO)
DEFINE_LAUNCH_TEST(launch_svc_infinite NO)
DEFINE_LAUNCH_TEST(launch_svc_tfo_infinite NO)
DEFINE_LAUNCH_TEST(launch_svc_regulation NO)
26 changes: 26 additions & 0 deletions tests/main/reference/launch_archive/Network.par
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<parametersSet xmlns="http://www.rte-france.com/dynawo">
<set id="Network">
<par name="capacitor_no_reclosing_delay" type="DOUBLE" value="300"/>
<par name="dangling_line_currentLimit_maxTimeOperation" type="DOUBLE" value="90"/>
<par name="line_currentLimit_maxTimeOperation" type="DOUBLE" value="90"/>
<par name="load_Tp" type="DOUBLE" value="90"/>
<par name="load_Tq" type="DOUBLE" value="90"/>
<par name="load_alpha" type="DOUBLE" value="0"/>
<par name="load_alphaLong" type="DOUBLE" value="0"/>
<par name="load_beta" type="DOUBLE" value="0"/>
<par name="load_betaLong" type="DOUBLE" value="0"/>
<par name="load_isControllable" type="BOOL" value="false"/>
<par name="load_isRestorative" type="BOOL" value="false"/>
<par name="load_zPMax" type="DOUBLE" value="100"/>
<par name="load_zQMax" type="DOUBLE" value="100"/>
<par name="reactance_no_reclosing_delay" type="DOUBLE" value="0"/>
<par name="startingPointMode" type="STRING" value="warm"/>
<par name="transformer_currentLimit_maxTimeOperation" type="DOUBLE" value="90"/>
<par name="transformer_t1st_HT" type="DOUBLE" value="60"/>
<par name="transformer_t1st_THT" type="DOUBLE" value="30"/>
<par name="transformer_tNext_HT" type="DOUBLE" value="10"/>
<par name="transformer_tNext_THT" type="DOUBLE" value="10"/>
<par name="transformer_tolV" type="DOUBLE" value="0.014999999700000001"/>
</set>
</parametersSet>
70 changes: 70 additions & 0 deletions tests/main/reference/launch_archive/TestIIDM_launch_archive.dyd
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<dyn:dynamicModelsArchitecture xmlns:dyn="http://www.rte-france.com/dynawo">
<dyn:macroConnector id="GEN_NETWORK_CONNECTOR">
<dyn:connect var1="generator_terminal" var2="@STATIC_ID@@NODE@_ACPIN"/>
<dyn:connect var1="generator_switchOffSignal1" var2="@STATIC_ID@@NODE@_switchOff"/>
</dyn:macroConnector>
<dyn:macroConnector id="GEN_SIGNALN_CONNECTOR">
<dyn:connect var1="generator_N" var2="signalN_N"/>
</dyn:macroConnector>
<dyn:macroConnector id="LOAD_NETWORK_CONNECTOR">
<dyn:connect var1="Ui_value" var2="@STATIC_ID@@NODE@_ACPIN_V_im"/>
<dyn:connect var1="Ur_value" var2="@STATIC_ID@@NODE@_ACPIN_V_re"/>
<dyn:connect var1="Ii_value" var2="@STATIC_ID@@NODE@_ACPIN_i_im"/>
<dyn:connect var1="Ir_value" var2="@STATIC_ID@@NODE@_ACPIN_i_re"/>
<dyn:connect var1="switchOff1_value" var2="@STATIC_ID@@NODE@_switchOff_value"/>
</dyn:macroConnector>
<dyn:macroStaticReference id="GeneratorStaticRef">
<dyn:staticRef var="generator_PGenPu" staticVar="p"/>
<dyn:staticRef var="generator_QGenPu" staticVar="q"/>
<dyn:staticRef var="generator_state" staticVar="state"/>
</dyn:macroStaticReference>
<dyn:macroStaticReference id="LoadRef">
<dyn:staticRef var="PPu_value" staticVar="p"/>
<dyn:staticRef var="QPu_value" staticVar="q"/>
<dyn:staticRef var="state_value" staticVar="state"/>
</dyn:macroStaticReference>
<dyn:blackBoxModel id="Model_Signal_N" lib="SignalN"/>
<dyn:blackBoxModel id="_GEN____1_SM" staticId="_GEN____1_SM" lib="GeneratorPVSignalN" parFile="TestIIDM_launch_archive.par" parId="99c2bba2-a805-50f1-9d84-49b63951bae6">
<dyn:macroStaticRef id="GeneratorStaticRef"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="_GEN____2_SM" staticId="_GEN____2_SM" lib="GeneratorPVSignalN" parFile="TestIIDM_launch_archive.par" parId="8c26fd60-7f94-5b1a-8b7d-fbad7ca3902d">
<dyn:macroStaticRef id="GeneratorStaticRef"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="_GEN____3_SM" staticId="_GEN____3_SM" lib="GeneratorPVSignalN" parFile="TestIIDM_launch_archive.par" parId="57210c3f-56c3-5ec0-adca-9a3ab9caa88d">
<dyn:macroStaticRef id="GeneratorStaticRef"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="_GEN____6_SM" staticId="_GEN____6_SM" lib="GeneratorPVSignalN" parFile="TestIIDM_launch_archive.par" parId="1b13108d-9c1d-5212-b286-f2a17bb5477c">
<dyn:macroStaticRef id="GeneratorStaticRef"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="_GEN____8_SM" staticId="_GEN____8_SM" lib="GeneratorPVSignalN" parFile="TestIIDM_launch_archive.par" parId="decba20f-146d-56a3-848f-6ecf94043607">
<dyn:macroStaticRef id="GeneratorStaticRef"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="_LOAD___2_EC" staticId="_LOAD___2_EC" lib="DYNModelLoadRestorativeWithLimits" parFile="TestIIDM_launch_archive.par" parId="GenericRestorativeLoad">
<dyn:macroStaticRef id="LoadRef"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="_LOAD___3_EC" staticId="_LOAD___3_EC" lib="DYNModelLoadRestorativeWithLimits" parFile="TestIIDM_launch_archive.par" parId="GenericRestorativeLoad">
<dyn:macroStaticRef id="LoadRef"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="_LOAD___4_EC" staticId="_LOAD___4_EC" lib="DYNModelLoadRestorativeWithLimits" parFile="TestIIDM_launch_archive.par" parId="GenericRestorativeLoad">
<dyn:macroStaticRef id="LoadRef"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="_LOAD___5_EC" staticId="_LOAD___5_EC" lib="DYNModelLoadRestorativeWithLimits" parFile="TestIIDM_launch_archive.par" parId="GenericRestorativeLoad">
<dyn:macroStaticRef id="LoadRef"/>
</dyn:blackBoxModel>
<dyn:macroConnect connector="LOAD_NETWORK_CONNECTOR" id1="_LOAD___4_EC" id2="NETWORK"/>
<dyn:macroConnect connector="LOAD_NETWORK_CONNECTOR" id1="_LOAD___2_EC" id2="NETWORK"/>
<dyn:macroConnect connector="LOAD_NETWORK_CONNECTOR" id1="_LOAD___5_EC" id2="NETWORK"/>
<dyn:macroConnect connector="LOAD_NETWORK_CONNECTOR" id1="_LOAD___3_EC" id2="NETWORK"/>
<dyn:macroConnect connector="GEN_NETWORK_CONNECTOR" id1="_GEN____6_SM" id2="NETWORK"/>
<dyn:macroConnect connector="GEN_SIGNALN_CONNECTOR" id1="_GEN____6_SM" id2="Model_Signal_N"/>
<dyn:macroConnect connector="GEN_NETWORK_CONNECTOR" id1="_GEN____8_SM" id2="NETWORK"/>
<dyn:macroConnect connector="GEN_SIGNALN_CONNECTOR" id1="_GEN____8_SM" id2="Model_Signal_N"/>
<dyn:macroConnect connector="GEN_NETWORK_CONNECTOR" id1="_GEN____2_SM" id2="NETWORK"/>
<dyn:macroConnect connector="GEN_SIGNALN_CONNECTOR" id1="_GEN____2_SM" id2="Model_Signal_N"/>
<dyn:macroConnect connector="GEN_NETWORK_CONNECTOR" id1="_GEN____1_SM" id2="NETWORK"/>
<dyn:macroConnect connector="GEN_SIGNALN_CONNECTOR" id1="_GEN____1_SM" id2="Model_Signal_N"/>
<dyn:macroConnect connector="GEN_NETWORK_CONNECTOR" id1="_GEN____3_SM" id2="NETWORK"/>
<dyn:macroConnect connector="GEN_SIGNALN_CONNECTOR" id1="_GEN____3_SM" id2="Model_Signal_N"/>
<dyn:connect id1="Model_Signal_N" var1="signalN_thetaRef" id2="NETWORK" var2="_BUS____4_TN_phi_value"/>
</dyn:dynamicModelsArchitecture>
62 changes: 62 additions & 0 deletions tests/main/reference/launch_archive/TestIIDM_launch_archive.par
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<parametersSet xmlns="http://www.rte-france.com/dynawo">
<macroParameterSet id="macro_signalNGeneratorFixedPRectangular">
<reference type="DOUBLE" name="generator_P0Pu" origData="IIDM" origName="p_pu"/>
<reference type="DOUBLE" name="generator_PMax" origData="IIDM" origName="pMax"/>
<reference type="DOUBLE" name="generator_PMin" origData="IIDM" origName="pMin"/>
<reference type="DOUBLE" name="generator_PNom" origData="IIDM" origName="pMax_pu"/>
<reference type="DOUBLE" name="generator_PRef0Pu" origData="IIDM" origName="targetP_pu"/>
<reference type="DOUBLE" name="generator_Q0Pu" origData="IIDM" origName="q_pu"/>
<reference type="DOUBLE" name="generator_QMax" origData="IIDM" origName="qMax"/>
<reference type="DOUBLE" name="generator_QMin" origData="IIDM" origName="qMin"/>
<reference type="DOUBLE" name="generator_U0Pu" origData="IIDM" origName="v_pu"/>
<reference type="DOUBLE" name="generator_UPhase0" origData="IIDM" origName="angle_pu"/>
<reference type="DOUBLE" name="generator_URef0Pu" origData="IIDM" origName="targetV_pu"/>
<par name="generator_KGover" type="DOUBLE" value="0"/>
<par name="generator_QDeadBandPu" type="DOUBLE" value="0.0001"/>
<par name="generator_UDeadBandPu" type="DOUBLE" value="0.0001"/>
</macroParameterSet>
<macroParameterSet id="macro_signalNGeneratorRectangular">
<reference type="DOUBLE" name="generator_P0Pu" origData="IIDM" origName="p_pu"/>
<reference type="DOUBLE" name="generator_PMax" origData="IIDM" origName="pMax"/>
<reference type="DOUBLE" name="generator_PMin" origData="IIDM" origName="pMin"/>
<reference type="DOUBLE" name="generator_PNom" origData="IIDM" origName="pMax_pu"/>
<reference type="DOUBLE" name="generator_PRef0Pu" origData="IIDM" origName="targetP_pu"/>
<reference type="DOUBLE" name="generator_Q0Pu" origData="IIDM" origName="q_pu"/>
<reference type="DOUBLE" name="generator_QMax" origData="IIDM" origName="qMax"/>
<reference type="DOUBLE" name="generator_QMin" origData="IIDM" origName="qMin"/>
<reference type="DOUBLE" name="generator_U0Pu" origData="IIDM" origName="v_pu"/>
<reference type="DOUBLE" name="generator_UPhase0" origData="IIDM" origName="angle_pu"/>
<reference type="DOUBLE" name="generator_URef0Pu" origData="IIDM" origName="targetV_pu"/>
<par name="generator_KGover" type="DOUBLE" value="1"/>
<par name="generator_QDeadBandPu" type="DOUBLE" value="0.0001"/>
<par name="generator_UDeadBandPu" type="DOUBLE" value="0.0001"/>
</macroParameterSet>
<set id="1b13108d-9c1d-5212-b286-f2a17bb5477c">
<macroParSet id="macro_signalNGeneratorFixedPRectangular"/>
</set>
<set id="57210c3f-56c3-5ec0-adca-9a3ab9caa88d">
<macroParSet id="macro_signalNGeneratorFixedPRectangular"/>
</set>
<set id="8c26fd60-7f94-5b1a-8b7d-fbad7ca3902d">
<macroParSet id="macro_signalNGeneratorRectangular"/>
</set>
<set id="99c2bba2-a805-50f1-9d84-49b63951bae6">
<macroParSet id="macro_signalNGeneratorRectangular"/>
</set>
<set id="GenericRestorativeLoad">
<par name="load_Alpha" type="DOUBLE" value="1.5"/>
<par name="load_Beta" type="DOUBLE" value="2.5"/>
<par name="load_UDeadBandPu" type="DOUBLE" value="0.01"/>
<par name="load_UMax0Pu" type="DOUBLE" value="1.1499999999999999"/>
<par name="load_UMin0Pu" type="DOUBLE" value="0.84999999999999998"/>
<par name="load_tFilter" type="DOUBLE" value="10"/>
<reference type="DOUBLE" name="load_P0Pu" origData="IIDM" origName="p0_pu"/>
<reference type="DOUBLE" name="load_Q0Pu" origData="IIDM" origName="q0_pu"/>
<reference type="DOUBLE" name="load_U0Pu" origData="IIDM" origName="v_pu"/>
<reference type="DOUBLE" name="load_UPhase0" origData="IIDM" origName="angle_pu"/>
</set>
<set id="decba20f-146d-56a3-848f-6ecf94043607">
<macroParSet id="macro_signalNGeneratorFixedPRectangular"/>
</set>
</parametersSet>
4 changes: 4 additions & 0 deletions tests/main/reference/launch_archive/constraints.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<constraints xmlns="http://www.rte-france.com/dynawo">
<constraint modelName="_BUS____1-BUS____2-1_AC" description="permanent limit side 1" time="0" type="Line" kind="PATL" limit="836.74000000000001" value="1248.1004875978369" side="1"/>
</constraints>
2 changes: 2 additions & 0 deletions tests/main/reference/launch_archive/lostEquipments.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<lostEquipments xmlns="http://www.rte-france.com/dynawo"/>
Loading

0 comments on commit c1922bc

Please sign in to comment.