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 (Refactoring) #1648

Conversation

nikolaredstork
Copy link
Collaborator

This PR is created for clearing comments from RTE on feature/max-hydro-gen-pump-per-h-cr23 branch.
Link of the base PR :
#1470

@nikolaredstork nikolaredstork changed the title Feature/max hydro gen pump per h cr23 rte comments Multiple Maximum Generation and Pumping for Hydro (Refactoring) Sep 22, 2023
@flomnes flomnes added this to the v8.9.0 milestone Oct 13, 2023
nikolaredstork and others added 10 commits October 13, 2023 16:01
* Refactor max power TS checks : several things (see commit message)

This commit is large, it should be shorter, but the long compilation time forces to gather the devs in one piece.
- Remove the exception raising, not necessary : the gotFatalError (set to true) will trigger an exception anyway.
- class NbTsComparer : is generalized to any time series pair :
   + to isolate it from business context
   + to have a chance to re-use it in another context
- Move both classes NbTsComparer and TsActions outside class DataSeriesHydro, for same reasons as above
- Rename TsActions::handleBothGreaterThanOne (unclear) into something more meaningful
- Consequences of previous changes in tests

* Refactor max power TS checks : several things (see commit message)

TsActions::areaToInvalidate :
- Remove areaToInvalidate from class TsActions (it has nothing to do in here) and make it a free function
- Extract areaToInvalidate calls from TsActions::resizeWhenOneTS, as calling it here not related to TsActions

* Refactor max power TS checks : simplify TsActions::resizeWhenOneTS

* Refactor max power TS checks : remove a useless argument to free function invalidateArea

* Refactor max power TS checks : changing invalidateArea's signature and content

In this context, pointer area (as argument) is necessarily not null, because it is used way before we come to this point.
So :
- We make area a reference
- We stop testing the area address (we known it's not null)
- We remove the dead code (when area address is null)

* Refactor max power TS checks : several things (see commit message)

- Move class NumberComparison to separate source files
- Remove return type to function postProcessMaxPowerTS : no more boolean returned, but void.
  Returning boolean is for loading tasks, here we check and possibly change already loaded data.
  We adapt tests, as a consequence
- Removing class TsActions, not useful
-

* Refactor max power TS checks : add forgotten files + renaming

* Refactor max power TS checks : remove case where both TS matrices (pump + gen) have null width, impossible

* Refactor max power TS checks : just removing useless comments

* Refactor max power TS checks : a bot of cleaning

* Refactor max power TS checks : internalize count of generation time series (ror, storage, mingen)

We should not be able to change a TS count without resizing the TS.
This was allowed when because this count was a public data member.
So we make it a private data member, and change it only when resizing the associated data.

* Refactor max power TS checks : renaming

* Refactor max power TS checks : renaming

* Refactor max power TS checks : adapt CI Window workflow to new runner (about python)

* Refactor max power TS checks : define and use of function EqualizeTSsize(...)

* Refactor max power TS checks : rearrange DataSeriesHydro::loadFromFolder, but no major change

* Refactor max power TS checks : remove the case where TS (ror, storage, mingen) have a zero size. Impossible case.

* Refactor max power TS checks : fix bugs on function EqualizeTSsize

* Refactor max power TS checks :  use maxPowerTScount() whenever possible

* Refactor max power TS checks : removing the setter for max power TS number

* Refactor max power TS checks : fix a bug due to removing the setter for max power TS number

* Refactor max power TS checks : gather loading and equalizing hydro mingen TS

* Refactor max power TS checks : split load of ROR, STORAGE and MINGEN

* Refactor max power TS checks : loading Max Power TS : using a generic loading function

* Refactor max power TS checks : fix a bug on loading inflows (height ont correct)

* Refactor max power TS checks : correction after (small) merge

* Refactor max power TS checks : fixing bug on loading inflows was wrong. Fixing it for real now.

* Refactor max power TS checks : remove useless checkMinGenTsNumber

* Refactor max power TS checks : cleaning on the very ugly setHydroModulability (too many args, body too big)

* Refactor max power TS checks : correct derated mode for hydro

* Refactor max power TS checks : some more corrections due to review

* Refactor max power TS checks : some more corrections after review

* Refactor max power TS checks : fixing errors introduced by earlier corrections

* Refactor max power TS checks : more corrections after review

* Refactor max power TS checks : more corrections due to tight review :-)

* Fixing sonar bug

* Code smells

* Use init-statement inside the if statement for hydroSeries ptr

* More code smells

---------

Co-authored-by: NikolaIlic <[email protected]>
@sonarcloud
Copy link

sonarcloud bot commented Oct 26, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 21 Code Smells

26.4% 26.4% Coverage
0.3% 0.3% Duplication

@nikolaredstork nikolaredstork merged commit cc82545 into feature/max-hydro-gen-pump-per-h-cr23 Oct 26, 2023
7 checks passed
@nikolaredstork nikolaredstork deleted the feature/max-hydro-gen-pump-per-h-cr23-rte-comments branch October 26, 2023 20:47
@nikolaredstork nikolaredstork restored the feature/max-hydro-gen-pump-per-h-cr23-rte-comments branch October 26, 2023 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants