Skip to content

Commit

Permalink
feat(log_parser): set the progression rate to 100% on error or fatal …
Browse files Browse the repository at this point in the history
…error
  • Loading branch information
laurent-laporte-pro committed Aug 2, 2023
1 parent 6e07457 commit dca1cd3
Show file tree
Hide file tree
Showing 14 changed files with 269,997 additions and 32 deletions.
10 changes: 8 additions & 2 deletions antarest/launcher/adapters/log_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,16 @@
_compile(r"Exporting \s+ the \s+ survey \s+ results").search,
)

# Search for the line indicating the solver is quitting gracefully.
# Search for the line indicating the solver is quitting gracefully or an error
_quitting = t.cast(
_SearchFunc,
_compile(r"Quitting \s+ the \s+ solver \s+ gracefully").search,
_compile(
r"""
Quitting \s+ the \s+ solver \s+ gracefully |
\[error] |
\[fatal]
"""
).search,
)


Expand Down
3 changes: 3 additions & 0 deletions tests/launcher/assets/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from pathlib import Path

ASSETS_DIR = Path(__file__).parent.resolve()
1 change: 1 addition & 0 deletions tests/launcher/assets/log_parser/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!*.log
14 changes: 14 additions & 0 deletions tests/launcher/assets/log_parser/simulation.error-big.history.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
[
"[Wed Nov 10 10:43:15 2021][solver][fatal] User's playlist: at least one year must be selected",
100.0
],
[
"[Wed Nov 10 10:43:15 2021][solver][infos] Loading the list of areas...",
1.0
],
[
"[Wed Nov 10 10:43:37 2021][solver][error] Found 1 error and 1 warning: The simulation must stop.",
100.0
]
]
2,971 changes: 2,971 additions & 0 deletions tests/launcher/assets/log_parser/simulation.error-big.log

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions tests/launcher/assets/log_parser/simulation.error.history.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
[
"[Fri Dec 9 23:16:48 2022][solver][infos] Loading the list of areas...",
1.0
],
[
"[Fri Dec 9 23:16:49 2022][solver][error] I/O error: /home/omnesflo/short/029 Pumped storage plant - 2/input/areas/east/adequacy_patch.ini: Impossible to read the file",
100.0
],
[
"[Fri Dec 9 23:16:49 2022][solver][error] Found 1 error: The simulation must stop.",
100.0
]
]
84 changes: 84 additions & 0 deletions tests/launcher/assets/log_parser/simulation.error.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
[Fri Dec 9 23:16:48 2022][solver][check] Antares Solver v8.4.0-rc3 (fcb303c)
[Fri Dec 9 23:16:48 2022][solver][infos] :: built for 64-bit architectures, GNU/Linux, 12 cpu(s)
[Fri Dec 9 23:16:48 2022][solver][infos] :: hostname = localhost
[Fri Dec 9 23:16:48 2022][solver][infos]
[Fri Dec 9 23:16:48 2022][solver][infos] :: from /home/omnesflo/Téléchargements/antares-8.4.0-rc3-Ubuntu-20.04/bin
[Fri Dec 9 23:16:48 2022][solver][infos] :: log filename: /home/omnesflo/short/029 Pumped storage plant - 2/logs/solver-20221209-231648.log
[Fri Dec 9 23:16:48 2022][solver][infos]
[Fri Dec 9 23:16:48 2022][solver][notic] Preparing 029 Pumped storage plant - 2...
[Fri Dec 9 23:16:48 2022][solver][infos] detected version: 840
[Fri Dec 9 23:16:48 2022][solver][infos] from `/home/omnesflo/short/029 Pumped storage plant - 2`
[Fri Dec 9 23:16:48 2022][solver][infos]
[Fri Dec 9 23:16:48 2022][solver][infos] simulation mode: Economy
[Fri Dec 9 23:16:48 2022][solver][infos] simplex optimization range: day
[Fri Dec 9 23:16:48 2022][solver][infos] Aggregate renewables were chosen. Output will be disabled for renewable clusters.
[Fri Dec 9 23:16:48 2022][solver][infos] :: ignoring export mps
[Fri Dec 9 23:16:48 2022][solver][infos] :: ignoring adequacy patch
[Fri Dec 9 23:16:48 2022][solver][infos] :: ignoring export structure
[Fri Dec 9 23:16:48 2022][solver][infos] Output folder : /home/omnesflo/short/029 Pumped storage plant - 2/output/20221209-2316eco
[Fri Dec 9 23:16:48 2022][solver][infos] Loading the list of areas...
[Fri Dec 9 23:16:48 2022][solver][infos] Loading the area list from `/home/omnesflo/short/029 Pumped storage plant - 2/input/areas/list.txt`
[Fri Dec 9 23:16:48 2022][solver][infos] 5 areas found
[Fri Dec 9 23:16:48 2022][solver][infos] Loading global hydro data...
[Fri Dec 9 23:16:48 2022][solver][infos] Loading thermal clusters...
[Fri Dec 9 23:16:48 2022][solver][infos] Loading thermal configuration for the area & PSP-HUB
[Fri Dec 9 23:16:48 2022][solver][infos] Loading thermal configuration for the area & PSP-IN
[Fri Dec 9 23:16:48 2022][solver][infos] Loading thermal configuration for the area & PSP-OUT
[Fri Dec 9 23:16:48 2022][solver][infos] Loading thermal configuration for the area east
[Fri Dec 9 23:16:48 2022][solver][infos] Loading thermal configuration for the area west
[Fri Dec 9 23:16:48 2022][solver][infos] Loading renewable configuration for the area & PSP-HUB
[Fri Dec 9 23:16:48 2022][solver][infos] Loading renewable configuration for the area & PSP-IN
[Fri Dec 9 23:16:48 2022][solver][infos] Loading renewable configuration for the area & PSP-OUT
[Fri Dec 9 23:16:48 2022][solver][infos] Loading renewable configuration for the area east
[Fri Dec 9 23:16:48 2022][solver][infos] Loading renewable configuration for the area west
[Fri Dec 9 23:16:48 2022][solver][infos] Loading the area 1/5: & PSP-HUB
[Fri Dec 9 23:16:48 2022][solver][infos] Loading the area 1/5: & PSP-HUB 16%
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 1/5: & PSP-HUB 33%
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 1/5: & PSP-HUB 50%
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 1/5: & PSP-HUB 66%
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 1/5: & PSP-HUB 83%
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 2/5: & PSP-IN
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 2/5: & PSP-IN 16%
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 2/5: & PSP-IN 33%
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 2/5: & PSP-IN 50%
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 2/5: & PSP-IN 66%
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 2/5: & PSP-IN 83%
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 3/5: & PSP-OUT
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 3/5: & PSP-OUT 16%
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 3/5: & PSP-OUT 33%
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 3/5: & PSP-OUT 50%
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 3/5: & PSP-OUT 66%
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 3/5: & PSP-OUT 83%
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 4/5: east
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 4/5: east 11%
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 4/5: east 22%
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 4/5: east 33%
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 4/5: east 44%
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 4/5: east 55%
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 4/5: east 66%
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 4/5: east 77%
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 4/5: east 88%
[Fri Dec 9 23:16:49 2022][solver][error] I/O error: /home/omnesflo/short/029 Pumped storage plant - 2/input/areas/east/adequacy_patch.ini: Impossible to read the file
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 5/5: west
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 5/5: west 11%
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 5/5: west 22%
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 5/5: west 33%
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 5/5: west 44%
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 5/5: west 55%
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 5/5: west 66%
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 5/5: west 77%
[Fri Dec 9 23:16:49 2022][solver][infos] Loading the area 5/5: west 88%
[Fri Dec 9 23:16:49 2022][solver][infos] Loading correlation matrices...
[Fri Dec 9 23:16:49 2022][solver][infos]
[Fri Dec 9 23:16:49 2022][solver][infos] Loading constraints...
[Fri Dec 9 23:16:49 2022][solver][infos] added `PSP efficiency ratio` (daily, bounded below)
[Fri Dec 9 23:16:49 2022][solver][infos] 1 binding constraint found
[Fri Dec 9 23:16:49 2022][solver][infos]
[Fri Dec 9 23:16:49 2022][solver][infos] Loading sets of areas...
[Fri Dec 9 23:16:49 2022][solver][infos] found `all areas` (2 items)
[Fri Dec 9 23:16:49 2022][solver][infos] [statistics] disk: read: 10159 ko, written: 0 ko
[Fri Dec 9 23:16:49 2022][solver][infos] [statistics] network: read: 0 ko, written: 0 ko
[Fri Dec 9 23:16:49 2022][solver][infos] The study is loaded.
[Fri Dec 9 23:16:49 2022][solver][infos] [UI] Display messages: Off
[Fri Dec 9 23:16:49 2022][solver][infos]
[Fri Dec 9 23:16:49 2022][solver][error] Found 1 error: The simulation must stop.
46 changes: 46 additions & 0 deletions tests/launcher/assets/log_parser/simulation.fatal.history.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[
[
"[Thu Aug 19 10:46:48 2021][solver][infos] Loading the list of areas...",
1.0
],
[
"[Thu Aug 19 10:48:17 2021][solver][infos] MC-Years : [1 .. 1], total: 1",
2.0
],
[
"[Thu Aug 19 10:48:18 2021][solver][error] Infeasible linear problem encountered. Possible causes:",
100.0
],
[
"[Thu Aug 19 10:48:18 2021][solver][error] * binding constraints,",
100.0
],
[
"[Thu Aug 19 10:48:18 2021][solver][error] * last resort shedding status,",
100.0
],
[
"[Thu Aug 19 10:48:18 2021][solver][error] * negative hurdle costs on lines with infinite capacity,",
100.0
],
[
"[Thu Aug 19 10:48:18 2021][solver][error] * Hydro reservoir impossible to manage with cumulative options \"hard bounds without heuristic\"",
100.0
],
[
"[Thu Aug 19 10:48:20 2021][solver][error] Linear optimization failed",
100.0
],
[
"[Thu Aug 19 10:48:20 2021][solver][fatal] Year 1 failed at week 1.",
100.0
],
[
"[Thu Aug 19 10:48:21 2021][solver][infos] Exporting the annual results",
196.0
],
[
"[Thu Aug 19 10:48:21 2021][solver][fatal] At least one year has failed in the previous set of parallel year.",
100.0
]
]
Loading

0 comments on commit dca1cd3

Please sign in to comment.