Skip to content

Commit

Permalink
Better handling of discontinued parameters (#2414)
Browse files Browse the repository at this point in the history
Co-authored-by: Florian Omnès <[email protected]>
  • Loading branch information
payetvin and flomnes authored Sep 26, 2024
1 parent 1d75f08 commit f3922b2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 26 deletions.
23 changes: 19 additions & 4 deletions src/libs/antares/study/parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
23 changes: 1 addition & 22 deletions src/libs/antares/study/parameters/adq-patch-params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
// -----------------------
Expand Down Expand Up @@ -120,7 +99,7 @@ bool CurtailmentSharing::updateFromKeyValue(const Yuni::String& key, const Yuni:
return value.to<int>(thresholdVarBoundsRelaxation);
}

return legacyLocalMatchingKeys(key);
return false;
}

const char* PriceTakingOrderToString(AdequacyPatch::AdqPatchPTO pto)
Expand Down

0 comments on commit f3922b2

Please sign in to comment.