AntaresSimulatorTeam / Antares_Simulator

Antares-Simulator is an Open Source power system simulator to quantify the adequacy or the economic performance of interconnected energy systems, at short or remote time horizons.
https://antares-simulator.org
Other
57 stars 23 forks source link

Spinning reserve: input data should be immutable #1663

Open sylvlecl opened 9 months ago

sylvlecl commented 9 months ago

Description

See https://github.com/AntaresSimulatorTeam/Antares_Simulator/pull/1661#pullrequestreview-1650660261.

To take into account the spinning reserve, we change in place the input timeseries in thermal clusters (calculationOfSpinning()), at the start of the computation. We then reverse it later (reverseCalculationOfSpinning).

That implementation is not safe, in particular when the reserve is 100% we cannot reverse the values of the timeseries. In any case we should only apply the modification on a new object when really needed, otherwise it is very difficult to understand what the timeseries is supposed to contain, at any point of the computation.

We should instead have a getter, or another class member, for the modified timeseries, and use it where needed.

sylvlecl commented 9 months ago

Linked to #1662

payetvin commented 1 month ago

Will be removed when we rm time series in memory gen