Skip to content

Commit

Permalink
Fix invalid study after update to v8.7.0 - Add default group to exist…
Browse files Browse the repository at this point in the history
…ing BCs (#1462)

* [UPDATER] Fix invalid study after update to v8.7.0

- Starting from v8.7.0, all binding constraints should have a 'group'
    attribute with a non-empty group
- Before this change, the updater produced wrong constraints

* Use group "default" instead of "legacy_study_group"
  • Loading branch information
flomnes authored Jul 28, 2023
1 parent d6aa849 commit db87c7b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ std::vector<std::shared_ptr<BindingConstraint>> BindingConstraintLoader::load(En
<< "]: Missing mandatory binding constraint group";
return {};
}
else
else // In studies versions < 870, binding constraints have no group. From version 870, antares requires constraints to have a group.
{
bc->group_ = "legacy_study_group";
bc->group_ = "default";
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ 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));

if (!bindingConstraint->group().empty())
env.section->add("group", bindingConstraint->group());

if (!bindingConstraint->pComments.empty())
env.section->add("comments", bindingConstraint->pComments);

Expand Down

0 comments on commit db87c7b

Please sign in to comment.