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

Fix binding constraint TS loading [ANT-2746] [ANT-2754] #2636

Merged
merged 38 commits into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
3d97d32
Add cluster even if disabled
payetvin Feb 11, 2025
5db3cff
Dont remove BC
payetvin Feb 12, 2025
485ec36
Return 0 if cluster not activated
payetvin Feb 12, 2025
8e3eaca
Save even if matrix is full of zeros
payetvin Feb 12, 2025
9cef830
format
payetvin Feb 12, 2025
877ea04
Ok if 1 column
payetvin Feb 14, 2025
1e3ba29
Remove ifEnabled
payetvin Feb 14, 2025
a319777
Merge branch 'develop' into fix/bc-save-develop
pet-mit Feb 17, 2025
1ad8f66
Add message to checkAllElementsIdenticalOrOne
payetvin Feb 17, 2025
efddda8
Merge branch 'fix/bc-save-develop' of https://github.com/AntaresSimul…
payetvin Feb 17, 2025
b140396
Use function for BC
payetvin Feb 17, 2025
ccb63fa
Fix compile
payetvin Feb 17, 2025
e308399
format
payetvin Feb 17, 2025
9460ac2
revert save zeros
payetvin Feb 17, 2025
8cffb84
re-add the func that only takes a vector
payetvin Feb 17, 2025
9b1768e
fix tests
payetvin Feb 17, 2025
f1b4199
Merge branch 'develop' into fix/bc-save-develop
payetvin Feb 18, 2025
8e00baa
Merge branch 'develop' into fix/bc-save-develop
payetvin Feb 19, 2025
1e03fc7
return a pair
payetvin Feb 19, 2025
f835580
Merge branch 'fix/bc-save-develop' of https://github.com/AntaresSimul…
payetvin Feb 19, 2025
85389ed
Return pair.first
payetvin Feb 20, 2025
11c2bd7
Use emplace back
payetvin Feb 20, 2025
0caf00b
Fix condition
payetvin Feb 20, 2025
1100570
Merge remote-tracking branch 'origin/develop' into fix/bc-save-develop
payetvin Feb 20, 2025
cc9feca
Fix function
payetvin Feb 20, 2025
ad3e7de
revert changes on data series
payetvin Feb 21, 2025
d643c7b
fix data series tests
payetvin Feb 21, 2025
d1d257b
format
payetvin Feb 21, 2025
daa12f1
revert change for cluster->isActive
payetvin Feb 21, 2025
e5245d6
Merge branch 'develop' into fix/bc-save-develop
payetvin Feb 21, 2025
edf8ad8
use erase_if
payetvin Feb 21, 2025
eca6c71
cosmetic changes
flomnes Feb 21, 2025
072f504
Merge remote-tracking branch 'github/develop' into fix/bc-save-develop
flomnes Feb 21, 2025
2c6ac3e
logic
flomnes Feb 21, 2025
ae57ec4
re try is Active
payetvin Feb 24, 2025
07c0b45
Fix function BindingConstraint::clusterCount
flomnes Feb 24, 2025
2d59ec9
Add unit test on BindingConstraint::clusterCount
flomnes Feb 24, 2025
aa53d76
Add tests on BindingConstraintGroupRepository::buildFrom
flomnes Feb 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ void BindingConstraint::weight(const AreaLink* lnk, double w)

void BindingConstraint::weight(const ThermalCluster* cluster, double w)
{
if (cluster && cluster->isActive())
if (cluster)
{
if (Utils::isZero(w))
{
Expand Down Expand Up @@ -221,7 +221,7 @@ void BindingConstraint::offset(const AreaLink* lnk, int o)

void BindingConstraint::offset(const ThermalCluster* cluster, int o)
{
if (cluster && cluster->isActive())
if (cluster)
{
if (Utils::isZero(o))
{
Expand Down Expand Up @@ -609,9 +609,9 @@ int BindingConstraint::offset(const AreaLink* lnk) const
return (i != pLinkOffsets.end()) ? i->second : 0;
}

int BindingConstraint::offset(const ThermalCluster* lnk) const
int BindingConstraint::offset(const ThermalCluster* cluster) const
{
auto i = pClusterOffsets.find(lnk);
auto i = pClusterOffsets.find(cluster);
return (i != pClusterOffsets.end()) ? i->second : 0;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ bool BindingConstraintGroupRepository::timeSeriesWidthConsistentInGroups() const
constraints,
[&width](const std::shared_ptr<BindingConstraint>& bc)
{
bool sameWidth = bc->RHSTimeSeries().width == width;
auto seriesWidth = bc->RHSTimeSeries().width;
bool sameWidth = seriesWidth == width || seriesWidth == 1;
if (!sameWidth)
{
logs.error() << "Inconsistent time series width for constraint of the same "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ bool BindingConstraintSaver::saveToEnv(EnvForSaving& env,

// Exporting the matrix
env.matrixFilename.clear() << bindingConstraint->timeSeriesFileName(env);
return bindingConstraint->RHSTimeSeries_.saveToCSVFile(env.matrixFilename.c_str());
return bindingConstraint->RHSTimeSeries_.saveToCSVFile(env.matrixFilename.c_str(),
1,
false,
true);
}
} // namespace Antares::Data
Loading