From 2c07f3a72aa3fb81fb60a6fe078361b67d1fc42a Mon Sep 17 00:00:00 2001 From: Florian OMNES Date: Thu, 27 Jul 2023 17:56:59 +0200 Subject: [PATCH] Accept empty group / no group for binding constraints --- .../binding_constraint/BindingConstraintLoader.cpp | 13 ------------- .../binding_constraint/BindingConstraintSaver.cpp | 2 ++ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/libs/antares/study/binding_constraint/BindingConstraintLoader.cpp b/src/libs/antares/study/binding_constraint/BindingConstraintLoader.cpp index 657a0284f6..757e0f17a5 100644 --- a/src/libs/antares/study/binding_constraint/BindingConstraintLoader.cpp +++ b/src/libs/antares/study/binding_constraint/BindingConstraintLoader.cpp @@ -152,19 +152,6 @@ std::vector> BindingConstraintLoader::load(En << "]: Invalid operator [less,greater,equal,both]"; return {}; } - if (bc->group_.empty()) - { - if (env.version >= version870) - { - logs.error() << env.iniFilename << ": in [" << env.section->name - << "]: Missing mandatory binding constraint group"; - return {}; - } - else - { - bc->group_ = "legacy_study_group"; - } - } // The binding constraint can not be enabled if there is no weight in the table if (bc->pLinkWeights.empty() && bc->pClusterWeights.empty()) diff --git a/src/libs/antares/study/binding_constraint/BindingConstraintSaver.cpp b/src/libs/antares/study/binding_constraint/BindingConstraintSaver.cpp index 28e949654d..9390c06edf 100644 --- a/src/libs/antares/study/binding_constraint/BindingConstraintSaver.cpp +++ b/src/libs/antares/study/binding_constraint/BindingConstraintSaver.cpp @@ -21,6 +21,8 @@ bool BindingConstraintSaver::saveToEnv(EnvForSaving& env, const BindingConstrain env.section->add("filter-year-by-year", datePrecisionIntoString(bindingConstraint->pFilterYearByYear)); env.section->add("filter-synthesis", datePrecisionIntoString(bindingConstraint->pFilterSynthesis)); + env.section->add("group", bindingConstraint->group()); + if (!bindingConstraint->pComments.empty()) env.section->add("comments", bindingConstraint->pComments);