scipy: BUG: stats: distribution methods emit unnecessary warnings from Boost
Describe your issue
Several statistical distribution methods emit warnings stemming from Boost. This issue tracks the status of all of them.
-
beta.ppf
as reported here; should be fixed by boostorg/math#827 -
ncf
as reported in gh-17101, should be fixed by boostorg/math#846 -
nct
- I’m not sure that this has been reported separately yet. Is it caused by the same sort of thing? -
ncx2
- Ditto.
gh-17272 will silence the failures in SciPy’s tests temporarily, but as many of these marks as possible should be removed when gh-17207 merges.
Original Post
Describe your issue.
macOS CI is failing due to an overflow. I am still trying to reproduce locally.
NumPy was updated to 1.21.3, could be this or another dependency.
https://github.com/scipy/scipy/runs/3960228039
Reproducing Code Example
# from scipy/stats/tests/test_distributions.py:2878: in test_issue_12796
import numpy as np
from scipy import stats
q = 0.999995
a = np.array([ 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20])
b = np.array([99999, 99998, 99997, 99996, 99995, 99994, 99993, 99992, 99991, 99990, 99989, 99988, 99987, 99986, 99985, 99984, 99983, 99982, 99981])
stats.beta.ppf(q, a, b)
Error message
FAILED scipy/stats/tests/test_distributions.py::TestBeta::test_issue_12635 - ...
927
FAILED scipy/stats/tests/test_distributions.py::TestBeta::test_issue_12794 - ...
928
FAILED scipy/stats/tests/test_distributions.py::TestBeta::test_issue_12796 - ...
...
scipy/stats/_continuous_distns.py:626: in _ppf
916
return _boost._beta_ppf(q, a, b)
917
E RuntimeWarning: overflow encountered in _beta_ppf
SciPy/NumPy/Python version information
master on macOS/CI
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 55 (52 by maintainers)
Commits related to this issue
- TST: silence test failures on macOS for `beta.ppf` overflow See gh-14901 for details. — committed to rgommers/scipy by rgommers 3 years ago
- TST: silence test failures on macOS for `beta.ppf` overflow See gh-14901 for details. [skip azp] [skip github] — committed to rgommers/scipy by rgommers 3 years ago
- TST: silence test failures on macOS for `beta.ppf` overflow (#14938) * TST: silence test failures on macOS for `beta.ppf` overflow See gh-14901 for details. [skip azp] [skip github] Co-auth... — committed to scipy/scipy by rgommers 3 years ago
- TST: silence test failures on macOS for `beta.ppf` overflow (#14938) * TST: silence test failures on macOS for `beta.ppf` overflow See gh-14901 for details. [skip azp] [skip github] Co-auth... — committed to tylerjereddy/scipy by rgommers 3 years ago
- MAINT: filter RuntimeWarnings in stats functions Fixes test suite failures on macOS 12, arm64. See gh-14901 for details. The failures on x86-64 may not be identical, and this doesn't close the issue... — committed to rgommers/scipy by rgommers 3 years ago
- MAINT: filter RuntimeWarnings in stats functions Fixes test suite failures on macOS 12, arm64. See gh-14901 for details. The failures on x86-64 may not be identical, and this doesn't close the issue... — committed to rgommers/scipy by rgommers 3 years ago
- MAINT: filter RuntimeWarnings in stats functions Fixes test suite failures on macOS 12, arm64. See gh-14901 for details. The failures on x86-64 may not be identical, and this doesn't close the issue... — committed to tylerjereddy/scipy by rgommers 3 years ago
- short-circuit overflow protection for M1 Mac clang (#827) xref scipy/scipy#14901 Splits single if statement into two to avoid apparent clang short-circuit bug on M1 Mac platforms. Co-authored-b... — committed to boostorg/math by mckib2 2 years ago
nct
should be fixed by https://github.com/boostorg/math/pull/892. I’ll look atncx2
this week.Thanks @mborland!
I believe that PR to Boost will resolve this issue, but we haven’t updated the commit of the Boost submodule in SciPy main yet, so we still see these failures in SciPy main right now. I’m about to submit a PR that silences those warnings, so I’m using this issue as a reminder to un-silence such warnings after the Boost submodule commit gets changed. We’ll close this issue when they’re all passing. Thanks for your help @mborland!
@mckib2 patch has been merged into Boost.Math. Let me know if there’s anything else that needs assistance.
gh-15323 should fix the failures on
arm64
macOS. Not 100% sure that it fixes everything onx86_64
for macOS 12, but at least CI is already passing there. So this fix should be enough for the1.8.0
release. I think the issue should remain open for figuring out the root cause (but that is not urgent).Nope,
-O0
didn’t matter. The full test suite on macOS arm64 is now down to 13 failures, all due to overflow warnings inbeta
andnbinom
from Boost code:I think CI is on Macos Intel.