Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge branch release/8.8.x into develop (changelog, version number) #1833

Merged
merged 11 commits into from
Dec 21, 2023
9 changes: 9 additions & 0 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,15 @@ jobs:
batch-name: valid-v830
os: ${{ matrix.test-platform }}

- name: Run MILP with CBC
if: ${{ env.IS_PUSH == 'true' }}
uses: ./.github/workflows/run-tests
with:
simtest-tag: ${{steps.simtest-version.outputs.prop}}
batch-name: valid-milp
variant: "milp-cbc"
os: ${{ matrix.test-platform }}

- name: Run tests introduced in v860
if: ${{ env.IS_PUSH == 'true' }}
uses: ./.github/workflows/run-tests
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/windows-vcpkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,15 @@ jobs:
batch-name: valid-v830
os: ${{ matrix.test-platform }}

- name: Run MILP with CBC
if: ${{ env.IS_PUSH == 'true' }}
uses: ./.github/workflows/run-tests
with:
simtest-tag: ${{steps.simtest-version.outputs.prop}}
batch-name: valid-milp
variant: "milp-cbc"
os: ${{ matrix.test-platform }}

- name: Run tests introduced in v860
uses: ./.github/workflows/run-tests
with:
Expand Down
43 changes: 21 additions & 22 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,13 @@ Antares Changelog
## New Features
* Solver logs can be enabled either by the command-line option (--solver-logs) or in the generaldata.ini by setting solver-logs = true under the optimization section [(#1717)](https://github.com/AntaresSimulatorTeam/Antares_Simulator/pull/1717)


8.8.0-rc3 (11/2023)
--------------------
## Bugfixes
* Fix oracle-linux8 binaries missing compression feature (#1741)

8.8.0-rc2 (10/2023)
8.8.0 (12/2023)
--------------------
## Build
- Fix version numbers (8b9b2b389)

8.8.0-rc1 (10/2023)
--------------------
## New features
* New "cash-flow" variable for ST storage (#1633)
* Experimental ptimization discrete variables (#670)

## Bugfixes
* Prevent segfault during simulation, check bounds of scenario builder (#1567)
* Fix number of links in deprecated output file digest.txt (#1646)
* Fix unfeasible problem analyzer (#1527)
* [Windows only] Increase file size limit when reading file (#1674)
* Fix segfault encountered when importing logs (#1702)
* Fixes swallowed exceptions in computation thread (#1685)
* Fix writer causing a segfault with OR-Tools (#1584)
* Bug on renewable cluster (wrong group) (#1631)
* Experimental optimization with discrete variables (MILP unit-commitment mode, #670)
flomnes marked this conversation as resolved.
Show resolved Hide resolved
* Add `enabled` property for ST storage objects, fix bug related to saving ST objects (#1807)

## Improvements
* Add shortcut -s for names MPS problems in CLI options (#1613)
Expand All @@ -41,8 +22,26 @@ Antares Changelog
* Fix wrong year number in logs upon failed year (#1672)
* Always check mingen against maxPower, regardless of reservoirManagement (#1656)
* New log msg when solver not found in or-tools (#1687)

## For developers
* Fix annoying error log about correlation matrices in tests (#1573)

## Bugfixes (reported by users)
* Fix output variable PROFIT for thermal clusters (#1767)
* Bug on renewable cluster (wrong group) (#1631)

## Bugfixes (reported internally)
* Fix oracle-linux8 binaries missing compression feature (#1741)
* Named MPS - fix duplicated "ranged" binding constraints (#1569)
* Fix save for short term storage objects (#1807)
* Prevent segfault during simulation, check bounds of scenario builder (#1567)
* Fix number of links in deprecated output file digest.txt (#1646)
* Fix unfeasible problem analyzer (#1527)
* [Windows only] Increase file size limit when reading file (#1674)
* Fix segfault encountered when importing logs (#1702)
* Fixes swallowed exceptions in computation thread (#1685)
* Fix writer causing a segfault with OR-Tools (#1584)

## Documentation
* Create Doxygen documentation (#1650)
* Update README.md (#1654)
Expand Down
2 changes: 1 addition & 1 deletion simtest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "v8.7.2"
"version": "v8.8.0-rc1"
}
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set(ANTARES_VERSION_REVISION 0)

# Beta release
set(ANTARES_BETA 0)
set(ANTARES_RC 3)
set(ANTARES_RC 0)

set(ANTARES_VERSION_YEAR 2023)

Expand Down
12 changes: 10 additions & 2 deletions src/libs/antares/study/parts/short-term-storage/cluster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,16 @@ bool STStorageCluster::loadFromSection(const IniFile::Section& section)
return true;
}

bool STStorageCluster::enabled() const
{
return properties.enabled;
}

bool STStorageCluster::validate() const
{
if (!enabled())
return true;

logs.debug() << "Validating properties and series for st storage: " << id;
return properties.validate() && series->validate();
}
Expand All @@ -76,9 +84,9 @@ bool STStorageCluster::loadSeries(const std::string& folder) const
return ret;
}

bool STStorageCluster::saveProperties(const std::string& path) const
void STStorageCluster::saveProperties(IniFile& ini) const
{
return properties.saveToFolder(path);
properties.save(ini);
}

bool STStorageCluster::saveSeries(const std::string& path) const
Expand Down
5 changes: 3 additions & 2 deletions src/libs/antares/study/parts/short-term-storage/cluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@ namespace Antares::Data::ShortTermStorage
class STStorageCluster
{
public:
bool enabled() const;
bool validate() const;
bool loadFromSection(const IniFile::Section& section);

bool loadFromSection(const IniFile::Section& section);
bool loadSeries(const std::string& folder) const;

bool saveProperties(const std::string& path) const;
void saveProperties(IniFile& ini) const;
bool saveSeries(const std::string& path) const;

std::string id;
Expand Down
30 changes: 25 additions & 5 deletions src/libs/antares/study/parts/short-term-storage/container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,16 @@ bool STStorageInput::saveToFolder(const std::string& folder) const
{
// create empty list.ini if there's no sts in this area
Yuni::IO::Directory::Create(folder);
Yuni::IO::File::CreateEmptyFile(folder + SEP + "list.ini");
logs.notice() << "created empty ini: " << folder + SEP + "list.ini";
const std::string pathIni(folder + SEP + "list.ini");
IniFile ini;

return std::all_of(storagesByIndex.cbegin(), storagesByIndex.cend(), [&folder](auto& storage) {
return storage.saveProperties(folder);
logs.debug() << "saving file " << pathIni;

std::for_each(storagesByIndex.cbegin(), storagesByIndex.cend(), [&ini](auto& storage) {
return storage.saveProperties(ini);
});

return ini.save(pathIni);
}

bool STStorageInput::saveDataSeriesToFolder(const std::string& folder) const
Expand All @@ -110,6 +114,22 @@ bool STStorageInput::saveDataSeriesToFolder(const std::string& folder) const

std::size_t STStorageInput::count() const
{
return storagesByIndex.size();
return std::count_if(storagesByIndex.begin(),
storagesByIndex.end(),
[](const STStorageCluster& st) {
return st.properties.enabled;
});
}

uint STStorageInput::removeDisabledClusters()
{
const auto& it = std::remove_if(storagesByIndex.begin(), storagesByIndex.end(),
[](const auto& c) { return !c.enabled(); });

uint disabledCount = std::distance(it, storagesByIndex.end());
storagesByIndex.erase(it, storagesByIndex.end());

return disabledCount;
}

} // namespace Antares::Data::ShortTermStorage
9 changes: 6 additions & 3 deletions src/libs/antares/study/parts/short-term-storage/container.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,15 @@ class STStorageInput
{
public:
bool validate() const;
// 1. Read list.ini
/// 1. Read list.ini
bool createSTStorageClustersFromIniFile(const std::string& path);
// 2. Read ALL series
/// 2. Read ALL series
bool loadSeriesFromFolder(const std::string& folder) const;
// Number of ST storages
/// Number of enabled ST storages, ignoring disabled ST storages
std::size_t count() const;
/// erase disabled cluster from the vector
uint removeDisabledClusters();


bool saveToFolder(const std::string& folder) const;
bool saveDataSeriesToFolder(const std::string& folder) const;
Expand Down
21 changes: 5 additions & 16 deletions src/libs/antares/study/parts/short-term-storage/properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,23 +115,14 @@ bool Properties::loadKey(const IniFile::Property* p)
return false;
}

if (p->key == "enabled")
return p->value.to<bool>(this->enabled);

return false;
}

bool Properties::saveToFolder(const std::string& folder) const
void Properties::save(IniFile& ini) const
{
const std::string pathIni(folder + SEP + "list.ini");

// Make sure the folder is created
if (!Yuni::IO::Directory::Create(folder))
{
logs.warning() << "Couldn't create dir for sts: " << folder;
return false;
}

logs.debug() << "saving file " << pathIni;

IniFile ini;
IniFile::Section* s = ini.addSection(this->name);

s->add("name", this->name);
Expand All @@ -147,9 +138,7 @@ bool Properties::saveToFolder(const std::string& folder) const

s->add("efficiency", this->efficiencyFactor);
s->add("initialleveloptim", this->initialLevelOptim);


return ini.save(pathIni);
s->add("enabled", this->enabled);
}

bool Properties::validate()
Expand Down
21 changes: 12 additions & 9 deletions src/libs/antares/study/parts/short-term-storage/properties.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,28 @@ class Properties
public:
bool validate();
bool loadKey(const IniFile::Property* p);
bool saveToFolder(const std::string& folder) const;
void save(IniFile& ini) const;

// Not optional Injection nominal capacity, >= 0
/// Not optional Injection nominal capacity, >= 0
std::optional<double> injectionNominalCapacity;
// Not optional Withdrawal nominal capacity, >= 0
/// Not optional Withdrawal nominal capacity, >= 0
std::optional<double> withdrawalNominalCapacity;
// Not optional Reservoir capacity in MWh, >= 0
/// Not optional Reservoir capacity in MWh, >= 0
std::optional<double> reservoirCapacity;
// Initial level, <= 1
/// Initial level, <= 1
double initialLevel = initiallevelDefault;
// Bool to optimise or not initial level
/// Bool to optimise or not initial level
bool initialLevelOptim = false;
// Efficiency factor between 0 and 1
/// Efficiency factor between 0 and 1
double efficiencyFactor = 1;
// Used to sort outputs
/// Used to sort outputs
Group group = Group::Other1;
// cluster name
/// cluster name
std::string name;

/// Enabled ?
bool enabled = true;

static const std::map<std::string, enum Group> ST_STORAGE_PROPERTY_GROUP_ENUM;
private:
static constexpr double initiallevelDefault = .5;
Expand Down
10 changes: 10 additions & 0 deletions src/libs/antares/study/runtime/runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,9 @@ bool StudyRuntimeInfos::loadFromStudy(Study& study)
// Removing disabled thermal clusters from solver computations
removeDisabledThermalClustersFromSolverComputations(study);

// Removing disabled short-term storage objects from solver computations
removeDisabledShortTermStorageClustersFromSolverComputations(study);

switch (gd.renewableGeneration())
{
case rgClusters:
Expand Down Expand Up @@ -423,6 +426,13 @@ void StudyRuntimeInfos::removeDisabledRenewableClustersFromSolverComputations(St
});
}

void StudyRuntimeInfos::removeDisabledShortTermStorageClustersFromSolverComputations(Study& study)
{
removeClusters(
study, "short term storage", [](Area& area)
{ return area.shortTermStorage.removeDisabledClusters(); });
}

void StudyRuntimeInfos::removeAllRenewableClustersFromSolverComputations(Study& study)
{
removeClusters(
Expand Down
1 change: 1 addition & 0 deletions src/libs/antares/study/runtime/runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ class StudyRuntimeInfos
void initializeThermalClustersInMustRunMode(Study& study) const;
void removeDisabledThermalClustersFromSolverComputations(Study& study);
void removeDisabledRenewableClustersFromSolverComputations(Study& study);
void removeDisabledShortTermStorageClustersFromSolverComputations(Study& study);
void removeAllRenewableClustersFromSolverComputations(Study& study);
void disableAllFilters(Study& study);
void checkThermalTSGeneration(Study& study);
Expand Down
6 changes: 4 additions & 2 deletions src/solver/variable/economy/STStorageCashFlowByCluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,14 +278,16 @@ class STstorageCashFlowByCluster : public Variable::IVariable<STstorageCashFlowB
const auto& shortTermStorage = results.data.area->shortTermStorage;

// Write the data for the current year
for (uint clusterIndex = 0; clusterIndex < nbClusters_; ++clusterIndex)
uint clusterIndex = 0;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clusterIndex appears to be unused

for (const auto& cluster : shortTermStorage.storagesByIndex)
{
// Write the data for the current year
const auto& cluster = shortTermStorage.storagesByIndex[clusterIndex];
results.variableCaption = cluster.properties.name;
results.variableUnit = VCardType::Unit();
pValuesForTheCurrentYear[numSpace][clusterIndex]
.template buildAnnualSurveyReport<VCardType>(results, fileLevel, precision);

clusterIndex++;
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/solver/variable/economy/STStorageInjectionByCluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,14 +280,16 @@ class STstorageInjectionByCluster : public Variable::IVariable<STstorageInjectio
const auto& shortTermStorage = results.data.area->shortTermStorage;

// Write the data for the current year
for (uint clusterIndex = 0; clusterIndex < nbClusters_; ++clusterIndex)
uint clusterIndex = 0;
flomnes marked this conversation as resolved.
Show resolved Hide resolved
for (const auto& cluster : shortTermStorage.storagesByIndex)
{
// Write the data for the current year
const auto& cluster = shortTermStorage.storagesByIndex[clusterIndex];
results.variableCaption = cluster.properties.name;
results.variableUnit = VCardType::Unit();
pValuesForTheCurrentYear[numSpace][clusterIndex]
.template buildAnnualSurveyReport<VCardType>(results, fileLevel, precision);

clusterIndex++;
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/solver/variable/economy/STStorageLevelsByCluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,14 +280,16 @@ class STstorageLevelsByCluster
const auto& shortTermStorage = results.data.area->shortTermStorage;

// Write the data for the current year
for (uint clusterIndex = 0; clusterIndex < nbClusters_; ++clusterIndex)
uint clusterIndex = 0;
flomnes marked this conversation as resolved.
Show resolved Hide resolved
for (const auto& cluster : shortTermStorage.storagesByIndex)
{
// Write the data for the current year
const auto& cluster = shortTermStorage.storagesByIndex[clusterIndex];
results.variableCaption = cluster.properties.name;
results.variableUnit = VCardType::Unit();
pValuesForTheCurrentYear[numSpace][clusterIndex].template buildAnnualSurveyReport<VCardType>(
results, fileLevel, precision);

clusterIndex++;
}
}
}
Expand Down
Loading