From f3922b266e29086337e5c61a26b4689b43a8e7d0 Mon Sep 17 00:00:00 2001 From: payetvin <113102157+payetvin@users.noreply.github.com> Date: Thu, 26 Sep 2024 17:19:19 +0200 Subject: [PATCH] Better handling of discontinued parameters (#2414) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Florian Omnès --- src/libs/antares/study/parameters.cpp | 23 +++++++++++++++---- .../study/parameters/adq-patch-params.cpp | 23 +------------------ 2 files changed, 20 insertions(+), 26 deletions(-) diff --git a/src/libs/antares/study/parameters.cpp b/src/libs/antares/study/parameters.cpp index 628237bbef..72be2dd7b4 100644 --- a/src/libs/antares/study/parameters.cpp +++ b/src/libs/antares/study/parameters.cpp @@ -1111,15 +1111,30 @@ static bool SGDIntLoadFamily_Legacy(Parameters& d, if (key == "initial-reservoir-levels") // ignored since 9.2 { - if (version >= StudyVersion(9, 2)) + if (value == "hot start") { logs.warning() << "Option initial-reservoir-levels is deprecated, please remove it from the study"; } - else if (value == "hot start") + return true; + } + + if (key == "set-to-null-ntc-between-physical-out-for-first-step") // ignored since 9.2 + { + if (value == "false") { - logs.warning() - << "Hydro hot start not supported with this solver, please use a version < 9.2"; + logs.warning() << "Parameter set-to-null-ntc-between-physical-out-for-first-step " + " is deprecated, please remove it from the study"; + } + return true; + } + + if (key == "enable-first-step") // ignored since 9.2 + { + if (value == "true") + { + logs.warning() << "Parameter enable-first-step is deprecated, please remove it from" + " the study"; } return true; } diff --git a/src/libs/antares/study/parameters/adq-patch-params.cpp b/src/libs/antares/study/parameters/adq-patch-params.cpp index 0cefe33482..ebf6de321e 100644 --- a/src/libs/antares/study/parameters/adq-patch-params.cpp +++ b/src/libs/antares/study/parameters/adq-patch-params.cpp @@ -27,27 +27,6 @@ namespace Antares::Data::AdequacyPatch { -// ------------------- -// Local matching -// ------------------- - -static bool legacyLocalMatchingKeys(const Yuni::String& key) -{ - if (key == "set-to-null-ntc-between-physical-out-for-first-step") - { - logs.warning() << "Parameter set-to-null-ntc-between-physical-out-for-first-step not " - "supported with this solver version, use a version < 9.2"; - return true; - } - if (key == "enable-first-step") - { - logs.warning() << "Parameter enable-first-step not supported with this solver version, use " - "a version < 9.2"; - return true; - } - return false; -} - // ----------------------- // Curtailment sharing // ----------------------- @@ -120,7 +99,7 @@ bool CurtailmentSharing::updateFromKeyValue(const Yuni::String& key, const Yuni: return value.to(thresholdVarBoundsRelaxation); } - return legacyLocalMatchingKeys(key); + return false; } const char* PriceTakingOrderToString(AdequacyPatch::AdqPatchPTO pto)