-
Notifications
You must be signed in to change notification settings - Fork 33
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
Errors and error messages in CMOR via Python #27
Comments
I just noticed that the points in 1) are already mentioned in issue #19, so I apologise for the duplication. |
ehogan, You need to tell cmor where your tables are so that they can be loaded. The tables such as CMIP5_Amon, CMIP5_Omon can be found here: https://github.com/PCMDI/cmip5-cmor-tables/tree/master/Tables Here is an example on cmor setup # -----------------------------------
# Take care of cmor initialization.
# -----------------------------------
cmor.setup(inpath="/home/ehogan",
netcdf_file_action = cmor.CMOR_REPLACE) You can find many examples in the github repository. Here is a good one that might help you setup cmor: A exhaustive documentation of each function and parameters can be found here: https://github.com/PCMDI/cmor/blob/master/Doc/cmor_users_guide.doc Hope this gets you going! |
Closing (duplicate of #65) |
I have a few issues / questions about errors and error messages in CMOR via Python; if they should be split into separate issues, please let me know.
I am currently trying to catch messages from CMOR so I can log them via the Python logger. During my experiments I discovered there are cases where errors terminate the Python interpreter. For example:
I wondered if this was the case for all errors from CMOR, but I think this first example is an exception (no pun intended) ;) :
Google tells me that the
SystemError: error return without exception set
exception can happen if code in a C extension module returns NULL (to indicate an error has occurred) but no exception was set. This means I can wrap the CMOR call in a try-except block, but the exception message is not the same as the error message printed by CMOR:Additionally, it appears that the error message from the CMOR call isn't sent to stdout or stderr (my attempts to capture the messages have failed), so even if I use a try-except block I still get an error message printed to screen.
So, to summarise:
The text was updated successfully, but these errors were encountered: