Skip to content

[ANT-3760] 920 Test NR to cucumber#3134

Draft
JasonMarechal25 wants to merge 73 commits intodevelopfrom
feature/920_annual
Draft

[ANT-3760] 920 Test NR to cucumber#3134
JasonMarechal25 wants to merge 73 commits intodevelopfrom
feature/920_annual

Conversation

@JasonMarechal25
Copy link
Copy Markdown
Contributor

No description provided.

@JasonMarechal25 JasonMarechal25 changed the base branch from develop to feature/NPCAP_cucumber October 9, 2025 13:30
@JasonMarechal25 JasonMarechal25 changed the title Move test to cucumber [ANT-3760] Move test to cucumber Oct 9, 2025
@JasonMarechal25 JasonMarechal25 changed the title [ANT-3760] Move test to cucumber [ANT-3760] 920 Test NR to cucumber Oct 28, 2025
Base automatically changed from feature/NPCAP_cucumber to develop October 30, 2025 08:50
JasonMarechal25 and others added 8 commits October 30, 2025 13:46
Use a variadic template to generate spatial agregate type list. Code is easier to read and diff to compare.
- Split LinearExpression.h / TimeDependentLinearExpression.h, same for
.cpp
- Remove `std::variant`
- Rename `removeDuplicateCoefficients` -> `mergeDuplicateCoefficients`
- Other minor remarks
> 15:59:31][solver][infos] Generating the wind time-series
[2025-10-09 15:59:31][solver][infos]  Doing hydro validation
[2025-10-09 15:59:31][solver][infos]  Starting the simulation
[2025-10-09 15:59:32][solver-0][infos] Year 1 started
[2025-10-09 15:59:32][solver-0][debug] year 1 received numSpace 0
[2025-10-09 15:59:32][solver-0][infos] 
[2025-10-09 15:59:32][solver-0][infos] Modeler build took 0.063 s
[2025-10-09 15:59:32][solver-0][infos] 
[2025-10-09 15:59:32][solver-0][infos] 
[2025-10-09 15:59:32][solver-0][infos] Total Problem size : 336
variables, 336 constraints
[2025-10-09 15:59:32][solver-0][infos] 
[2025-10-09 15:59:32][solver-0][infos] 
WARNING: All log messages before absl::InitializeLog() is called are
written to STDERR
W0000 00:00:1760018372.656011 1047085 sirius_interface.cc:1120]
SetPrimalTolerance not implemented for sirius_interface
W0000 00:00:1760018372.671279 1047085 sirius_interface.cc:1127]
SetDualTolerance not implemented for sirius_interface
[2025-10-09 15:59:32][solver-0][infos] Solved in 0.149 s
[2025-10-09 15:59:32][solver-0][infos] 
[2025-10-09 15:59:32][solver-0][infos] Modeler build took 0.021 s
W0000 00:00:1760018372.835302 1047085 sirius_interface.cc:1120]
SetPrimalTolerance not implemented for sirius_interface
W0000 00:00:1760018372.835381 1047085 sirius_interface.cc:1127]
SetDualTolerance not implemented for sirius_interface
[2025-10-09 15:59:32][solver-0][infos] Solved in 0.007 s
[2025-10-09 15:59:34][solver-1][infos] Year 2 started
[2025-10-09 15:59:34][solver-1][debug] year 2 received numSpace 1

---------

Co-authored-by: Jason Maréchal <45510813+JasonMarechal25@users.noreply.github.com>
Co-authored-by: Jason Maréchal <45510813+JasonMarechal25@users.noreply.github.com>
payetvin and others added 13 commits October 30, 2025 13:46
Co-authored-by: Jason Maréchal <45510813+JasonMarechal25@users.noreply.github.com>
Co-authored-by: Florian Omnès <florian.omnes@rte-france.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
### Current behavior
Deprecation of keys or values in general data trigger warnings.
General-data warning are considered fatal and end the simulation. Unless
_--force_ flag is used.

### Problem
When going from Antares 8.8 to Antares 9.x with a study containing
deprecated values, the simulation end in error due to the behavior
previously described.

### Expectation
Upgrading executable should not force user to update studies for
deprecated keys or values.

### Proposal
* Elevate all fatal warning as proper errors
* Keep depreciation warning as such
* Warning are now non-fatal
* It is still possible to by-pass now-errors with _--force_ flag

### Results:

#### Launching with error and warning. Errors are fatal

> [2025-10-15 14:00:00][solver][debug] Releasing runtime data
[2025-10-15 14:00:00][solver][warns] In generaldata.ini, parameter
`refreshtimeseries` is no longer supported since version 9.3, consider
removing it from the study
[2025-10-15 14:00:00][solver][error] Assertion error for unfeasible
problem behavior from string conversion : Unexpected
N7Antares4Data25UnfeasibleProblemBehaviorE name error-verbos
[2025-10-15 14:00:00][solver][error] parameters: invalid unfeasible
problem behavior. Got 'error-verbos'. reset to error-verbose
[2025-10-15 14:00:00][solver][error] /tmp/test_NR/hybrid/001 One node -
passive/settings/generaldata.ini: 'include-unfeasible-problem-behavior':
Unknown property
[2025-10-15 14:00:00][solver][error] parameters: invalid renewable
generation modelling. Got 'aggregate'
[2025-10-15 14:00:00][solver][error] /tmp/test_NR/hybrid/001 One node -
passive/settings/generaldata.ini: 'renewable-generation-modelling':
Unknown property
[2025-10-15 14:00:00][solver][error] Generation should be either
`clusters` or `aggregated`
[2025-10-15 14:00:00][solver][fatal] The simulation must stop.
[2025-10-15 14:00:00][solver][error] Aborting now. See logs for more
details
> 
> Process finished with exit code 1

#### Launching with error and warning, --force:

> [2025-10-15 14:02:46][solver][infos] Found 6 errors and 1 warning: As
requested, the warnings can be ignored and the simulation will continue
[2025-10-15 14:02:46][solver][infos] However here is the list of errors:
[2025-10-15 14:02:46][solver][warns] In generaldata.ini, parameter
`refreshtimeseries` is no longer supported since version 9.3, consider
removing it from the study
[2025-10-15 14:02:46][solver][error] Assertion error for unfeasible
problem behavior from string conversion : Unexpected
N7Antares4Data25UnfeasibleProblemBehaviorE name error-verbos
[2025-10-15 14:02:46][solver][error] parameters: invalid unfeasible
problem behavior. Got 'error-verbos'. reset to error-verbose
[2025-10-15 14:02:46][solver][error] /tmp/test_NR/hybrid/001 One node -
passive/settings/generaldata.ini: 'include-unfeasible-problem-behavior':
Unknown property
[2025-10-15 14:02:46][solver][error] parameters: invalid renewable
generation modelling. Got 'aggregate'
[2025-10-15 14:02:46][solver][error] /tmp/test_NR/hybrid/001 One node -
passive/settings/generaldata.ini: 'renewable-generation-modelling':
Unknown property
[2025-10-15 14:02:46][solver][error] Generation should be either
`clusters` or `aggregated`
[2025-10-15 14:02:46][solver][infos] 
[2025-10-15 14:02:46][solver][infos] Generating calendar informations

We print the list again at the end because users don't read logs :

> [2025-10-15 14:11:45][solver][infos] Total simulation time: 00h00m00s
[2025-10-15 14:11:45][solver][error] Simulation completed but there were
some errors during loading. Here is the list:
[2025-10-15 14:11:45][solver][warns] In generaldata.ini, parameter
`refreshtimeseries` is no longer supported since version 9.3, consider
removing it from the study
[2025-10-15 14:11:45][solver][error] parameters: invalid renewable
generation modelling. Got 'aggregate'
[2025-10-15 14:11:45][solver][error] /tmp/test_NR/hybrid/001 One node -
passive/settings/generaldata.ini: 'renewable-generation-modelling':
Unknown property
[2025-10-15 14:11:45][solver][error] Generation should be either
`clusters` or `aggregated`
[2025-10-15 14:11:45][solver][infos] [UI] Quitting the solver gracefully

#### Launching with warning only. Warnings are **non**-fatal We only
print the list at the end

> [2025-10-15 14:13:22][solver][infos] Total simulation time: 00h00m00s
[2025-10-15 14:13:22][solver][warns] Simulation completed but there were
some warnings during loading. Here is the list:
[2025-10-15 14:13:22][solver][warns] In generaldata.ini, parameter
`refreshtimeseries` is no longer supported since version 9.3, consider
removing it from the study
[2025-10-15 14:13:22][solver][infos] [UI] Quitting the solver gracefully

---------

Co-authored-by: Florian Omnès <florian.omnes@rte-france.com>
Add class `SingleProblemGetter` to allow for single week problem loading
```cpp
Antares::Solver::SingleProblemGetter getter;
getter.load("/path/to/study");
auto constant = getter.getConstantData();
auto weekly = getter.getWeeklyData({/*year*/0, /*week*/1});
```

# TODO
- [X] Load study from a filepath
- [X] Return proper constant data
- [X] Return proper weekly data from user-provided week & year indices
- [x] Check noises
- [x] Check hydro credits, that is RHS for weekly constraint
`HydroPower`
- [x] Check timeseries generation (depends on #3182) 
- [x] Cache yearly data (no need to recompute yearly data)
- [X] Check call to `Study::computePThetaInfForThermalClusters`
- [ ] Check simulations not starting on Jan 1st
- [x] Add unit testing
- [x] Clean up code (duplication, TODOs, etc.)
When visiting `expression[t]`, the shifted_expr is optional: if it is
absent, ANTLR returns a `nullptr`. This PR handles this case gracefully
(no shift).
@JasonMarechal25 JasonMarechal25 marked this pull request as ready for review October 30, 2025 13:59
Copilot AI review requested due to automatic review settings November 20, 2025 11:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@sonarqubecloud
Copy link
Copy Markdown

# Conflicts:
#	src/tests/cucumber/features/steps/common_steps/solver_output_handler.py
@sonarqubecloud
Copy link
Copy Markdown

@JasonMarechal25 JasonMarechal25 marked this pull request as draft March 20, 2026 10:32
@flomnes flomnes added the stale Pull request has been inactive for an extended period label Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L stale Pull request has been inactive for an extended period

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants