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
poisson_conf_interval 'kraft-burrows-nousek' fails unexpectedly #13334
Comments
Hi, I would like to tackle this issue |
Simply increase the hardcoded value (100) may not help. In my case, I actually need to reduce the hardcoded value to 70, other wise I got the same error.
System detail |
Working on a solution for this issue but running into pre-commit errors. Hopefully I can resolve it soon so I can resolve this issue. |
Its apparently not an issue with pre-commit but an issue with an ssl certificate. So when I make a git commit pre-commit returns an ssl error. Apparently this seems to be an issue with windows... sigh |
@efrain99 , did you install https://pypi.org/project/certifi/ ? |
@pllim , yes I just tried that but same error message unfortunately. I am going to keep looking thank you for the help! |
@efrain99 , have you tried on WSL2 (assuming you are able to install it on that Windows machine)? |
Hi, I tried to change something in this PR #15208, but I still not fully understand about the reason behind Note: Well, still need to fix the pre commit error Edit: I use the wrong branch to submit PR #15207. I move it to #15208 |
During the pre-commit process, I encountered a similar issue with the SSL certificate. Despite attempting to install different versions of pip and conda, the error persisted. However, I found a solution by deactivating the virtual environment, which resolved the problem. |
Description
Expected behavior
poisson_conf_interval 'kraft-burrows-nousek' calculated values or fails with an obvious error message.
Actual behavior
The error message comes form deep within
scipy.optimize
and it's not clear for a user how to react. It's particularly confusing here because, at least on my platform, the function could work if not for a hardcoded upper value of an interval. The problem is in line 1160S_max = brentq(func, N - B, 100)
(see pasted error output below). In the function, the upper end of the interval thatbrentq
searches is hardcoded to 100. That's because (looking at the code comments and also speaking from memory as the person who originally implemented this) much larger value lead to numerical overflow error - scipy simple can't be used. However, for the numbers in my example, the calculation works when changing the hardcoded100
to200
.Notes for tackling this
So, this looks very simple - just increase the hardcoded
100
. However, we want to be a bit careful not to increase it too much because nobody is helped by running into overflow's instead. So, one might instead have to decrease that "Don't use scipy with N > 100" rule to a smaller number - finding the balance here might require some experimentation and new numbers in the test.Steps to Reproduce
With scipy installed:
System Details
Linux-3.10.0-1062.12.1.el7.x86_64-x86_64-with-glibc2.17
Python 3.9.7 (default, Sep 16 2021, 13:09:58)
[GCC 7.5.0]
Numpy 1.21.2
pyerfa 2.0.0
astropy 5.1
Scipy 1.7.1
The text was updated successfully, but these errors were encountered: