[REDMINE1D-345] [RM-8441] Refactor warning flag recording when an error occur Created: 25/Oct/23  Updated: 05/Dec/23

Status: Open
Project: 1D Redmine
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Normal
Reporter: Redmine-Jira Migtation Assignee: Redmine-Jira Migtation
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Created on 2023-10-24 14:32:26 by Didier Vibert. % Done: 0

in develop (and 0.44) when running a QSO linemeas only, with a linemeas catalog without the required columns (eg qso.VelocityAbsorption) the error "Context warning flag already exists" still appears ...

<pre>
Info: processing ProcessingID
0 00005-00000-0,0-000000000000067d
Info: Using amazed reader
Info: Using amazed external storage
Info: Processing 00005-00000-0,0-000000000000067d
Error: PYTHON_API_ERROR: 'qso.VelocityAbsorption' [base.py:3654:get_loc]
Error: Context warning flag already exists

</pre>

The warning flags should not be recorded in the COperatorResultStore from the c++ exception (as it is the case now) but from the python process flow



 Comments   
Comment by Redmine-Jira Migtation [ 05/Dec/23 ]

Comment by Didier Vibert on 2023-11-07 08:42:15:
may be implemented at the same time than the handling of the scope at python level with the management of the stage level.

I propose to define a python context manager for dealing with stage/solver scopes, pushing a new scope at beginning, popping the scope and collect/store the warning flag in the resultStore at finalization. The use of the context manager (@with@ statement) could also be embedded in a decorator (as it is the case already for trapping exceptions). The advantage of using a context manager instead of explicitly storing the warning flag at the exception level, is that there will then be only one place (in the code) for storing each warning flag: at the ending of the corresponding context, whatever causes the end, ie exception or normal ending.

Generated at Sat Feb 10 15:31:47 JST 2024 using Jira 8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b.