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

Multiple Maximum Generation and Pumping for Hydro (Merging with develop branch) #1723

Merged
merged 152 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from 119 commits
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
2b03609
Maxgen matrix implemented
nikolaredstork Jul 13, 2023
e25aea9
Maxpump matrix implemented
nikolaredstork Jul 13, 2023
9bbe22e
Scenario Builder GUI
nikolaredstork Jul 22, 2023
ab3085f
DataSeriesHydro-new matrix for max gen and pump TS's
nikolaredstork Jul 22, 2023
f2bd3ac
MC years linked with new hydro MC Scenario Builder Matrix
nikolaredstork Jul 22, 2023
5a80015
Random number feature
nikolaredstork Jul 22, 2023
f602cc6
Replacing daily values for hourly in solver
nikolaredstork Jul 22, 2023
22d74c4
HydroHasMod and PumpHasMod
nikolaredstork Jul 22, 2023
34a314b
Hydro Modulabe
nikolaredstork Jul 22, 2023
0fb26de
GUI for TS management hydro power credits
nikolaredstork Jul 22, 2023
e2e963a
Inter and Intra modal feature backend
nikolaredstork Jul 23, 2023
a4d33db
Auto Transfer function and one comment modification
nikolaredstork Jul 23, 2023
eee6d08
Comment modification
nikolaredstork Jul 23, 2023
a4c1da8
Refactoring checkHourlyMinMaxGeneration function
nikolaredstork Jul 23, 2023
827cfb5
Separate function for checking max gen and pump TS number
nikolaredstork Jul 23, 2023
07ce46b
Excluding unnecessary function parameter
nikolaredstork Jul 23, 2023
4b08e13
Excluding unnecessary reference
nikolaredstork Jul 24, 2023
ede8efc
HydroHasMod and PumpHasMod modification
nikolaredstork Jul 24, 2023
598a474
Change function name
nikolaredstork Jul 24, 2023
4554d23
MD files updated
nikolaredstork Jul 24, 2023
94ca6b7
MD file modification
nikolaredstork Jul 25, 2023
2ab16dc
Merge branch 'develop-new' into feature/maxgen-maxpump-cr23
nikolaredstork Jul 31, 2023
13db210
Modification after merging with develop-new branch
nikolaredstork Jul 31, 2023
04b6104
Fixing build errors due to migration from raw ptrs to stl vectors
nikolaredstork Jul 31, 2023
1820fda
Support for old studies fix
nikolaredstork Aug 2, 2023
94698f1
Separate mingen from maxgen and maxpump
nikolaredstork Aug 3, 2023
75b6263
New Load function for Hydro Power Credits
nikolaredstork Aug 3, 2023
91435e9
fix - random ts number test crash
Milos-RTEi Aug 3, 2023
c672e3a
fix pumpMaxE bug
Milos-RTEi Aug 3, 2023
118db9a
Separate mingen from maxgen and maxpump
nikolaredstork Aug 3, 2023
7ee9ccf
fix - random ts number test crash
Milos-RTEi Aug 3, 2023
4b165d2
fix pumpMaxE bug
Milos-RTEi Aug 3, 2023
6cad434
Bugfix
nikolaredstork Aug 4, 2023
401e21a
Merge branch 'feature/max-hydro-gen-pump-per-h-cr23' into feature/max…
Milos-RTEi Aug 4, 2023
75cb113
Feature/maxgen maxpump cr23 - improvements (#1499)
Milos-RTEi Aug 4, 2023
bcdc18b
Adding pointer check
nikolaredstork Aug 4, 2023
8e35773
Adding pointer check
nikolaredstork Aug 4, 2023
4abc817
New file maxhours_areaID
nikolaredstork Aug 8, 2023
c104436
New class that support old studies
nikolaredstork Aug 9, 2023
0667a39
Two separate files for Gen and Pump hours
nikolaredstork Aug 11, 2023
7138ced
Delete old files
nikolaredstork Aug 14, 2023
cabdc79
Scenario Builder unit tests
nikolaredstork Aug 14, 2023
94784ea
Excluding unnecessary code
nikolaredstork Aug 14, 2023
c8f2050
Keep files for an area
nikolaredstork Aug 14, 2023
a33099d
Excluding unnecessary arrays
nikolaredstork Aug 15, 2023
21cd52e
Fix test
nikolaredstork Aug 16, 2023
7fa96b3
New file maxhours_areaID
nikolaredstork Aug 8, 2023
b5f0573
New class that support old studies
nikolaredstork Aug 9, 2023
aadaa26
Two separate files for Gen and Pump hours
nikolaredstork Aug 11, 2023
8ff8737
Delete old files
nikolaredstork Aug 14, 2023
0d9e8e5
Scenario Builder unit tests
nikolaredstork Aug 14, 2023
a4f00a2
Excluding unnecessary code
nikolaredstork Aug 14, 2023
c142ee9
Keep files for an area
nikolaredstork Aug 14, 2023
644c50b
Excluding unnecessary arrays
nikolaredstork Aug 15, 2023
172d8a9
Fix test
nikolaredstork Aug 16, 2023
68d4299
Merge branch 'develop-new' into feature/maxgen-maxpump-cr23
nikolaredstork Aug 16, 2023
1ec8f3e
Post merge fixs
nikolaredstork Aug 16, 2023
552b48a
Merge branch 'feature/maxgen-maxpump-cr23' into feature/max-hydro-gen…
Milos-RTEi Aug 16, 2023
be21fda
Merge branch 'develop-new' into feature/max-hydro-gen-pump-per-h-cr23
nikolaredstork Aug 16, 2023
578c6e5
Post merge build fix
nikolaredstork Aug 17, 2023
fb0c474
Fix sonar bugs
nikolaredstork Aug 17, 2023
a9e6519
Exclude duplication code
nikolaredstork Aug 17, 2023
b2899d5
Some minor code smells
nikolaredstork Aug 17, 2023
596d9f4
More code smells
nikolaredstork Aug 18, 2023
54bbc79
Resolving Code smells
nikolaredstork Aug 18, 2023
2672405
Unit test datatransfer
nikolaredstork Aug 21, 2023
f78e096
Merge branch 'develop' into feature/max-hydro-gen-pump-per-h-cr23
nikolaredstork Aug 21, 2023
20a4738
Post merge build fix
nikolaredstork Aug 21, 2023
b1874ec
Additional datatransfer unit tests
nikolaredstork Aug 22, 2023
32b56e5
LoadPowerCredits func unit tests
nikolaredstork Aug 22, 2023
c0643bb
Comment correction
nikolaredstork Aug 22, 2023
838c04c
Additional comments
nikolaredstork Aug 22, 2023
376f24d
Refactoring unit tests
nikolaredstork Aug 23, 2023
1eb238c
Refactoring hydro series unit tests
nikolaredstork Aug 23, 2023
fe47970
Help files for unit tests
nikolaredstork Aug 23, 2023
8fa59e9
Exclude unnecessary code
nikolaredstork Aug 23, 2023
25c4b23
MD files
nikolaredstork Aug 23, 2023
426b3c9
Remove function for unit tests
nikolaredstork Aug 24, 2023
9cd3f88
Merge branch 'develop' into feature/max-hydro-gen-pump-per-h-cr23
nikolaredstork Aug 24, 2023
edd5c50
Passing by reference
nikolaredstork Aug 25, 2023
5354e87
Merge branch 'develop' into feature/max-hydro-gen-pump-per-h-cr23
nikolaredstork Aug 25, 2023
867aa5b
Merge branch 'develop' into feature/max-hydro-gen-pump-per-h-cr23
nikolaredstork Aug 25, 2023
81850af
Merge branch 'develop' into feature/max-hydro-gen-pump-per-h-cr23
nikolaredstork Aug 31, 2023
030af42
Merge branch 'develop' into feature/max-hydro-gen-pump-per-h-cr23
nikolaredstork Sep 4, 2023
7c5ddc5
Merge branch 'develop' into feature/max-hydro-gen-pump-per-h-cr23
nikolaredstork Sep 8, 2023
f1c3673
Copy from UI
nikolaredstork Sep 13, 2023
d21f858
Merge branch 'develop' into feature/max-hydro-gen-pump-per-h-cr23
nikolaredstork Sep 13, 2023
6c01298
Post merge build errors
nikolaredstork Sep 15, 2023
fd1e1eb
Merge branch 'develop' into feature/max-hydro-gen-pump-per-h-cr23
nikolaredstork Sep 18, 2023
baa6994
Merge branch 'develop' into feature/max-hydro-gen-pump-per-h-cr23
nikolaredstork Sep 21, 2023
00b8592
Post merge build errors resolved
nikolaredstork Sep 21, 2023
cc82545
Multiple Maximum Generation and Pumping for Hydro (Refactoring) (#1648)
nikolaredstork Oct 26, 2023
0938768
Preparation for merge
nikolaredstork Oct 27, 2023
7707ac3
Merge branch 'develop' into feature/max-hydro-gen-pump-per-h-cr23
nikolaredstork Oct 28, 2023
4b3274e
Refactoring due to merging with develop
nikolaredstork Oct 28, 2023
bf5c1d4
Excluding unnecessary function argument
nikolaredstork Oct 28, 2023
df5b115
Fix build error
nikolaredstork Oct 28, 2023
9cdee5c
update form develop and simplifications on CR 23 (#1728)
guilpier-code Oct 31, 2023
d3bf301
Merge remote-tracking branch 'remotes/origin/develop' into feature/ma…
guilpier-code Oct 31, 2023
7988dde
Simplification on CR23: ResizeTS function (#1729)
nikolaredstork Oct 31, 2023
3da3b13
Small refactoring CR23 - File deletion (#1732)
nikolaredstork Nov 2, 2023
747ca30
[skip ci] : add a TODO regarding scratchpad and hydro max power daily…
guilpier-code Nov 3, 2023
f0056dd
CR23 Modification : Unit tests refactoring (#1740)
nikolaredstork Nov 3, 2023
c562812
[skip ci] : complete a TODO on scratchpad and hydro max power daily T…
guilpier-code Nov 3, 2023
8b4a1a5
[skip ci] CR 23 (hourly max power TS) : just renaming local variables
guilpier-code Nov 3, 2023
af4ad02
CR 23 (new hydro hourly max power TS) : replace useless and unclear s…
guilpier-code Nov 3, 2023
0697e89
CR 23 (new hydro hourly max power TS) : just removing a useless if st…
guilpier-code Nov 6, 2023
4463240
Merge branch 'develop' into feature/max-gen-pump-cr23-develop-merge
nikolaredstork Nov 6, 2023
2a52a46
Declaring class member function as const
nikolaredstork Nov 6, 2023
468bd2e
CR 23 (new hydro hourly max power TS) : changing definition and usage…
guilpier-code Nov 6, 2023
8d62fa9
[skip ci] CR 23 (new hydro hourly max power TS) : just renaming local…
guilpier-code Nov 6, 2023
3eff63d
CR 23 (new hydro hourly max power TS) : renaming hydro daily TS into …
guilpier-code Nov 6, 2023
4232fcc
CR 23 (new hydro hourly max power TS) : improving helper free functio…
guilpier-code Nov 6, 2023
d6c2d13
Indent return statement
nikolaredstork Nov 6, 2023
07e112f
Clang format
nikolaredstork Nov 6, 2023
092abb4
Possible fix
nikolaredstork Nov 6, 2023
b3c9cdb
[skip ci] CR 23 (new hydro hourly max power TS) : a bit cleaning and …
guilpier-code Nov 7, 2023
fe6cbe7
[skip ci] CR 23 (new hydro hourly max power TS) : add a TODO comment
guilpier-code Nov 7, 2023
a8152ed
Remove helper class PairOfIntegers (#1763)
flomnes Nov 10, 2023
3f4530c
remove folder
nikolaredstork Nov 13, 2023
0b50919
Revert "remove folder"
nikolaredstork Nov 13, 2023
8529ed8
Removing compiler warning
nikolaredstork Nov 13, 2023
f7304a0
HydroMaxReader class refactor (#1750)
nikolaredstork Nov 15, 2023
4d0e5a5
update antares-deps
guilpier-code Dec 7, 2023
00c1ba3
Small refactoring CR23 (#1784)
nikolaredstork Dec 7, 2023
e368fe4
Study version literal change from 870 to 890 (#1814)
nikolaredstork Dec 8, 2023
e2b9339
Merge remote-tracking branch 'github/develop' into feature/max-gen-pu…
flomnes Jan 18, 2024
ec9f4dc
Clean out removed function
flomnes Jan 18, 2024
b4b03bc
Remove study.gotFatalError
flomnes Jan 18, 2024
ab4e9b2
One more fix
flomnes Jan 18, 2024
5e5edbf
Add missing dependency
flomnes Jan 19, 2024
6217c8d
Reùove unused fatalError
flomnes Jan 19, 2024
292989a
Fix header for Boost Test
flomnes Jan 22, 2024
a186bad
Merge remote-tracking branch 'github/develop' into feature/max-gen-pu…
flomnes Jan 22, 2024
5582406
Fix size for storage timeSeriesNumbers
flomnes Jan 22, 2024
8ce0cff
Fix changed TS numbers for ROR
flomnes Jan 22, 2024
3415b2e
Remove useless #define
flomnes Jan 22, 2024
bee6e82
Merge remote-tracking branch 'github/develop' into feature/max-gen-pu…
flomnes Jan 25, 2024
5bea0ca
Fix build
flomnes Jan 25, 2024
4392ccc
In-memory tests for CR23 (#1894)
flomnes Feb 5, 2024
016c186
Merge remote-tracking branch 'github/develop' into feature/max-gen-pu…
flomnes Feb 5, 2024
f1e84ed
CR23 Reference Guide Update (#1904)
nikolaredstork Feb 6, 2024
da9e697
Downgrade log (error -> warning)
flomnes Feb 6, 2024
0a2b300
Update docs/reference-guide/13-file-format.md
flomnes Feb 6, 2024
30ce902
Merge commit '008989235d6b470bca1acec56c401e68e6640299' into feature/…
guilpier-code Feb 20, 2024
2bcf620
corrections after merge from develop
guilpier-code Feb 21, 2024
837afbd
Corrections after merge from develop
guilpier-code Feb 21, 2024
acdff1a
Merge branch 'develop' into merge-develop_to-cr23
guilpier-code Feb 21, 2024
f098190
move generated file config.h from repo
guilpier-code Feb 21, 2024
05fe9e6
Merge remote-tracking branch 'origin/develop' into feature/max-gen-pu…
Feb 26, 2024
c06b3b8
ts-numbers/max-power -> ts-numbers/hgp
Feb 26, 2024
6fab9c1
Remove progress ticks
Feb 26, 2024
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
2 changes: 1 addition & 1 deletion docs/reference-guide/03-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ this command allows to state, for each kind of time-series, whether it should be
the available set (be it ready-made or Antares-generated) _**OR**_ should take a user-defined value
(in the former case, the default "rand" value should be kept; in the latter, the value should be the reference number of the time-series to use). Multiple simulation profiles can be defined and archived. The default active profile gives the "rand" status for all time-series in all areas (full probabilistic simulation).

Regarding Hydro time-series, the scenario builder gives, in addition to the assignment of a specific number to use for the inflows time-series, the ability to define the initial reservoir level to use for each MC year.
Regarding Hydro time-series, the scenario builder gives, in addition to the assignment of a specific number to use for the inflows time-series, the ability to define the initial reservoir level to use for each MC year, also hydro max power scenario builder is available to support time-series for Maximum Generation and Maximum Pumping because the number of TS's for ROR, Hydro Storage and Minimum Generation can be different than the number of TS's for Maximum Generation and Maximum Pumping.

- **MC Scenario playlist** For each Monte-Carlo year of the simulation defined in the "Simulation" active window,
this command allows to state whether a MC year prepared for the simulation should be actually simulated or not.
Expand Down
19 changes: 10 additions & 9 deletions docs/reference-guide/04-active_windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ These two parts are detailed hereafter.

### RIGHT PART: Time-series management

For the different kinds of time-series that Antares manages in a non-deterministic way (load, thermal generation, hydro power, wind power, solar power or renewable depending on the option chosen):
For the different kinds of time-series that Antares manages in a non-deterministic way (load, thermal generation, hydro power, hydro max power, wind power, solar power or renewable depending on the option chosen):

1. **Choice of the kind of time-series to use**
Either « ready-made » or «stochastic » (i.e. Antares-generated), defined by setting the value to either "on" or "off". Note that for Thermal time-series, the cluster-wise parameter may overrule this global parameter (see Thermal window description below).
Either « ready-made » or «stochastic » (i.e. Antares-generated), defined by setting the value to either "on" or "off". Exception is hydro max power that can only be « ready-made ». Note that for Thermal time-series, the cluster-wise parameter may overrule this global parameter (see Thermal window description below).

2. **For stochastic TS only**:
- **Number** Number of TS to generate
Expand Down Expand Up @@ -295,11 +295,11 @@ which explains the comparatively long length of this chapter.

In the main Window, the user may pick any area appearing in the list and is then given access to different tabs:

- The "time-series" tab displays the "ready-made" time-series already available for simulation purposes. There are two categories of time-series (displayed in two different subtabs): the Run of River (ROR) time-series on the one hand and the Storage power (SP) time-series on the other hand.
- The "time-series" tab displays the "ready-made" time-series already available for simulation purposes. There are five categories of time-series (displayed in five different subtabs): the Run of River (ROR) time-series, the Storage power (SP) time-series, the Minimum Generation power, the Maximum Generation power and the Maximum Pumping Power.

ROR time-series are defined at the hourly scale; each of the 8760 values represents the ROR power expected at a given hour, expressed in round number and in MW. The SP time-series are defined at the daily scale; each of the 365 values represents an overall SP energy expected in the day, expressed in round number and in MWh. These natural inflows are considered to be storable into a reservoir for later use.
ROR time-series are defined at the hourly scale; each of the 8760 values represents the ROR power expected at a given hour, expressed in round number and in MW. The SP time-series are defined at the daily scale; each of the 365 values represents an overall SP energy expected in the day, expressed in round number and in MWh. These natural inflows are considered to be storable into a reservoir for later use. The Minimum Generation time-series are defined at the hourly scale; each of the 8760 values represents the Minimum Generation power expected at a given hour expressed in round number and in MW. The Maximum Generation time-series are defined at the hourly scale; each of the 8760 values represents the Maximum Generation power expected at a given hour expressed in round number and in MW. The Maximum Pumping time-series are defined at the hourly scale; each of the 8760 values represents the Maximum Pumping power expected at a given hour expressed in round number and in MW.

Both types of data may come from any origin outside Antares, or may have been formerly generated by the Antares time-series stochastic generator and stored as input data on the user's request. Different ways to update data are:
ROR time-series and SP time-series may come from any origin outside Antares, or may have been formerly generated by the Antares time-series stochastic generator and stored as input data on the user's request. Minimum Generation, Maximum Generation and Maximum Pumping may come from any origin outside Antares, but they can not be generated by the Antares time-series stochastic generator. Different ways to update data are:

- direct typing
- copy/paste a selected field to/from the clipboard
Expand All @@ -313,7 +313,8 @@ In the main Window, the user may pick any area appearing in the list and is then

- _Note that:_

- _For a given area, the number of ROR time-series and SP times-series **must** be identical_
- _For a given area, the number of ROR time-series, SP times-series and Minimum Generation **must** be identical_
- _For a given area, the number of Maximum Generation and Maximum Pumping **must** be identical_
- _If the "intra-modal correlated draws" option was not selected in the_ **simulation** _window,
MC adequacy or economy simulations can take place even if the number of hydro time-series is not the same
in all areas (e.g. 2 , 5 , 1 , 45 ,...)_
Expand Down Expand Up @@ -376,10 +377,10 @@ the weekly optimal hydro-thermal unit-commitment and dispatch process.
Standard credits (Bottom part)

The bottom part displays two daily time-series (365 values) defined for energy generation/storage
(hydro turbines or hydro pumps). In each case, the first array defines the maximum power (generated or absorbed),
and the second defines the maximum daily energy (either generated or stored).
(hydro turbines or hydro pumps). Both arrays represents the maximum daily energy (either generated or stored).

For the sake of clarity, maximum daily energies are expressed as a number of hours at maximum power.
For the sake of clarity, maximum daily energies are expressed as a number of hours at maximum power and these values
are used along with the Maximum Generation and Maximum Pumping TS's to calculate daily mean energy.

Credit modulation (Upper part)

Expand Down
7 changes: 7 additions & 0 deletions docs/reference-guide/13-file-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ Using this property requires OR-Tools and a MILP solver (XPRESS, COIN)
```
antares-8.8-solver --use-ortools --ortools-solver coin|xpress ...
```
For each area, new files are added **input/hydro/series/<area>/maxHourlyGenPower.txt** and **input/hydro/series/<area>/maxHourlyPumpPower.txt**. These files have one or more columns, and 8760 rows. The number of columns in these two files must be the same, if there is more than one column in each file, but if there is just one column for example in maxHourlyGenPower.txt file, maxHourlyPumpPower.txt file can have more than one column and vice versa. For old studies, file **input/hydro/common/capacity/maxpower_<area>** will be deleted after upgrading the study and corresponding data from that file will be copied to already mentioned new files, even if study is upgraded or not. In that case maxHourlyGenPower.txt and maxHourlyPumpPower.txt files will have just one column and 8760 rows.

Also for each area, new files are added **input/hydro/common/capacity/maxDailyGenEnergy_<area>** and **input/hydro/common/capacity/maxDailyPumpEnergy_<area>**. These files have just one column and 365 rows. For old studies, file **input/hydro/common/capacity/maxpower_<area>** will be deleted after upgrading the study and corresponding data from that file will be copied to already mentioned new files, even if study is upgraded or not.
### Input
Under `Configure/MC Scenario Builder` new section added `Hydro Max Power`
In the existing file **settings/scenariobuilder.dat**, under **<ruleset>** section following properties added:
* **hgp,<area>,<year> = <hgp-value>**

## v8.7.0
### Input
Expand Down
2 changes: 1 addition & 1 deletion src/antares-deps
Copy link
Member

Choose a reason for hiding this comment

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

revert this ?

Copy link
Collaborator Author

@nikolaredstork nikolaredstork Nov 13, 2023

Choose a reason for hiding this comment

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

Accidentally pushed. I've tried to delete folder, but that is not the solution. How to resolve this?

Copy link
Contributor

Choose a reason for hiding this comment

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

I took care of this, it has now disappear

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks a lot!! It was killing us, how to fix it!

Submodule antares-deps updated 1 files
+1 −1 CMakeLists.txt
2 changes: 2 additions & 0 deletions src/libs/antares/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
/*! Hours per year */
#define HOURS_PER_YEAR 8760

#define HOURS_PER_DAY 24U

namespace Antares::Constants
{
extern const std::array<unsigned int, 12> daysPerMonth;
Expand Down
1 change: 0 additions & 1 deletion src/libs/antares/series/series.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,5 +141,4 @@ uint64_t TimeSeries::memoryUsage() const
{

Choose a reason for hiding this comment

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

This PR contains console logs. Please review or remove them.

return timeSeries.memoryUsage();
}

} // namespace Antares::Data
4 changes: 4 additions & 0 deletions src/libs/antares/study/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ set(SRC_STUDY_SCENARIO_BUILDER
scenario-builder/ThermalTSNumberData.h
scenario-builder/HydroTSNumberData.h
scenario-builder/HydroTSNumberData.cpp
scenario-builder/HydroMaxPowerTSNumberData.h
scenario-builder/HydroMaxPowerTSNumberData.cpp
scenario-builder/SolarTSNumberData.cpp
scenario-builder/solarTSNumberData.h
scenario-builder/WindTSNumberData.h
Expand Down Expand Up @@ -128,6 +130,8 @@ set(SRC_STUDY_PART_HYDRO
parts/hydro/allocation.h
parts/hydro/allocation.hxx
parts/hydro/allocation.cpp
parts/hydro/hydromaxtimeseriesreader.h
parts/hydro/hydromaxtimeseriesreader.cpp
)
source_group("study\\part\\hydro" FILES ${SRC_STUDY_PART_HYDRO})

Expand Down
2 changes: 2 additions & 0 deletions src/libs/antares/study/area/area.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ void Area::resizeAllTimeseriesNumbers(uint n)
solar.series.timeseriesNumbers.clear();
wind.series.timeseriesNumbers.clear();
hydro.series->timeseriesNumbers.clear();
hydro.series->timeseriesNumbersHydroMaxPower.clear();
for (auto& namedLink : links)
{
AreaLink* link = namedLink.second;
Expand All @@ -281,6 +282,7 @@ void Area::resizeAllTimeseriesNumbers(uint n)
solar.series.timeseriesNumbers.resize(1, n);
wind.series.timeseriesNumbers.resize(1, n);
hydro.series->timeseriesNumbers.resize(1, n);
hydro.series->timeseriesNumbersHydroMaxPower.resize(1, n);
for (auto& namedLink : links)
{
AreaLink* link = namedLink.second;
Expand Down
1 change: 0 additions & 1 deletion src/libs/antares/study/area/area.h
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,6 @@ class Area final : private Yuni::NonCopyable<Area>
void createMissingTimeSeries();
void createMissingPrepros();


}; // class Area

bool saveAreaOptimisationIniFile(const Area& area, const Yuni::Clob& buffer);
Expand Down
37 changes: 32 additions & 5 deletions src/libs/antares/study/area/list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -897,12 +897,41 @@ static bool AreaListLoadFromFolderSingleArea(Study& study,
buffer.clear() << study.folderInput << SEP << "hydro" << SEP << "prepro";
ret = area.hydro.prepro->loadFromFolder(study, area.id, buffer.c_str()) && ret;
}
if (area.hydro.series && (!options.loadOnlyNeeded || !area.hydro.prepro)) // Series

auto* hydroSeries = area.hydro.series;
if (!options.loadOnlyNeeded || !area.hydro.prepro) // Series
{
buffer.clear() << study.folderInput << SEP << "hydro" << SEP << "series";
ret = area.hydro.series->loadFromFolder(study, area.id, buffer) && ret;
ret = hydroSeries->loadGenerationTS(area.id, buffer, study.header.version) && ret;

hydroSeries->EqualizeGenerationTSsizes(
area, study.usedByTheSolver, study.gotFatalError);
}

if (study.header.version < 870)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (study.header.version < 870)
if (study.header.version < 890)

Copy link
Contributor

Choose a reason for hiding this comment

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

Still a lot of 870 in the code base, we should take care of this and turn them to 890.

{
buffer.clear() << study.folderInput << SEP << "hydro";

HydroMaxTimeSeriesReader reader;
ret = reader(buffer, area, study.usedByTheSolver) && ret;
}

if (study.header.version >= 870)
{
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (study.header.version >= 870)
{
else {

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done!

buffer.clear() << study.folderInput << SEP << "hydro" << SEP << "series";
ret = hydroSeries->LoadMaxPower(area.id, buffer) && ret;

if (study.usedByTheSolver)
{
hydroSeries->EqualizeMaxPowerTSsizes(area, study.gotFatalError);
}
else
hydroSeries->setHydroModulability(area);
}

hydroSeries->resizeTSinDeratedMode(
study.parameters.derated, study.header.version, study.usedByTheSolver);

++options.progressTicks;
options.pushProgressLogs();
}
Expand Down Expand Up @@ -1556,9 +1585,7 @@ void AreaList::removeLoadTimeseries()

void AreaList::removeHydroTimeseries()
{
each([](Data::Area& area) {
area.hydro.series->reset();
});
each([](Data::Area& area) { area.hydro.series->reset(); });
}

void AreaList::removeSolarTimeseries()
Expand Down
Loading
Loading