Skip to content

Commit

Permalink
Merge branch 'develop' into dependabot/ground_work
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonMarechal25 authored Feb 22, 2024
2 parents db31e55 + b181904 commit c42ba23
Show file tree
Hide file tree
Showing 85 changed files with 711 additions and 1,202 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
4 changes: 2 additions & 2 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:
- develop
- release/*
- dependabot/*
pull_request:

- fix/*
- feature/*
jobs:
sonarcloud:
name: SonarCloud
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Makefile
src/.vs

src/config.h
src/config/include

# Yuni
src/ext/yuni/src/ProfileBuild.cmake
Expand Down
5 changes: 2 additions & 3 deletions src/libs/antares/InfoCollection/StudyInfoCollector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,8 @@ void StudyInfoCollector::enabledThermalClustersCountToFileContent(FileContent& f
auto end = study_.areas.end();
for (auto i = study_.areas.begin(); i != end; ++i)
{
Area& area = *(i->second);
nbEnabledThermalClusters +=
std::ranges::count_if(area.thermal.list, [](const auto& c) { return c->enabled; });
const Area& area = *(i->second);
nbEnabledThermalClusters += area.thermal.list.enabledAndNotMustRunCount();
}

// Adding an item related to number of enabled thermal clusters to the file content
Expand Down
13 changes: 6 additions & 7 deletions src/libs/antares/checks/checkLoadedInputData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void checkMinStablePower(bool tsGenThermal, const Antares::Data::AreaList& areas
}
else
{
areas.each([](Antares::Data::Area& area) { area.thermal.checkAndCorrectAvailability(); });
areas.each([](const auto& area) { area.thermal.checkAndCorrectAvailability(); });
}
}

Expand All @@ -158,16 +158,15 @@ static void checkThermalColumnNumber(const Antares::Data::AreaList& areas,
for (uint areaIndex = 0; areaIndex < areas.size(); ++areaIndex)
{
const auto& area = *(areas.byIndex[areaIndex]);
for (uint clusterIndex = 0; clusterIndex != area.thermal.clusterCount(); ++clusterIndex)
for (auto cluster : area.thermal.list.each_enabled())
{
const auto& cluster = *(area.thermal.clusters[clusterIndex]);
if (cluster.costgeneration == Antares::Data::setManually)
if (cluster->costgeneration == Antares::Data::setManually)
continue;
const uint otherMatrixWidth = (cluster.ecoInput.*matrix).width;
uint tsWidth = cluster.series.timeSeries.width;
const uint otherMatrixWidth = (cluster->ecoInput.*matrix).width;
uint tsWidth = cluster->series.timeSeries.width;
if (otherMatrixWidth != 1 && otherMatrixWidth != tsWidth)
{
logs.warning() << "Area: " << area.name << ". Cluster name: " << cluster.name()
logs.warning() << "Area: " << area.name << ". Cluster name: " << cluster->name()
<< ". " << exception.what();
error = true;
}
Expand Down
3 changes: 1 addition & 2 deletions src/libs/antares/study/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ source_group("study\\part\\common" FILES ${SRC_STUDY_PART_COMMON})

set(SRC_STUDY_PART_THERMAL
include/antares/study/parts/thermal/container.h
include/antares/study/parts/thermal/container.hxx
parts/thermal/container.cpp
include/antares/study/parts/thermal/prepro.h
include/antares/study/parts/thermal/prepro.hxx
Expand Down Expand Up @@ -318,4 +317,4 @@ target_include_directories(study

install(DIRECTORY include/antares
DESTINATION "include"
)
)
3 changes: 1 addition & 2 deletions src/libs/antares/study/area/area.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,8 @@ void Area::resizeAllTimeseriesNumbers(uint nbYears)
bool Area::thermalClustersMinStablePowerValidity(std::vector<YString>& output) const
{
bool noErrorMinStabPow = true;
for (uint l = 0; l != thermal.clusterCount(); ++l)
for (auto cluster : thermal.list.each_enabled())
{
auto& cluster = thermal.clusters[l];
logs.debug() << "cluster : " << cluster->name();
if ((not cluster->checkMinStablePower())
|| (cluster->minStablePower
Expand Down
41 changes: 6 additions & 35 deletions src/libs/antares/study/area/list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -769,14 +769,6 @@ static bool AreaListLoadFromFolderSingleArea(Study& study,
StringT& buffer,
const StudyLoadOptions& options)
{
// Progression
options.progressTicks = 0;
options.progressTickCount
= area.thermal.list.size() * (options.loadOnlyNeeded ? 1 : 2) // prepro+series
+ 1 // links
+ 4 // load,solar,wind,hydro
+ 1; // DSM,misc...

// Reset
area.filterSynthesis = filterAll;
area.filterYearByYear = filterAll;
Expand Down Expand Up @@ -815,15 +807,10 @@ static bool AreaListLoadFromFolderSingleArea(Study& study,
MatrixTestForPositiveValues_LimitWidth(buffer.c_str(), &area.miscGen, fhhPSP);
}

++options.progressTicks;
options.pushProgressLogs();

// Links
{
buffer.clear() << study.folderInput << SEP << "links" << SEP << area.id;
ret = AreaLinksLoadFromFolder(study, list, &area, buffer) && ret;
++options.progressTicks;
options.pushProgressLogs();
}

// UI
Expand Down Expand Up @@ -853,9 +840,6 @@ static bool AreaListLoadFromFolderSingleArea(Study& study,
ret = area.load.series.loadFromFile(buffer.c_str(), averageTs)
&& ret;
}

++options.progressTicks;
options.pushProgressLogs();
}

// Solar
Expand All @@ -875,9 +859,6 @@ static bool AreaListLoadFromFolderSingleArea(Study& study,
&& ret;

}

++options.progressTicks;
options.pushProgressLogs();
}

// Hydro
Expand All @@ -898,9 +879,6 @@ static bool AreaListLoadFromFolderSingleArea(Study& study,
buffer.clear() << study.folderInput << SEP << "hydro" << SEP << "series";
ret = area.hydro.series->loadFromFolder(study, area.id, buffer) && ret;
}

++options.progressTicks;
options.pushProgressLogs();
}

// Wind
Expand All @@ -919,17 +897,14 @@ static bool AreaListLoadFromFolderSingleArea(Study& study,
ret = area.wind.series.loadFromFile(buffer.c_str(), averageTs)
&& ret;
}

++options.progressTicks;
options.pushProgressLogs();
}

// Thermal cluster list
{
buffer.clear() << study.folderInput << SEP << "thermal" << SEP << "prepro";
ret = area.thermal.list.loadPreproFromFolder(study, options, buffer) && ret;
ret = area.thermal.list.loadPreproFromFolder(study, buffer) && ret;
buffer.clear() << study.folderInput << SEP << "thermal" << SEP << "series";
ret = area.thermal.list.loadDataSeriesFromFolder(study, options, buffer) && ret;
ret = area.thermal.list.loadDataSeriesFromFolder(study, buffer) && ret;
ret = area.thermal.list.loadEconomicCosts(study, buffer) && ret;

// In adequacy mode, all thermal clusters must be in 'mustrun' mode
Expand All @@ -951,7 +926,7 @@ static bool AreaListLoadFromFolderSingleArea(Study& study,
if (study.header.version >= StudyVersion(8, 1))
{
buffer.clear() << study.folderInput << SEP << "renewables" << SEP << "series";
ret = area.renewable.list.loadDataSeriesFromFolder(study, options, buffer) && ret;
ret = area.renewable.list.loadDataSeriesFromFolder(study, buffer) && ret;
}

// Adequacy patch
Expand Down Expand Up @@ -1096,7 +1071,6 @@ bool AreaList::loadFromFolder(const StudyLoadOptions& options)
Area& area = *(i->second);
buffer.clear() << pStudy.folderInput << thermalPlant << area.id;
ret = area.thermal.list.loadFromFolder(pStudy, buffer.c_str(), &area) && ret;
area.thermal.prepareAreaWideIndexes();
}
}

Expand Down Expand Up @@ -1136,7 +1110,6 @@ bool AreaList::loadFromFolder(const StudyLoadOptions& options)
Area& area = *(i->second);
buffer.clear() << pStudy.folderInput << renewablePlant << area.id;
ret = area.renewable.list.loadFromFolder(buffer.c_str(), &area) && ret;
area.renewable.prepareAreaWideIndexes();
}
}

Expand Down Expand Up @@ -1291,7 +1264,6 @@ void AreaListEnsureDataHydroPrepro(AreaList* l)

void AreaListEnsureDataThermalPrepro(AreaList* l)
{
assert(l && "The area list must not be nullptr");
l->each([&](Data::Area& area) { area.thermal.list.ensureDataPrepro(); });
}

Expand Down Expand Up @@ -1529,8 +1501,7 @@ ThermalCluster* AreaList::findClusterFromINIKey(const AnyString& key)
Area* parentArea = findFromName(parentName);
if (parentArea == nullptr)
return nullptr;
return parentArea->thermal.list.find(id);

return parentArea->thermal.list.findInAll(id);
}

void AreaList::updateNameIDSet() const
Expand Down Expand Up @@ -1569,8 +1540,8 @@ void AreaList::removeWindTimeseries()
void AreaList::removeThermalTimeseries()
{
each([](Data::Area& area) {
area.thermal.list.each(
[](Data::ThermalCluster& cluster) { cluster.series.reset(); });
for (auto c : area.thermal.list.all())
c->series.reset();
});
}

Expand Down
1 change: 0 additions & 1 deletion src/libs/antares/study/area/store-timeseries-numbers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ void storeTimeseriesNumbersForWind(Solver::IResultWriter& writer, const Area& ar
void storeTimeseriesNumbersForThermal(Solver::IResultWriter& writer, const Area& area)
{
area.thermal.list.storeTimeseriesNumbers(writer);
area.thermal.mustrunList.storeTimeseriesNumbers(writer);
}

void storeTimeseriesNumbersForRenewable(Solver::IResultWriter& writer, const Area& area)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ void BindingConstraint::copyWeights(const Study &study,
if (localParent)
{
const ThermalCluster *localTC
= localParent->thermal.list.find(thermalCluster->id());
= localParent->thermal.list.findInAll(thermalCluster->id());
if (localTC)
pClusterWeights[localTC] = weight;
}
Expand Down Expand Up @@ -329,7 +329,7 @@ void BindingConstraint::copyOffsets(const Study &study,
if (localParent)
{
const ThermalCluster *localTC
= localParent->thermal.list.find(thermalCluster->id());
= localParent->thermal.list.findInAll(thermalCluster->id());
if (localTC)
pClusterOffsets[localTC] = offset;
}
Expand Down
6 changes: 3 additions & 3 deletions src/libs/antares/study/cleaner/cleaner-v20.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ static void listOfFilesAnDirectoriesToKeepForArea(PathList& e, PathList& p, cons
buffer.clear() << "input/thermal/clusters/" << id << "/list.ini";
e.add(buffer);

for (const auto& cluster : area->thermal.list)
for (auto cluster : area->thermal.list.all())
{
buffer.clear() << "input/thermal/prepro/" << id << '/' << cluster->id();
p.add(buffer);
Expand Down Expand Up @@ -156,7 +156,7 @@ static void listOfFilesAnDirectoriesToKeepForArea(PathList& e, PathList& p, cons
buffer.clear() << "input/renewables/clusters/" << id << "/list.ini";
e.add(buffer);

for (const auto& cluster : area->renewable.list)
for (const auto cluster : area->renewable.list.all())
{
buffer.clear() << "input/renewables/series/" << id << '/' << cluster->id();
p.add(buffer);
Expand Down Expand Up @@ -345,7 +345,7 @@ bool listOfFilesAnDirectoriesToKeep(StudyCleaningInfos* infos)
// Exclude
listOfFilesAnDirectoriesToKeepForArea(e, p, area, buffer);
// Clear the memory used by the thermal clusters of the area
area->thermal.list.clear();
area->thermal.list.clearAll();

// Interconnections
{
Expand Down
7 changes: 0 additions & 7 deletions src/libs/antares/study/include/antares/study/load-options.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ class StudyLoadOptions
StudyLoadOptions();
//@}

//! Push a new log entry according to the local progress data
void pushProgressLogs() const;

void checkForceSimulationMode();

public:
Expand Down Expand Up @@ -89,10 +86,6 @@ class StudyLoadOptions

//! Temporary string for passing log message
mutable Yuni::String logMessage;
//! Porgression, tick count
mutable uint progressTickCount;
//! The current number of ticks
mutable uint progressTicks;

//! Display version number and exit
bool displayVersion = false;
Expand Down
Loading

0 comments on commit c42ba23

Please sign in to comment.