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
Not exactly an installation issue, but related to confusing error messages when running Firecrown for the first time without having set {FIRECROWN_DIR} to point to the correct directory. The final error message seen by the user is distracting from the actual issue.
#175
Closed
marcpaterno opened this issue
Aug 12, 2022
· 3 comments
Not exactly an installation issue, but related to confusing error messages when running Firecrown for the first time without having set {FIRECROWN_DIR} to point to the correct directory. The final error message seen by the user is distracting from the actual issue.
Here when running "cobaya-run cobaya_evaluate.yaml" (but apparently also applicable to cosmosis):
<...>
FileNotFoundError: [Errno 2] No such file or directory: '${FIRECROWN_DIR}/examples/des_y1_3x2pt/des_y1_3x2pt_sacc_data.fits'
The above exception was the direct cause of the following exception:
<...>
File "/Users/agne/opt/anaconda3/envs/fc/lib/python3.10/site-packages/firecrown/likelihood/likelihood.py", line 105, in load_likelihood
raise ImportError(f"{e.strerror}: {filename}") from e
ImportError: No such file or directory: des_y1_3x2pt.py
This is a problem caused by the fact that we have code that can fail being executed at import time. We should change the design of our "factory function" scripts to be instead python modules that declare a factory function (that returns the likelihood object). This will make it easier to detect this kind of failure and to product a meaningful error message.
I think the issue is that FileNotFoundError gets caught and then re-raised as an unhelpful ImportError here: https://github.com/LSSTDESC/firecrown/blob/master/firecrown/likelihood/likelihood.py#L104
See the MWE in the other issue I opened on this: #173
Other exceptions being raised just show up as one would expect, it's just FileNotFoundError (which are very common) that get obfuscated.
Not exactly an installation issue, but related to confusing error messages when running Firecrown for the first time without having set {FIRECROWN_DIR} to point to the correct directory. The final error message seen by the user is distracting from the actual issue.
Here when running "cobaya-run cobaya_evaluate.yaml" (but apparently also applicable to cosmosis):
<...>
<...>
Originally posted by @agnesemenaite in #172 (comment)
The text was updated successfully, but these errors were encountered: