Skip to content
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

CAMB Fail #6

Closed
vivianmiranda opened this issue Nov 19, 2018 · 6 comments
Closed

CAMB Fail #6

vivianmiranda opened this issue Nov 19, 2018 · 6 comments

Comments

@vivianmiranda
Copy link

Hi

Is there an option for just ignoring the point when CAMB fails (for example when Halofit fails) - that is a big issue for me now...

@JesusTorrado
Copy link
Contributor

JesusTorrado commented Nov 20, 2018

Hi Vivian,

There is an option for CAMB/CLASS, stop_at_error, which is False by default. If this is happening to you and you have not set this option to True manually, the reason is likely that you have found a CAMB error which is not explicitly caught by Python, either because (a) we didn't know about it, or (b) your CAMB version is not up to date. To check which one is the case, you can perform the following test:

  1. Re-run Cobaya with debug: True, and take note of the arguments mentioned in the last line looking like [camb XXXXXXX] Setting parameters {...}.
  2. Download an up to date version of CAMB from Git, compile it, and try to run CAMB with your parameter value (import camb; pars = camb.set_params([your params here]; camb.get_matter_power_interpolator(pars)); see if it fails.

If it does fail, you have found a new uncaught error, so please send us your input parameters; if it does not, this means you need to update your CAMB version (if you are using a custom version, modified by you, you can download the latest Git one, and merge yours into it using something like meld). If after merging you still get the error, let us know and we'll see how to solve it.

Cheers

@vivianmiranda
Copy link
Author

vivianmiranda commented Nov 21, 2018 via email

@JesusTorrado
Copy link
Contributor

Hi Vivian,

In that case, can you tell us if there is a way for us to reproduce the error, so that we can locate the offending lines in the CAMB Python interface and wrap them in a try:except?

Or alternatively, if you prefer not to share your CAMB modification, you may want to do it yourself: locate the part of the Python interface of CAMB that fails and try to raise a CAMBError, which you can import to that file with from .baseconfig import CAMBError. CAMBError's are automatically treated by Cobaya as zero-likelihood points.

@vivianmiranda
Copy link
Author

vivianmiranda commented Nov 21, 2018 via email

@JesusTorrado
Copy link
Contributor

Glad that you solved it! Closing it then.

In any case, if you send us the precise CAMB input parameters for that case (got with debug:True as explained above), we should be able to fix it at the Python interface level, so that you don't have to keep your own modification just for that, and no one else finds that error in the future.

@vivianmiranda
Copy link
Author

vivianmiranda commented Nov 21, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants