Issue 1:
Describe your issue.

In the cp310-macosx_arm64 test on cirrus-ci there are 14 failing tests in scipy.stats.

https://cirrus-ci.com/task/6051468460425216

Reproducing Code Example

Running the test suite

Error message

=================================== FAILURES ===================================
_________________ test_stats_boost_ufunc[_beta_ppf-args1-0.5] __________________
scipy/stats/tests/test_boost_ufuncs.py:41: in test_stats_boost_ufunc
value = func(*args)
E RuntimeWarning: overflow encountered in _beta_ppf
args = [0.6875, 2.0, 3.0]
expected = 0.5
func = <ufunc '_beta_ppf'>
rtol = 3.814697265625e-06
typ = <class 'numpy.float32'>
type_char = 'f'
type_chars = ['f', 'd', 'g']
type_sigs = ['fff->f', 'ddd->d', 'ggg->g']
______________________ test_cont_basic[500-200-ncf-arg74] ______________________
scipy/stats/tests/test_continuous_basic.py:162: in test_cont_basic
check_cdf_ppf(distfn, arg, distname)
arg = (27, 27, 0.41578441799226107)
distfn = <scipy.stats._continuous_distns.ncf_gen object at 0x123106c20>
distname = 'ncf'
m = 1.0966313767196902
n_fit_samples = 200
rng = RandomState(MT19937) at 0x14A668E40
rvs = array([0.90888841, 0.87523216, 0.73228753, 1.33584017, 0.93548576,
1.09504212, 1.15670442, 0.36786914, 0.791225...03, 1.73540023, 0.87035866, 0.73702581, 0.81477748,
0.87362182, 1.58673099, 1.88455316, 0.61564337, 1.09912842])
sn = 500
v = 0.2013794025952613
scipy/stats/tests/test_continuous_basic.py:516: in check_cdf_ppf
npt.assert_almost_equal(distfn.cdf(distfn.ppf(values, *arg), *arg),
arg = (27, 27, 0.41578441799226107)
distfn = <scipy.stats._continuous_distns.ncf_gen object at 0x123106c20>
msg = 'ncf'
values = [0.001, 0.5, 0.999]
scipy/stats/_distn_infrastructure.py:2333: in ppf
place(output, cond, self._ppf(*goodargs) * scale + loc)
_a = 0.0
_b = inf
args = (array(27), array(27), array(0.41578442))
cond = array([ True, True, True])
cond0 = True
cond1 = array([ True, True, True])
cond2 = array([False, False, False])
cond3 = array([False, False, False])
goodargs = [array([0.001, 0.5 , 0.999]), array([27, 27, 27]), array([27, 27, 27]), array([0.41578442, 0.41578442, 0.41578442])]
kwds = {}
loc = array([0, 0, 0])
lower_bound = 0.0
output = array([nan, nan, nan])
q = array([0.001, 0.5 , 0.999])
scale = array([1, 1, 1])
self = <scipy.stats._continuous_distns.ncf_gen object at 0x123106c20>
upper_bound = inf
scipy/stats/_continuous_distns.py:6604: in _ppf
return _boost._ncf_ppf(q, dfn, dfd, nc)
E RuntimeWarning: overflow encountered in _ncf_ppf
dfd = array([27, 27, 27])
dfn = array([27, 27, 27])
nc = array([0.41578442, 0.41578442, 0.41578442])
q = array([0.001, 0.5 , 0.999])
self = <scipy.stats._continuous_distns.ncf_gen object at 0x123106c20>
______________________ test_cont_basic[500-200-nct-arg75] ______________________
scipy/stats/tests/test_continuous_basic.py:162: in test_cont_basic
check_cdf_ppf(distfn, arg, distname)
arg = (14, 0.24045031331198066)
distfn = <scipy.stats._continuous_distns.nct_gen object at 0x1231046d0>
distname = 'nct'
m = 0.2543673273832776
n_fit_samples = 200
rng = RandomState(MT19937) at 0x17F91B140
rvs = array([ 8.73534081e-01, -1.04204572e+00, 8.32185889e-01, 1.83689614e+00,
-1.81244028e-01, 7.69549733e-01, 8...9293e+00, 8.20972491e-01, -7.63240067e-01,
1.27150283e+00, 1.30239072e-01, 1.64179170e+00, 1.18497579e+00])
sn = 500
v = 1.1694163414603564
scipy/stats/tests/test_continuous_basic.py:516: in check_cdf_ppf
npt.assert_almost_equal(distfn.cdf(distfn.ppf(values, *arg), *arg),
arg = (14, 0.24045031331198066)
distfn = <scipy.stats._continuous_distns.nct_gen object at 0x1231046d0>
msg = 'nct'
values = [0.001, 0.5, 0.999]
scipy/stats/_distn_infrastructure.py:2333: in ppf
place(output, cond, self._ppf(*goodargs) * scale + loc)
_a = -inf
_b = inf
args = (array(14), array(0.24045031))
cond = array([ True, True, True])
cond0 = True
cond1 = array([ True, True, True])
cond2 = array([False, False, False])
cond3 = array([False, False, False])
goodargs = [array([0.001, 0.5 , 0.999]), array([14, 14, 14]), array([0.24045031, 0.24045031, 0.24045031])]
kwds = {}
loc = array([0, 0, 0])
lower_bound = -inf
output = array([nan, nan, nan])
q = array([0.001, 0.5 , 0.999])
scale = array([1, 1, 1])
self = <scipy.stats._continuous_distns.nct_gen object at 0x1231046d0>
upper_bound = inf
scipy/stats/_continuous_distns.py:6800: in _ppf
return _boost._nct_ppf(q, df, nc)
E RuntimeWarning: overflow encountered in _nct_ppf
df = array([14, 14, 14])
nc = array([0.24045031, 0.24045031, 0.24045031])
q = array([0.001, 0.5 , 0.999])
self = <scipy.stats._continuous_distns.nct_gen object at 0x1231046d0>
_____________________ test_cont_basic[500-200-ncx2-arg76] ______________________
scipy/stats/tests/test_continuous_basic.py:162: in test_cont_basic
check_cdf_ppf(distfn, arg, distname)
arg = (21, 1.0560465975116415)
distfn = <scipy.stats._continuous_distns.ncx2_gen object at 0x123168490>
distname = 'ncx2'
m = 22.056046597511642
n_fit_samples = 200
rng = RandomState(MT19937) at 0x17F91B240
rvs = array([24.18228087, 28.6893038 , 24.17456852, 14.84747842, 18.70623905,
16.16763421, 9.29241683, 14.62038405, ...716689, 25.11697161, 27.96343751, 35.36238425,
17.36403196, 25.81839268, 23.01798747, 22.53534591, 20.49078605])
sn = 500
v = 46.22418639004657
scipy/stats/tests/test_continuous_basic.py:516: in check_cdf_ppf
npt.assert_almost_equal(distfn.cdf(distfn.ppf(values, *arg), *arg),
arg = (21, 1.0560465975116415)
distfn = <scipy.stats._continuous_distns.ncx2_gen object at 0x123168490>
msg = 'ncx2'
values = [0.001, 0.5, 0.999]
scipy/stats/_distn_infrastructure.py:2160: in cdf
place(output, cond, self._cdf(*goodargs))
_a = 0.0
_b = inf
args = (array(21), array(1.0560466))
cond = array([ True, True, True])
cond0 = True
cond1 = array([ True, True, True])
cond2 = array([False, False, False])
dtyp = dtype('float64')
goodargs = [array([ 6.77671634, 21.36270226, 49.09451392]), array([21, 21, 21]), array([1.0560466, 1.0560466, 1.0560466])]
kwds = {}
loc = array(0)
output = array([0., 0., 0.])
scale = array(1)
self = <scipy.stats._continuous_distns.ncx2_gen object at 0x123168490>
x = array([ 6.77671634, 21.36270226, 49.09451392])
scipy/stats/_continuous_distns.py:6502: in _cdf
return _lazywhere(cond, (x, df, nc), f=_boost._ncx2_cdf,
cond = array([ True, True, True])
df = array([21, 21, 21])
nc = array([1.0560466, 1.0560466, 1.0560466])
self = <scipy.stats._continuous_distns.ncx2_gen object at 0x123168490>
x = array([ 6.77671634, 21.36270226, 49.09451392])
scipy/_lib/_util.py:69: in _lazywhere
np.place(out, cond, f(*temp))
E RuntimeWarning: overflow encountered in _ncx2_cdf
args = [array([ True, True, True]), array([ 6.77671634, 21.36270226, 49.09451392]), array([21, 21, 21]), array([1.0560466, 1.0560466, 1.0560466])]
arrays = [array([ 6.77671634, 21.36270226, 49.09451392]), array([21, 21, 21]), array([1.0560466, 1.0560466, 1.0560466])]
cond = array([ True, True, True])
f = <ufunc '_ncx2_cdf'>
f2 = <function ncx2_gen._cdf.<locals>.<lambda> at 0x17f9825f0>
fillvalue = nan
out = array([nan, nan, nan])
tcode = 'd'
temp = (array([ 6.77671634, 21.36270226, 49.09451392]), array([21, 21, 21]), array([1.0560466, 1.0560466, 1.0560466]))
___________________ test_methods_with_lists[ncf-args75-ppf] ____________________
scipy/stats/tests/test_continuous_basic.py:714: in test_methods_with_lists
result = f(x, *shape2, loc=loc, scale=scale)
args = (27, 27, 0.41578441799226107)
dist = <scipy.stats._continuous_distns.ncf_gen object at 0x123106c20>
distname = 'ncf'
f = <bound method rv_continuous.ppf of <scipy.stats._continuous_distns.ncf_gen object at 0x123106c20>>
loc = [0, 0.1]
method = 'ppf'
scale = [1, 1.01]
shape2 = [[27, 27], [27, 27], [0.41578441799226107, 0.41578441799226107]]
x = [0.1, 0.2]
scipy/stats/_distn_infrastructure.py:2333: in ppf
place(output, cond, self._ppf(*goodargs) * scale + loc)
_a = 0.0
_b = inf
args = (array([27, 27]), array([27, 27]), array([0.41578442, 0.41578442]))
cond = array([ True, True])
cond0 = array([ True, True])
cond1 = array([ True, True])
cond2 = array([False, False])
cond3 = array([False, False])
goodargs = [array([0.1, 0.2]), array([27, 27]), array([27, 27]), array([0.41578442, 0.41578442])]
kwds = {'loc': [0, 0.1], 'scale': [1, 1.01]}
loc = array([0. , 0.1])
lower_bound = array([0. , 0.1])
output = array([nan, nan])
q = array([0.1, 0.2])
scale = array([1. , 1.01])
self = <scipy.stats._continuous_distns.ncf_gen object at 0x123106c20>
upper_bound = array([inf, inf])
scipy/stats/_continuous_distns.py:6604: in _ppf
return _boost._ncf_ppf(q, dfn, dfd, nc)
E RuntimeWarning: overflow encountered in _ncf_ppf
dfd = array([27, 27])
dfn = array([27, 27])
nc = array([0.41578442, 0.41578442])
q = array([0.1, 0.2])
self = <scipy.stats._continuous_distns.ncf_gen object at 0x123106c20>
___________________ test_methods_with_lists[ncf-args75-isf] ____________________
scipy/stats/tests/test_continuous_basic.py:714: in test_methods_with_lists
result = f(x, *shape2, loc=loc, scale=scale)
args = (27, 27, 0.41578441799226107)
dist = <scipy.stats._continuous_distns.ncf_gen object at 0x123106c20>
distname = 'ncf'
f = <bound method rv_continuous.isf of <scipy.stats._continuous_distns.ncf_gen object at 0x123106c20>>
loc = [0, 0.1]
method = 'isf'
scale = [1, 1.01]
shape2 = [[27, 27], [27, 27], [0.41578441799226107, 0.41578441799226107]]
x = [0.1, 0.2]
scipy/stats/_distn_infrastructure.py:2378: in isf
place(output, cond, self._isf(*goodargs) * scale + loc)
_a = 0.0
_b = inf
args = (array([27, 27]), array([27, 27]), array([0.41578442, 0.41578442]))
cond = array([ True, True])
cond0 = array([ True, True])
cond1 = array([ True, True])
cond2 = array([False, False])
cond3 = array([False, False])
goodargs = [array([0.1, 0.2]), array([27, 27]), array([27, 27]), array([0.41578442, 0.41578442])]
kwds = {'loc': [0, 0.1], 'scale': [1, 1.01]}
loc = array([0. , 0.1])
lower_bound = array([0. , 0.1])
output = array([nan, nan])
q = array([0.1, 0.2])
scale = array([1. , 1.01])
self = <scipy.stats._continuous_distns.ncf_gen object at 0x123106c20>
upper_bound = array([inf, inf])
scipy/stats/_continuous_distns.py:6610: in _isf
return _boost._ncf_isf(x, dfn, dfd, nc)
E RuntimeWarning: overflow encountered in _ncf_isf
dfd = array([27, 27])
dfn = array([27, 27])
nc = array([0.41578442, 0.41578442])
self = <scipy.stats._continuous_distns.ncf_gen object at 0x123106c20>
x = array([0.1, 0.2])
___________________ test_discrete_basic[skellam-arg17-True] ____________________
scipy/stats/tests/test_discrete_basic.py:47: in test_discrete_basic
check_cdf_ppf(distfn, arg, supp, distname + ' cdf_ppf')
arg = (15, 8)
distfn = <scipy.stats._discrete_distns.skellam_gen object at 0x1269cde70>
distname = 'skellam'
first_case = True
m = 7.0
rvs = array([ 4, 6, 10, ..., 5, 14, 15])
supp = array([-10, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4,
5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 25])
v = 23.0
scipy/stats/tests/test_discrete_basic.py:185: in check_cdf_ppf
npt.assert_array_equal(distfn.ppf(distfn.cdf(supp, *arg), *arg),
arg = (15, 8)
distfn = <scipy.stats._discrete_distns.skellam_gen object at 0x1269cde70>
msg = 'skellam cdf_ppf'
supp = array([-10, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4,
5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 25])
scipy/stats/_distn_infrastructure.py:3433: in cdf
place(output, cond, np.clip(self._cdf(*goodargs), 0, 1))
_ = 1
_a = -inf
_b = inf
args = (array(15), array(8))
cond = array([ True, True, True, True, True, True, True, True, True,
True, True, True, True, True, True,... True,
True, True, True, True, True, True, True, True, True,
True, True, True, True, True])
cond0 = True
cond1 = array([ True, True, True, True, True, True, True, True, True,
True, True, True, True, True, True,... True,
True, True, True, True, True, True, True, True, True,
True, True, True, True, True])
cond2 = array([False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False,...False,
False, False, False, False, False, False, False, False, False,
False, False, False, False, False])
cond3 = array([False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False,...False,
False, False, False, False, False, False, False, False, False,
False, False, False, False, False])
goodargs = [array([-10, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4,
5, 6, 7, 8, 9, 10, 11, 12..., 15]), array([8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8])]
k = array([-10, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4,
5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 25])
kwds = {}
loc = array(0)
output = array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])
self = <scipy.stats._discrete_distns.skellam_gen object at 0x1269cde70>
scipy/stats/_discrete_distns.py:1437: in _cdf
_boost._ncx2_cdf(2*mu2, -2*x, 2*mu1),
E RuntimeWarning: overflow encountered in _ncx2_cdf
mu1 = array([15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15])
mu2 = array([8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8])
self = <scipy.stats._discrete_distns.skellam_gen object at 0x1269cde70>
x = array([-10., -7., -6., -5., -4., -3., -2., -1., 0., 1., 2.,
3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13.,
14., 15., 16., 17., 18., 19., 20., 21., 22., 25.])
_________________________ test_moments[skellam-arg17] __________________________
scipy/stats/tests/test_discrete_basic.py:89: in test_moments
check_normalization(distfn, arg, distname)
arg = (15, 8)
distfn = <scipy.stats._discrete_distns.skellam_gen object at 0x1269cde70>
distname = 'skellam'
k = 0.043478260869565216
m = 7.0
s = 0.06346090862606624
v = 23.0
scipy/stats/tests/common_tests.py:32: in check_normalization
normalization_expect = distfn.expect(lambda x: 1, args=args)
args = (15, 8)
atol = 1e-07
distfn = <scipy.stats._discrete_distns.skellam_gen object at 0x1269cde70>
distname = 'skellam'
norm_moment = 1.0
rtol = 1e-07
scipy/stats/_distn_infrastructure.py:3739: in expect
x0 = self.ppf(0.5, *args)
_a = -inf
_b = inf
args = (15, 8)
chunksize = 32
conditional = False
fun = <function rv_discrete.expect.<locals>.fun at 0x2840aaa70>
func = <function check_normalization.<locals>.<lambda> at 0x2840aa8c0>
invfac = 1.0
lb = -inf
loc = 0
maxcount = 1000
self = <scipy.stats._discrete_distns.skellam_gen object at 0x1269cde70>
tolerance = 1e-10
ub = inf
scipy/stats/_distn_infrastructure.py:3592: in ppf
place(output, cond, self._ppf(*goodargs) + loc)
_ = 1
_a = -inf
_b = inf
args = (array(15), array(8))
cond = True
cond0 = True
cond1 = True
cond2 = False
goodargs = [array([0.5]), array([15]), array([8])]
kwds = {}
loc = array([0])
output = array(nan)
q = array(0.5)
self = <scipy.stats._discrete_distns.skellam_gen object at 0x1269cde70>
scipy/stats/_distn_infrastructure.py:989: in _ppf
return self._ppfvec(q, *args)
args = (array([15]), array([8]))
q = array([0.5])
self = <scipy.stats._discrete_distns.skellam_gen object at 0x1269cde70>
/Users/admin/scipy-dev/lib/python3.10/site-packages/numpy/lib/function_base.py:2328: in __call__
return self._vectorize_call(func=func, args=vargs)
args = (<scipy.stats._discrete_distns.skellam_gen object at 0x1269cde70>, array([0.5]), array([15]), array([8]))
excluded = set()
func = <function _drv2_ppfsingle at 0x126867c70>
kwargs = {}
self = <numpy.vectorize object at 0x1269cd960>
vargs = (<scipy.stats._discrete_distns.skellam_gen object at 0x1269cde70>, array([0.5]), array([15]), array([8]))
/Users/admin/scipy-dev/lib/python3.10/site-packages/numpy/lib/function_base.py:2411: in _vectorize_call
outputs = ufunc(*inputs)
args = (<scipy.stats._discrete_distns.skellam_gen object at 0x1269cde70>, array([0.5]), array([15]), array([8]))
func = <function _drv2_ppfsingle at 0x126867c70>
inputs = [array(<scipy.stats._discrete_distns.skellam_gen object at 0x1269cde70>,
dtype=object), array([0.5], dtype=object), array([15], dtype=object), array([8], dtype=object)]
otypes = 'd'
self = <numpy.vectorize object at 0x1269cd960>
ufunc = <ufunc '_drv2_ppfsingle (vectorized)'>
scipy/stats/_distn_infrastructure.py:2943: in _drv2_ppfsingle
qb = self._cdf(b, *args)
_a = -inf
_b = inf
a = -inf
args = (15, 8)
b = 50
q = 0.5
self = <scipy.stats._discrete_distns.skellam_gen object at 0x1269cde70>
scipy/stats/_discrete_distns.py:1438: in _cdf
1 - _boost._ncx2_cdf(2*mu1, 2*(x+1), 2*mu2))
E RuntimeWarning: overflow encountered in _ncx2_cdf
mu1 = 15
mu2 = 8
self = <scipy.stats._discrete_distns.skellam_gen object at 0x1269cde70>
x = 50.0
_____________________________ test_skellam_gh11474 _____________________________
scipy/stats/tests/test_discrete_distns.py:238: in test_skellam_gh11474
cdf = skellam.cdf(0, mu, mu)
mu = [1, 10, 100, 1000, 5000, 5050, ...]
scipy/stats/_distn_infrastructure.py:3433: in cdf
place(output, cond, np.clip(self._cdf(*goodargs), 0, 1))
_ = 1
_a = -inf
_b = inf
args = (array([ 1, 10, 100, 1000, 5000, 5050, 5100, 5250, 6000]), array([ 1, 10, 100, 1000, 5000, 5050, 5100, 5250, 6000]))
cond = array([ True, True, True, True, True, True, True, True, True])
cond0 = array([ True, True, True, True, True, True, True, True, True])
cond1 = True
cond2 = False
cond3 = False
goodargs = [array([0, 0, 0, 0, 0, 0, 0, 0, 0]), array([ 1, 10, 100, 1000, 5000, 5050, 5100, 5250, 6000]), array([ 1, 10, 100, 1000, 5000, 5050, 5100, 5250, 6000])]
k = array(0)
kwds = {}
loc = array(0)
output = array([0., 0., 0., 0., 0., 0., 0., 0., 0.])
self = <scipy.stats._discrete_distns.skellam_gen object at 0x1269cde70>
scipy/stats/_discrete_distns.py:1438: in _cdf
1 - _boost._ncx2_cdf(2*mu1, 2*(x+1), 2*mu2))
E RuntimeWarning: overflow encountered in _ncx2_cdf
mu1 = array([ 1, 10, 100, 1000, 5000, 5050, 5100, 5250, 6000])
mu2 = array([ 1, 10, 100, 1000, 5000, 5050, 5100, 5250, 6000])
self = <scipy.stats._discrete_distns.skellam_gen object at 0x1269cde70>
x = array([0., 0., 0., 0., 0., 0., 0., 0., 0.])
_____________________________ TestSkellam.test_cdf _____________________________
scipy/stats/tests/test_distributions.py:3249: in test_cdf
assert_almost_equal(stats.skellam.cdf(k, mu1, mu2), skcdfR, decimal=5)
k = array([-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2,
3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14])
mu1 = 10
mu2 = 5
self = <scipy.stats.tests.test_distributions.TestSkellam object at 0x14aba4520>
skcdfR = array([6.40614754e-05, 1.78109860e-04, 4.67906118e-04, 1.15967690e-03,
2.70774851e-03, 5.94897601e-03, 1.228634...799e-01, 8.77852572e-01,
9.21121265e-01, 9.51369425e-01, 9.71360859e-01, 9.83877736e-01,
9.91316724e-01])
scipy/stats/_distn_infrastructure.py:3433: in cdf
place(output, cond, np.clip(self._cdf(*goodargs), 0, 1))
_ = 1
_a = -inf
_b = inf
args = (array(10), array(5))
cond = array([ True, True, True, True, True, True, True, True, True,
True, True, True, True, True, True, True, True, True,
True, True, True, True, True, True, True])
cond0 = True
cond1 = array([ True, True, True, True, True, True, True, True, True,
True, True, True, True, True, True, True, True, True,
True, True, True, True, True, True, True])
cond2 = array([False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False])
cond3 = array([False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False])
goodargs = [array([-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2,
3, 4, 5, 6, 7, 8, 9, 10...0, 10, 10, 10, 10, 10, 10]), array([5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5])]
k = array([-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2,
3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14])
kwds = {}
loc = array(0)
output = array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0.])
self = <scipy.stats._discrete_distns.skellam_gen object at 0x1269cde70>
scipy/stats/_discrete_distns.py:1437: in _cdf
_boost._ncx2_cdf(2*mu2, -2*x, 2*mu1),
E RuntimeWarning: overflow encountered in _ncx2_cdf
mu1 = array([10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10])
mu2 = array([5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5])
self = <scipy.stats._discrete_distns.skellam_gen object at 0x1269cde70>
x = array([-10., -9., -8., -7., -6., -5., -4., -3., -2., -1., 0.,
1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11.,
12., 13., 14.])
___________________________ TestExpect.test_skellam ____________________________
scipy/stats/tests/test_distributions.py:4833: in test_skellam
m1 = stats.skellam.expect(lambda x: x, args=(p1, p2))
p1 = 18
p2 = 22
self = <scipy.stats.tests.test_distributions.TestExpect object at 0x149f402b0>
scipy/stats/_distn_infrastructure.py:3739: in expect
x0 = self.ppf(0.5, *args)
_a = -inf
_b = inf
args = (18, 22)
chunksize = 32
conditional = False
fun = <function rv_discrete.expect.<locals>.fun at 0x2852a5120>
func = <function TestExpect.test_skellam.<locals>.<lambda> at 0x2852a4ca0>
invfac = 1.0
lb = -inf
loc = 0
maxcount = 1000
self = <scipy.stats._discrete_distns.skellam_gen object at 0x1269cde70>
tolerance = 1e-10
ub = inf
scipy/stats/_distn_infrastructure.py:3592: in ppf
place(output, cond, self._ppf(*goodargs) + loc)
_ = 1
_a = -inf
_b = inf
args = (array(18), array(22))
cond = True
cond0 = True
cond1 = True
cond2 = False
goodargs = [array([0.5]), array([18]), array([22])]
kwds = {}
loc = array([0])
output = array(nan)
q = array(0.5)
self = <scipy.stats._discrete_distns.skellam_gen object at 0x1269cde70>
scipy/stats/_distn_infrastructure.py:989: in _ppf
return self._ppfvec(q, *args)
args = (array([18]), array([22]))
q = array([0.5])
self = <scipy.stats._discrete_distns.skellam_gen object at 0x1269cde70>
/Users/admin/scipy-dev/lib/python3.10/site-packages/numpy/lib/function_base.py:2328: in __call__
return self._vectorize_call(func=func, args=vargs)
args = (<scipy.stats._discrete_distns.skellam_gen object at 0x1269cde70>, array([0.5]), array([18]), array([22]))
excluded = set()
func = <function _drv2_ppfsingle at 0x126867c70>
kwargs = {}
self = <numpy.vectorize object at 0x1269cd960>
vargs = (<scipy.stats._discrete_distns.skellam_gen object at 0x1269cde70>, array([0.5]), array([18]), array([22]))
/Users/admin/scipy-dev/lib/python3.10/site-packages/numpy/lib/function_base.py:2411: in _vectorize_call
outputs = ufunc(*inputs)
args = (<scipy.stats._discrete_distns.skellam_gen object at 0x1269cde70>, array([0.5]), array([18]), array([22]))
func = <function _drv2_ppfsingle at 0x126867c70>
inputs = [array(<scipy.stats._discrete_distns.skellam_gen object at 0x1269cde70>,
dtype=object), array([0.5], dtype=object), array([18], dtype=object), array([22], dtype=object)]
otypes = 'd'
self = <numpy.vectorize object at 0x1269cd960>
ufunc = <ufunc '_drv2_ppfsingle (vectorized)'>
scipy/stats/_distn_infrastructure.py:2943: in _drv2_ppfsingle
qb = self._cdf(b, *args)
_a = -inf
_b = inf
a = -inf
args = (18, 22)
b = 50
q = 0.5
self = <scipy.stats._discrete_distns.skellam_gen object at 0x1269cde70>
scipy/stats/_discrete_distns.py:1438: in _cdf
1 - _boost._ncx2_cdf(2*mu1, 2*(x+1), 2*mu2))
E RuntimeWarning: overflow encountered in _ncx2_cdf
mu1 = 18
mu2 = 22
self = <scipy.stats._discrete_distns.skellam_gen object at 0x1269cde70>
x = 50.0
__________________________ test_ncx2_tails_ticket_955 __________________________
scipy/stats/tests/test_distributions.py:6292: in test_ncx2_tails_ticket_955
a = stats.ncx2.cdf(np.arange(20, 25, 0.2), 2, 1.07458615e+02)
scipy/stats/_distn_infrastructure.py:2160: in cdf
place(output, cond, self._cdf(*goodargs))
_a = 0.0
_b = inf
args = (array(2), array(107.458615))
cond = array([ True, True, True, True, True, True, True, True, True,
True, True, True, True, True, True, True, True, True,
True, True, True, True, True, True, True])
cond0 = True
cond1 = array([ True, True, True, True, True, True, True, True, True,
True, True, True, True, True, True, True, True, True,
True, True, True, True, True, True, True])
cond2 = array([False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False])
dtyp = dtype('float64')
goodargs = [array([20. , 20.2, 20.4, 20.6, 20.8, 21. , 21.2, 21.4, 21.6, 21.8, 22. ,
22.2, 22.4, 22.6, 22.8, 23. , 23.2, 2...5, 107.458615, 107.458615, 107.458615, 107.458615,
107.458615, 107.458615, 107.458615, 107.458615, 107.458615])]
kwds = {}
loc = array(0)
output = array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0.])
scale = array(1)
self = <scipy.stats._continuous_distns.ncx2_gen object at 0x123168490>
x = array([20. , 20.2, 20.4, 20.6, 20.8, 21. , 21.2, 21.4, 21.6, 21.8, 22. ,
22.2, 22.4, 22.6, 22.8, 23. , 23.2, 23.4, 23.6, 23.8, 24. , 24.2,
24.4, 24.6, 24.8])
scipy/stats/_continuous_distns.py:6502: in _cdf
return _lazywhere(cond, (x, df, nc), f=_boost._ncx2_cdf,
cond = array([ True, True, True, True, True, True, True, True, True,
True, True, True, True, True, True, True, True, True,
True, True, True, True, True, True, True])
df = array([2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2])
nc = array([107.458615, 107.458615, 107.458615, 107.458615, 107.458615,
107.458615, 107.458615, 107.458615, 107.4586...15, 107.458615, 107.458615, 107.458615, 107.458615,
107.458615, 107.458615, 107.458615, 107.458615, 107.458615])
self = <scipy.stats._continuous_distns.ncx2_gen object at 0x123168490>
x = array([20. , 20.2, 20.4, 20.6, 20.8, 21. , 21.2, 21.4, 21.6, 21.8, 22. ,
22.2, 22.4, 22.6, 22.8, 23. , 23.2, 23.4, 23.6, 23.8, 24. , 24.2,
24.4, 24.6, 24.8])
scipy/_lib/_util.py:69: in _lazywhere
np.place(out, cond, f(*temp))
E RuntimeWarning: overflow encountered in _ncx2_cdf
args = [array([ True, True, True, True, True, True, True, True, True,
True, True, True, True, True, True...5, 107.458615, 107.458615, 107.458615, 107.458615,
107.458615, 107.458615, 107.458615, 107.458615, 107.458615])]
arrays = [array([20. , 20.2, 20.4, 20.6, 20.8, 21. , 21.2, 21.4, 21.6, 21.8, 22. ,
22.2, 22.4, 22.6, 22.8, 23. , 23.2, 2...5, 107.458615, 107.458615, 107.458615, 107.458615,
107.458615, 107.458615, 107.458615, 107.458615, 107.458615])]
cond = array([ True, True, True, True, True, True, True, True, True,
True, True, True, True, True, True, True, True, True,
True, True, True, True, True, True, True])
f = <ufunc '_ncx2_cdf'>
f2 = <function ncx2_gen._cdf.<locals>.<lambda> at 0x2852a6f80>
fillvalue = nan
out = array([nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan])
tcode = 'd'
temp = (array([20. , 20.2, 20.4, 20.6, 20.8, 21. , 21.2, 21.4, 21.6, 21.8, 22. ,
22.2, 22.4, 22.6, 22.8, 23. , 23.2, 2...5, 107.458615, 107.458615, 107.458615, 107.458615,
107.458615, 107.458615, 107.458615, 107.458615, 107.458615]))
______________________________ test_ncx2_gh12731 _______________________________
scipy/stats/tests/test_distributions.py:6345: in test_ncx2_gh12731
assert_equal(stats.ncx2.cdf(1e4, df=1, nc=nc), 0)
nc = array([ 100000, 1000000, 10000000, 100000000, 1000000000])
scipy/stats/_distn_infrastructure.py:2160: in cdf
place(output, cond, self._cdf(*goodargs))
_a = 0.0
_b = inf
args = (array(1), array([ 100000, 1000000, 10000000, 100000000, 1000000000]))
cond = array([ True, True, True, True, True])
cond0 = array([ True, True, True, True, True])
cond1 = True
cond2 = array([False, False, False, False, False])
dtyp = dtype('float64')
goodargs = [array([10000., 10000., 10000., 10000., 10000.]), array([1, 1, 1, 1, 1]), array([ 100000, 1000000, 10000000, 100000000, 1000000000])]
kwds = {'df': 1, 'nc': array([ 100000, 1000000, 10000000, 100000000, 1000000000])}
loc = array(0)
output = array([0., 0., 0., 0., 0.])
scale = array(1)
self = <scipy.stats._continuous_distns.ncx2_gen object at 0x123168490>
x = array(10000.)
scipy/stats/_continuous_distns.py:6502: in _cdf
return _lazywhere(cond, (x, df, nc), f=_boost._ncx2_cdf,
cond = array([ True, True, True, True, True])
df = array([1, 1, 1, 1, 1])
nc = array([ 100000, 1000000, 10000000, 100000000, 1000000000])
self = <scipy.stats._continuous_distns.ncx2_gen object at 0x123168490>
x = array([10000., 10000., 10000., 10000., 10000.])
scipy/_lib/_util.py:69: in _lazywhere
np.place(out, cond, f(*temp))
E RuntimeWarning: overflow encountered in _ncx2_cdf
args = [array([ True, True, True, True, True]), array([10000., 10000., 10000., 10000., 10000.]), array([1, 1, 1, 1, 1]), array([ 100000, 1000000, 10000000, 100000000, 1000000000])]
arrays = [array([10000., 10000., 10000., 10000., 10000.]), array([1, 1, 1, 1, 1]), array([ 100000, 1000000, 10000000, 100000000, 1000000000])]
cond = array([ True, True, True, True, True])
f = <ufunc '_ncx2_cdf'>
f2 = <function ncx2_gen._cdf.<locals>.<lambda> at 0x2852a6830>
fillvalue = nan
out = array([nan, nan, nan, nan, nan])
tcode = 'd'
temp = (array([10000., 10000., 10000., 10000., 10000.]), array([1, 1, 1, 1, 1]), array([ 100000, 1000000, 10000000, 100000000, 1000000000]))
_______________________________ test_ncx2_gh8665 _______________________________
scipy/stats/tests/test_distributions.py:6357: in test_ncx2_gh8665
sf = stats.ncx2.sf(x, df=nu, nc=lam)
lam = 499.51538166556196
nu = 20
x = array([4.99515382e+00, 1.07617327e+01, 2.31854502e+01, 4.99515382e+01,
1.07617327e+02, 2.31854502e+02, 4.99515382e+02, 1.07617327e+03,
2.31854502e+03, 4.99515382e+03, 1.07617327e+04, 2.31854502e+04,
4.99515382e+04])
scipy/stats/_distn_infrastructure.py:2243: in sf
place(output, cond, self._sf(*goodargs))
_a = 0.0
_b = inf
args = (array(20), array(499.51538167))
cond = array([ True, True, True, True, True, True, True, True, True,
True, True, True, True])
cond0 = True
cond1 = array([ True, True, True, True, True, True, True, True, True,
True, True, True, True])
cond2 = array([False, False, False, False, False, False, False, False, False,
False, False, False, False])
dtyp = dtype('float64')
goodargs = [array([4.99515382e+00, 1.07617327e+01, 2.31854502e+01, 4.99515382e+01,
1.07617327e+02, 2.31854502e+02, 4.99515...8167, 499.51538167, 499.51538167,
499.51538167, 499.51538167, 499.51538167, 499.51538167,
499.51538167])]
kwds = {'df': 20, 'nc': 499.51538166556196}
loc = array(0)
output = array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])
scale = array(1)
self = <scipy.stats._continuous_distns.ncx2_gen object at 0x123168490>
x = array([4.99515382e+00, 1.07617327e+01, 2.31854502e+01, 4.99515382e+01,
1.07617327e+02, 2.31854502e+02, 4.99515382e+02, 1.07617327e+03,
2.31854502e+03, 4.99515382e+03, 1.07617327e+04, 2.31854502e+04,
4.99515382e+04])
scipy/stats/_continuous_distns.py:6515: in _sf
return _lazywhere(cond, (x, df, nc), f=_boost._ncx2_sf,
cond = array([ True, True, True, True, True, True, True, True, True,
True, True, True, True])
df = array([20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20])
nc = array([499.51538167, 499.51538167, 499.51538167, 499.51538167,
499.51538167, 499.51538167, 499.51538167, 499.51538167,
499.51538167, 499.51538167, 499.51538167, 499.51538167,
499.51538167])
self = <scipy.stats._continuous_distns.ncx2_gen object at 0x123168490>
x = array([4.99515382e+00, 1.07617327e+01, 2.31854502e+01, 4.99515382e+01,
1.07617327e+02, 2.31854502e+02, 4.99515382e+02, 1.07617327e+03,
2.31854502e+03, 4.99515382e+03, 1.07617327e+04, 2.31854502e+04,
4.99515382e+04])
scipy/_lib/_util.py:69: in _lazywhere
np.place(out, cond, f(*temp))
E RuntimeWarning: overflow encountered in _ncx2_sf
args = [array([ True, True, True, True, True, True, True, True, True,
True, True, True, True]), array([4.9...8167, 499.51538167, 499.51538167,
499.51538167, 499.51538167, 499.51538167, 499.51538167,
499.51538167])]
arrays = [array([4.99515382e+00, 1.07617327e+01, 2.31854502e+01, 4.99515382e+01,
1.07617327e+02, 2.31854502e+02, 4.99515...8167, 499.51538167, 499.51538167,
499.51538167, 499.51538167, 499.51538167, 499.51538167,
499.51538167])]
cond = array([ True, True, True, True, True, True, True, True, True,
True, True, True, True])
f = <ufunc '_ncx2_sf'>
f2 = <function ncx2_gen._sf.<locals>.<lambda> at 0x2852a7be0>
fillvalue = nan
out = array([nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan])
tcode = 'd'
temp = (array([4.99515382e+00, 1.07617327e+01, 2.31854502e+01, 4.99515382e+01,
1.07617327e+02, 2.31854502e+02, 4.99515...8167, 499.51538167, 499.51538167,
499.51538167, 499.51538167, 499.51538167, 499.51538167,
499.51538167]))
=========================== short test summary info ============================
FAILED scipy/stats/tests/test_boost_ufuncs.py::test_stats_boost_ufunc[_beta_ppf-args1-0.5]
FAILED scipy/stats/tests/test_continuous_basic.py::test_cont_basic[500-200-ncf-arg74]
FAILED scipy/stats/tests/test_continuous_basic.py::test_cont_basic[500-200-nct-arg75]
FAILED scipy/stats/tests/test_continuous_basic.py::test_cont_basic[500-200-ncx2-arg76]
FAILED scipy/stats/tests/test_continuous_basic.py::test_methods_with_lists[ncf-args75-ppf]
FAILED scipy/stats/tests/test_continuous_basic.py::test_methods_with_lists[ncf-args75-isf]
FAILED scipy/stats/tests/test_discrete_basic.py::test_discrete_basic[skellam-arg17-True]
FAILED scipy/stats/tests/test_discrete_basic.py::test_moments[skellam-arg17]
FAILED scipy/stats/tests/test_discrete_distns.py::test_skellam_gh11474 - Runt...
FAILED scipy/stats/tests/test_distributions.py::TestSkellam::test_cdf - Runti...
FAILED scipy/stats/tests/test_distributions.py::TestExpect::test_skellam - Ru...
FAILED scipy/stats/tests/test_distributions.py::test_ncx2_tails_ticket_955 - ...
FAILED scipy/stats/tests/test_distributions.py::test_ncx2_gh12731 - RuntimeWa...
FAILED scipy/stats/tests/test_distributions.py::test_ncx2_gh8665 - RuntimeWar...

SciPy/NumPy/Python version information

cp310-macosx_arm64

Issue 2:
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