Skip to content

Commit

Permalink
merge develop, conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
payetvin committed Dec 19, 2024
2 parents 78e083f + 03508de commit 4978046
Show file tree
Hide file tree
Showing 81 changed files with 3,371 additions and 615 deletions.
30 changes: 20 additions & 10 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,22 +170,23 @@ jobs:
run: |
cd _build
ctest -C Release --output-on-failure -L "unit|end-to-end"

- name: Upload logs for failed tests
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: test-log
path: ${{ github.workspace }}/_build/Testing/Temporary/LastTest.log

- name: Run tests about infinity on BCs RHS
if: ${{ env.RUN_SIMPLE_TESTS == 'true' && !cancelled() }}
uses: ./.github/workflows/run-tests
with:
simtest-tag: ${{ env.SIMTEST }}
batch-name: valid-v830
os: ${{ env.os }}

- name: Run MILP with CBC
if: ${{ env.RUN_SIMPLE_TESTS == 'true' && !cancelled() }}
uses: ./.github/workflows/run-tests
Expand All @@ -195,6 +196,23 @@ jobs:
variant: "milp-cbc"
os: ${{ env.os }}

- name: Run tests on adequacy patch (CSR)
if: ${{ env.RUN_SIMPLE_TESTS == 'true' }}
uses: ./.github/workflows/run-tests
with:
simtest-tag: ${{steps.simtest-version.outputs.prop}}
batch-name: adequacy-patch-CSR
os: ${{ env.os }}

- name: Run parallel tests
if: ${{ env.RUN_EXTENDED_TESTS == 'true' }}
uses: ./.github/workflows/run-tests
with:
simtest-tag: ${{steps.simtest-version.outputs.prop}}
batch-name: valid-parallel
os: ${{ env.os }}
variant: "parallel"

- name: Run tests introduced in 8.6.0
if: ${{ env.RUN_SIMPLE_TESTS == 'true' && !cancelled() }}
uses: ./.github/workflows/run-tests
Expand Down Expand Up @@ -248,14 +266,6 @@ jobs:
batch-name: valid-mps
os: ${{ env.os }}

- name: Run tests for adequacy patch (CSR)
if: ${{ env.RUN_SIMPLE_TESTS == 'true' && !cancelled() }}
uses: ./.github/workflows/run-tests
with:
simtest-tag: ${{ env.SIMTEST }}
batch-name: adequacy-patch-CSR
os: ${{ env.os }}

- name: Run parallel tests
if: ${{ env.RUN_EXTENDED_TESTS == 'true' && !cancelled() }}
uses: ./.github/workflows/run-tests
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/windows-vcpkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,14 @@ jobs:
batch-name: adequacy-patch-CSR
os: ${{ env.os }}

- name: Run tests about infinity on BCs RHS
if: ${{ env.RUN_SIMPLE_TESTS == 'true' }}
uses: ./.github/workflows/run-tests
with:
simtest-tag: ${{steps.simtest-version.outputs.prop}}
batch-name: valid-v830
os: ${{ env.test-platform }}

- name: Run tests about infinity on BCs RHS
if: ${{ env.RUN_SIMPLE_TESTS == 'true' && !cancelled() }}
uses: ./.github/workflows/run-tests
Expand Down
21 changes: 21 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
#
# Copyright 2007-2024, RTE (https://www.rte-france.com)
# See AUTHORS.txt
# SPDX-License-Identifier: MPL-2.0
# This file is part of Antares-Simulator,
# Adequacy and Performance assessment for interconnected energy networks.
#
# Antares_Simulator is free software: you can redistribute it and/or modify
# it under the terms of the Mozilla Public Licence 2.0 as published by
# the Mozilla Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# Antares_Simulator is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# Mozilla Public Licence 2.0 for more details.
#
# You should have received a copy of the Mozilla Public Licence 2.0
# along with Antares_Simulator. If not, see <https://opensource.org/license/mpl-2-0/>.
#

sonar.projectName=Antares_Simulator
sonar.projectKey=AntaresSimulatorTeam_Antares_Simulator
sonar.organization=antaressimulatorteam
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ set(ANTARES_VERSION_HI 9)
set(ANTARES_VERSION_LO 2)
set(ANTARES_VERSION_REVISION 0)


# Beta release
set(ANTARES_BETA 0)
set(ANTARES_RC 7)
Expand Down Expand Up @@ -192,6 +191,7 @@ endif()
find_package(Boost REQUIRED)

find_package(antlr4-runtime REQUIRED)
find_package(yaml-cpp REQUIRED)

#Sirius solver
if(POLICY CMP0074)
Expand Down
5 changes: 2 additions & 3 deletions src/libs/antares/exception/LoadingError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,8 @@ InvalidSolverSpecificParameters::InvalidSolverSpecificParameters(const std::stri
{
}

InvalidStudy::InvalidStudy(const Yuni::String& study):
LoadingError(std::string("The folder `") + study.c_str()
+ "` does not seem to be a valid study")
InvalidStudy::InvalidStudy(const std::string& study):
LoadingError(std::string("The folder `") + study + "` does not seem to be a valid study")
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class InvalidSolverSpecificParameters: public LoadingError
class InvalidStudy: public LoadingError
{
public:
explicit InvalidStudy(const Yuni::String& study);
explicit InvalidStudy(const std::string& study);
};

class NoStudyProvided: public LoadingError
Expand Down
1 change: 0 additions & 1 deletion src/libs/antares/io/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ add_library(io
)
add_library(Antares::io ALIAS io)


target_link_libraries(io
PRIVATE
yuni-static-core
Expand Down
3 changes: 1 addition & 2 deletions src/libs/antares/io/include/antares/io/file.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
#define __LIBS_ANTARES_IO_FILE_H__

#include <filesystem>

#include <yuni/core/string.h>
#include <string>

namespace Antares::IO
{
Expand Down
10 changes: 6 additions & 4 deletions src/libs/antares/study/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ set(SRC_STUDY_PART_THERMAL
include/antares/study/parts/thermal/cost_provider.h
include/antares/study/parts/thermal/cluster.hxx
parts/thermal/cluster.cpp
parts/thermal/scenarized_cost_provider.cpp
parts/thermal/constant_cost_provider.cpp
parts/thermal/scenarized_cost_provider.cpp
parts/thermal/constant_cost_provider.cpp
include/antares/study/parts/thermal/cluster_list.h
parts/thermal/cluster_list.cpp
include/antares/study/parts/thermal/pollutant.h
Expand All @@ -102,7 +102,9 @@ set(SRC_STUDY_PART_SHORT_TERM_STORAGE
parts/short-term-storage/series.cpp
include/antares/study/parts/short-term-storage/series.h
include/antares/study/parts/short-term-storage/cluster.h
include/antares/study/parts/short-term-storage/AdditionalConstraint.h
parts/short-term-storage/cluster.cpp
parts/short-term-storage/AdditionalConstraint.cpp
)
source_group("study\\part\\short-term-storage" FILES ${SRC_STUDY_PART_SHORT_TERM_SOTRAGE})

Expand Down Expand Up @@ -306,12 +308,12 @@ target_link_libraries(study
)

target_include_directories(study
PUBLIC
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>

# Make more than just study visible but it's the lesser evil for now
)

install(DIRECTORY include/antares
install(DIRECTORY include/antares
DESTINATION "include"
)
1 change: 1 addition & 0 deletions src/libs/antares/study/area/list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1199,6 +1199,7 @@ bool AreaList::loadFromFolder(const StudyLoadOptions& options)
fs::path folder = stsFolder / "clusters" / area->id.c_str();

ret = area->shortTermStorage.createSTStorageClustersFromIniFile(folder) && ret;
ret = area->shortTermStorage.LoadConstraintsFromIniFile(folder) && ret;
}
}
else
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* Copyright 2007-2024, RTE (https://www.rte-france.com)
* See AUTHORS.txt
* SPDX-License-Identifier: MPL-2.0
* This file is part of Antares-Simulator,
* Adequacy and Performance assessment for interconnected energy networks.
*
* Antares_Simulator is free software: you can redistribute it and/or modify
* it under the terms of the Mozilla Public Licence 2.0 as published by
* the Mozilla Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Antares_Simulator is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* Mozilla Public Licence 2.0 for more details.
*
* You should have received a copy of the Mozilla Public Licence 2.0
* along with Antares_Simulator. If not, see <https://opensource.org/license/mpl-2-0/>.
*/

#pragma once
#include <set>
#include <string>

namespace Antares::Data::ShortTermStorage
{

struct AdditionalConstraint
{
std::string name;
std::string cluster_id;
std::string variable;
std::string operatorType;
std::set<int> hours;
double rhs;

unsigned int globalIndex = 0;

struct ValidateResult
{
bool ok;
std::string error_msg;
};

ValidateResult validate() const;

private:
bool isValidVariable() const;
bool isValidOperatorType() const;
bool isValidHoursRange() const;
};
} // namespace Antares::Data::ShortTermStorage
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <antares/inifile/inifile.h>

#include "AdditionalConstraint.h"
#include "properties.h"
#include "series.h"

Expand All @@ -35,17 +36,21 @@ class STStorageCluster
{
public:
bool enabled() const;

bool validate() const;

bool loadFromSection(const IniFile::Section& section);

bool loadSeries(const std::filesystem::path& folder) const;

void saveProperties(IniFile& ini) const;

bool saveSeries(const std::string& path) const;

std::string id;

std::shared_ptr<Series> series = std::make_shared<Series>();
mutable Properties properties;
std::vector<AdditionalConstraint> additional_constraints;
};
} // namespace Antares::Data::ShortTermStorage
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

#pragma once
#include <filesystem>
#include <map>
#include <string>

#include "AdditionalConstraint.h"
#include "cluster.h"

namespace Antares::Data::ShortTermStorage
Expand All @@ -32,18 +32,28 @@ class STStorageInput
{
public:
bool validate() const;

/// 1. Read list.ini
bool createSTStorageClustersFromIniFile(const std::filesystem::path& path);

/// 2. Read ALL series
bool loadSeriesFromFolder(const std::filesystem::path& folder) const;

/// Number of enabled ST storages, ignoring disabled ST storages
std::size_t count() const;

bool LoadConstraintsFromIniFile(const std::filesystem::path& filePath);

/// erase disabled cluster from the vector
uint removeDisabledClusters();

bool saveToFolder(const std::string& folder) const;

bool saveDataSeriesToFolder(const std::string& folder) const;

std::vector<STStorageCluster> storagesByIndex;

/// Number cumulative - constraint
std::size_t cumulativeConstraintCount() const;
};
} // namespace Antares::Data::ShortTermStorage
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ class StudyRuntimeInfos
uint thermalPlantTotalCountMustRun;

uint shortTermStorageCount = 0;
uint shortTermStorageCumulativeConstraintCount = 0;

//! Override enable/disable TS generation per cluster
bool thermalTSRefresh = false;
Expand Down
4 changes: 4 additions & 0 deletions src/libs/antares/study/parameters/adq-patch-params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ void AdqPatchParams::addExcludedVariables(std::vector<std::string>& out) const
out.emplace_back("LMR VIOL.");
out.emplace_back("UNSP. ENRG CSR");
out.emplace_back("DTG MRG CSR");
out.emplace_back("LOLD CSR");
out.emplace_back("LOLP CSR");
out.emplace_back("MAX MRG CSR");
out.emplace_back("OV. COST CSR");
}
}

Expand Down
Loading

0 comments on commit 4978046

Please sign in to comment.