-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add ts-generation for links [ANT-1084] #1986
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pros
- We know that
foDuration
and its friends must of size 8760.
Cons
- On my machine,
sizeof(thermalInterface) = 420512
, which is huge. With this, I could reproduce a segfault by just declaringthermalStructure t[24];
on the stack.
Maybe you could wrap a std::vector
inside a class that does not allow resizing ?
class YearlyTS {
public:
YearlyTS() : mVec(8760) {}
double& operator[](std::size_t idx) { return mVec[idx];}
// etc.
// Do *NOT* expose resize, clear, push_back, etc.
private:
std::vector<double> mVec;
};
struct newStructure
{
YearlyTS foDuration;
YearlyTS poDuration;
YearlyTS foRate;
YearlyTS poRate;
YearlyTS npoMin;
YearlyTS npoMax;
unsigned unitCount;
float nominalCapacity;
double forcedVolatility;
double plannedVolatility;
Data::ThermalLaw forcedLaw = Data::thermalLawUniform;
Data::ThermalLaw plannedLaw = Data::thermalLawUniform;
};
So you get both the "small object on the stack" and "fixed size" aspects ? Note that on my machine, sizeof(newStructure) = 176
.
src/tools/ts-generator/include/antares/ts-generator/thermal_interface.h
Outdated
Show resolved
Hide resolved
src/tools/ts-generator/include/antares/ts-generator/thermal_interface.h
Outdated
Show resolved
Hide resolved
src/tools/ts-generator/include/antares/ts-generator/thermal_interface.h
Outdated
Show resolved
Hide resolved
@@ -1,5 +1,26 @@ | |||
# Migration guides | |||
This is a list of all recent changes that came with new Antares Simulator features. The main goal of this document is to lower the costs of changing existing interfaces, both GUI and scripts. | |||
|
|||
## v9.2.0 | |||
### (TS-generator only) TS generation for links |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the quantity being generated for links ?
capacity ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then we should say it.
Otherwise it's unclear
|
||
## v9.2.0 | ||
### (TS-generator only) TS generation for links | ||
In files input/links/<link1>/properties.ini, add the following properties |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doc is not very clear to me, especially when opening it with a markdown reader (I use VS Code).
This is a long list of different things.
Apparently, there are 4 files concerned by the links capacities TS generation.
So it should be separated into 4 parts.
|
||
for (const auto& link: links) | ||
{ | ||
Data::TimeSeries ts(link->timeseriesNumbers); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
About Data::TimeSeries ts(link->timeseriesNumbers);
:
We don't need the time series numbers in the context of TS generation.
Actually we don't even need a Data::TimeSeries here.
A simple Matrix is enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do
@@ -1,5 +1,26 @@ | |||
# Migration guides | |||
This is a list of all recent changes that came with new Antares Simulator features. The main goal of this document is to lower the costs of changing existing interfaces, both GUI and scripts. | |||
|
|||
## v9.2.0 | |||
### (TS-generator only) TS generation for links |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then we should say it.
Otherwise it's unclear
@@ -539,6 +539,10 @@ static bool SGDIntLoadFamily_General(Parameters& d, | |||
{ | |||
return value.to<uint>(d.nbTimeSeriesSolar); | |||
} | |||
if (key == "nbtimeserieslinks") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We know generating TS for links should be fully separated from the Antares solver.
What is true for the code is true for data as well.
For now data required generating TS for links are mixed data with the study data.
Here is a good example : nbtimeserieslinks is still held by generaldata.ini. Same for seed_links.
Eventually, we should separate data for TS generation form study data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See your PR @guilpier-code
@guilpier made a dedicated PR to fix all issues
Quality Gate failedFailed conditions See analysis details on SonarCloud Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
The aim of this PR is removing from **Antares solver** the code related to TS generation associated to **links** capacity. It follows PR #1986 Note that : - Loading the study is now no longer required to generate TS associated to links. - Handling errors related to each link's TS generation was simplified : For a link, if we meet a problem while loading data required to generated its TS, a **warning** is raised and the TS generation for this link will be skipped. What was done : - Reading data for links TS generation : We now don't need the study to be loaded in order to generate TS. Some new code retrieves data from study - Generating TS associated to links : Code of base branch was adapted to use data having a different format. - Code related to link TS generation in **solver** was removed. An exception though : due to new data (related to links TS generation) next to data consumed by solver, we had to keep special skipping code for it, otherwise we get reading errors. --------- Co-authored-by: Florian OMNES <[email protected]>
No description provided.