From 114cbfd3b5281b502b0ec15e5ee97f1a302fb78f Mon Sep 17 00:00:00 2001 From: jeandemanged Date: Thu, 25 Apr 2024 15:35:34 +0200 Subject: [PATCH] Fix debugDir parameter possible values (#1021) Signed-off-by: Damien Jeandemange --- .../java/com/powsybl/openloadflow/OpenLoadFlowParameters.java | 2 +- .../com/powsybl/openloadflow/OpenLoadFlowParametersTest.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/OpenLoadFlowParameters.java b/src/main/java/com/powsybl/openloadflow/OpenLoadFlowParameters.java index b64fe9ae1e..f08f6693ad 100644 --- a/src/main/java/com/powsybl/openloadflow/OpenLoadFlowParameters.java +++ b/src/main/java/com/powsybl/openloadflow/OpenLoadFlowParameters.java @@ -279,7 +279,7 @@ private static > List getEnumPossibleValues(Class e new Parameter(SVC_VOLTAGE_MONITORING_PARAM_NAME, ParameterType.BOOLEAN, "SVC voltage monitoring", SVC_VOLTAGE_MONITORING_DEFAULT_VALUE), new Parameter(STATE_VECTOR_SCALING_MODE_PARAM_NAME, ParameterType.STRING, "State vector scaling mode", NewtonRaphsonParameters.DEFAULT_STATE_VECTOR_SCALING_MODE.name(), getEnumPossibleValues(StateVectorScalingMode.class)), new Parameter(MAX_SLACK_BUS_COUNT_PARAM_NAME, ParameterType.INTEGER, "Maximum slack buses count", LfNetworkParameters.DEFAULT_MAX_SLACK_BUS_COUNT), - new Parameter(DEBUG_DIR_PARAM_NAME, ParameterType.STRING, "Directory to dump debug files", LfNetworkParameters.DEBUG_DIR_DEFAULT_VALUE, Collections.emptyList(), ParameterScope.TECHNICAL), + new Parameter(DEBUG_DIR_PARAM_NAME, ParameterType.STRING, "Directory to dump debug files", LfNetworkParameters.DEBUG_DIR_DEFAULT_VALUE, null, ParameterScope.TECHNICAL), new Parameter(INCREMENTAL_TRANSFORMER_RATIO_TAP_CONTROL_OUTER_LOOP_MAX_TAP_SHIFT_PARAM_NAME, ParameterType.INTEGER, "Incremental transformer ratio tap control maximum tap shift per outer loop", INCREMENTAL_TRANSFORMER_RATIO_TAP_CONTROL_OUTER_LOOP_MAX_TAP_SHIFT_DEFAULT_VALUE), new Parameter(SECONDARY_VOLTAGE_CONTROL_PARAM_NAME, ParameterType.BOOLEAN, "Secondary voltage control simulation", LfNetworkParameters.SECONDARY_VOLTAGE_CONTROL_DEFAULT_VALUE), new Parameter(REACTIVE_LIMITS_MAX_SWITCH_PQ_PV_PARAM_NAME, ParameterType.INTEGER, "Reactive limits maximum Pq Pv switch", ReactiveLimitsOuterLoop.MAX_SWITCH_PQ_PV_DEFAULT_VALUE), diff --git a/src/test/java/com/powsybl/openloadflow/OpenLoadFlowParametersTest.java b/src/test/java/com/powsybl/openloadflow/OpenLoadFlowParametersTest.java index a95d44099d..eb127f9d35 100644 --- a/src/test/java/com/powsybl/openloadflow/OpenLoadFlowParametersTest.java +++ b/src/test/java/com/powsybl/openloadflow/OpenLoadFlowParametersTest.java @@ -336,7 +336,7 @@ void testEqualsAndClone() { newVal1 = "3"; newVal2 = "4"; } else if (sp.getType() == ParameterType.STRING) { - if (sp.getPossibleValues().isEmpty()) { + if (sp.getPossibleValues() == null) { // e.g. debugDir newVal1 = "Foo"; newVal2 = "Bar"; @@ -345,7 +345,7 @@ void testEqualsAndClone() { newVal2 = sp.getPossibleValues().get(1).toString(); } } else if (sp.getType() == ParameterType.STRING_LIST) { - if (sp.getPossibleValues() == null || sp.getPossibleValues().isEmpty()) { + if (sp.getPossibleValues() == null) { // e.g. slackBusesIds newVal1 = "Foo,Bar"; newVal2 = "Foo,Bar,Baz";