Closed marcpaterno closed 1 year ago
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.
Fixed by PR #207
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 https://github.com/LSSTDESC/firecrown/issues/172#issuecomment-1206740158