Skip to content

Commit

Permalink
read new folder
Browse files Browse the repository at this point in the history
  • Loading branch information
a-zakir committed Dec 20, 2024
1 parent f100200 commit 88698d4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
10 changes: 6 additions & 4 deletions src/libs/antares/study/area/list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1194,12 +1194,14 @@ bool AreaList::loadFromFolder(const StudyLoadOptions& options)

if (fs::exists(stsFolder))
{
for (const auto& [id, area]: areas)
for (const auto& area: areas | std::views::values)
{
fs::path folder = stsFolder / "clusters" / area->id.c_str();
fs::path cluster_folder = stsFolder / "clusters" / area->id.c_str();
ret = area->shortTermStorage.createSTStorageClustersFromIniFile(cluster_folder) &&
ret;

ret = area->shortTermStorage.createSTStorageClustersFromIniFile(folder) && ret;
ret = area->shortTermStorage.LoadConstraintsFromIniFile(folder) && ret;
const auto constraints_folder = stsFolder / "constraints" / area->id.c_str();
ret = area->shortTermStorage.LoadConstraintsFromIniFile(cluster_folder) && ret;
}
}
else
Expand Down
11 changes: 5 additions & 6 deletions src/libs/antares/study/parts/short-term-storage/container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,11 @@ bool STStorageInput::LoadConstraintsFromIniFile(const fs::path& parent_path)
return false;
}

auto it = std::find_if(storagesByIndex.begin(),
storagesByIndex.end(),
[&additional_constraints](const STStorageCluster& cluster)
{
return cluster.id == additional_constraints.cluster_id;
});
auto it = std::ranges::find_if(storagesByIndex,
[&additional_constraints](const STStorageCluster& cluster)
{
return cluster.id == additional_constraints.cluster_id;
});
if (it == storagesByIndex.end())
{
logs.warning() << " from file " << pathIni;
Expand Down

0 comments on commit 88698d4

Please sign in to comment.