-
Notifications
You must be signed in to change notification settings - Fork 63
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
Make tracer creation more robust #928
Conversation
Pull Request Test Coverage Report for Build 2236361717
💛 - Coveralls |
…on error is sufficiently small compared to the peak of the kernel.
7cfac52
to
5ce75f3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @tilmantroester . A few comments below
On cleaning up warnings: I agree... we should try to sort that out before V3 |
Unrelated to the title of this PR but definitely related to C-level warnings: currently, GSL raises an error when a value outside of the interpolation range is requested. For some reason, this is caught and converted to a warning in CCL, and the code ends up failing with an unexplained error Try, for example, As the vast majority (citation needed?) of GSL failures in CCL are caused by the queried values being out of bounds, maybe it's worth either catching this case specifically and promoting it to an error ( |
Re: error handling. The more I look into this, the more jank I find. Probably best to completely rewrite the |
OK, a more complete solution to error handling is for another PR. @tilmantroester see my suggestion above for the poorly-sampled case. Not sure if it's clear. I can provide a diagram if not. |
@damonge The poorly-sampled case should be addressed now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@tilmantroester I noticed while running some tests that this PR introduces a bunch of unnecessary warnings in the python unit tests and in the benchmarks. It would be nice to get rid of them in a separate PR to keep the output as clean as possible. UPDATE: I addressed that in PR889. |
This is an attempt to make CCL more robust to bad n(z). See e.g. #927, #919.
gsl_params
to switch between spline and GSL quadrature integration for the two cases. Since spline integration is more robust and seems to be faster in the case where the n(z) is not super smooth or not very finely sampled, this is chosen as the default.n_samples
argument, like inCMBLensingTracer
. Right now there is an inconsitency in the API, in that the tSZ, CIB, and ISW tracers usen_chi
for the same thing. This should be unified but as this involves a change to existing API, I've not included it here. @damonge Let me know what you think.Tracer.get_kernels
without specifyingchi
. In this case, the internal spline representation is returned. This is mostly useful for debugging purposes.pyccl.debug_mode(False)
. Many of the warnings are there for good reason and warning the user that internal computations might produce garbage results is probably preferable to silent failures.cosmo.status_message
, earlier messages get lost, which makes debugging difficult. Partially addresses ENH clean out the C layer warnings #672. But this should really be handled cleaner (let's just switch to C++ and get exceptions and smart pointers!)