You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Still working with the Sample Program 1 example script, I have altered the variable definition line in order to generate a fatal error that I can use to expose several problems. So, I have used a non existing temperature unit
varid = cmor.variable('ts', 'Krap', axis_ids)
and I got the following error
CMOR - 91 >python -i sample_script_01.py
C Traceback:
In function: cmor_write_var_to_file
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! !
! Error: in udunits analyzing units from user (Krap) for variable ts (table: Amon) !
! !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
CMOR - 92 >
The things that should be improved:
I was using python -i to run my script, but I got dumped in the shell rather than back in the python interpreter after the fatal error. It would be much more useful if we could have an exception and be able to go back to the python shell to debug. Maybe there is an exit in the C code in case of errors that prevents going back to python?
The sample script that usually generates a ts_Amon_HadCM3_historical_r1i1p1_200001-200001.nc file (when there is no error) left a ts_Amon_HadCM3_historical_r1i1p1_28973.nc temporary file in the same directory instead. The first time I found one of these temporary files in the same directory as the correct file, I thought why is there a second file with a weird content in this directory?. It would be nice (and useful) to alter the name of the temp file to make it more explicit that it is a temp file! e.g. ts_Amon_HadCM3_historical_r1i1p1_28973_cmor_tmp.nc temporary file
The text was updated successfully, but these errors were encountered:
I change the exit() called and send a SIGINT signal. With python, this mean that the program will not exit right away (kill -9), but when python "returns" it is possible to trap the signal. It was useful for my unittest to trap errors, but might have strange message since the code keeps running until the last functions call return. I might need to trap more "error" code.
Still working with the Sample Program 1 example script, I have altered the variable definition line in order to generate a fatal error that I can use to expose several problems. So, I have used a non existing temperature unit
and I got the following error
The things that should be improved:
The text was updated successfully, but these errors were encountered: