Update to 1.10.0

Resolves: rhbz#2157723
This commit is contained in:
Charalampos Stratakis 2023-02-19 13:39:59 +01:00
parent 67801e2720
commit 8f79d271ba
6 changed files with 180 additions and 251 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
/scipy-1.8.1.tar.gz /scipy-1.8.1.tar.gz
/scipy-1.10.0.tar.gz

View File

@ -0,0 +1,93 @@
diff --git a/scipy/sparse/linalg/_isolve/tests/test_iterative.py b/scipy/sparse/linalg/_isolve/tests/test_iterative.py
index a782a8d27c2..48fc16b7a00 100644
--- a/scipy/sparse/linalg/_isolve/tests/test_iterative.py
+++ b/scipy/sparse/linalg/_isolve/tests/test_iterative.py
@@ -409,7 +409,9 @@ def test_atol(solver):
residual = A.dot(x) - b
err = np.linalg.norm(residual)
atol2 = tol * b_norm
- assert_(err <= max(atol, atol2))
+ # Added 1.00025 fudge factor because of `err` exceeding `atol` just
+ # very slightly on s390x (see gh-17839)
+ assert_(err <= 1.00025 * max(atol, atol2))
@pytest.mark.parametrize("solver", [cg, cgs, bicg, bicgstab, gmres, qmr, minres, lgmres, gcrotmk, tfqmr])
@@ -452,8 +454,10 @@ def test_zero_rhs(solver):
and sys.version_info[1] == 9,
reason="gh-13019")),
qmr,
- pytest.param(lgmres, marks=pytest.mark.xfail(platform.machine() == 'ppc64le',
- reason="fails on ppc64le")),
+ pytest.param(lgmres, marks=pytest.mark.xfail(
+ platform.machine() not in ['x86_64' 'x86', 'aarch64', 'arm64'],
+ reason="fails on at least ppc64le, ppc64 and riscv64, see gh-17839")
+ ),
pytest.param(cgs, marks=pytest.mark.xfail),
pytest.param(bicg, marks=pytest.mark.xfail),
pytest.param(bicgstab, marks=pytest.mark.xfail),
diff --git a/scipy/special/tests/test_orthogonal.py b/scipy/special/tests/test_orthogonal.py
index a325cb1a9ef..408b03bde2e 100644
--- a/scipy/special/tests/test_orthogonal.py
+++ b/scipy/special/tests/test_orthogonal.py
@@ -546,7 +546,7 @@ def test_roots_gegenbauer():
vgq(rootf(170), evalf(170), weightf(170), -1., 1., 5, atol=1e-13)
vgq(rootf(170), evalf(170), weightf(170), -1., 1., 25, atol=1e-12)
vgq(rootf(170), evalf(170), weightf(170), -1., 1., 100, atol=1e-11)
- vgq(rootf(170.5), evalf(170.5), weightf(170.5), -1., 1., 5, atol=1e-13)
+ vgq(rootf(170.5), evalf(170.5), weightf(170.5), -1., 1., 5, atol=1.25e-13)
vgq(rootf(170.5), evalf(170.5), weightf(170.5), -1., 1., 25, atol=1e-12)
vgq(rootf(170.5), evalf(170.5), weightf(170.5), -1., 1., 100, atol=1e-11)
diff --git a/scipy/stats/tests/test_distributions.py b/scipy/stats/tests/test_distributions.py
index eceeafdffe0..139b0537174 100644
--- a/scipy/stats/tests/test_distributions.py
+++ b/scipy/stats/tests/test_distributions.py
@@ -4254,7 +4254,7 @@ def test_pdf_nolan_samples(
],
# for small alpha very slightly reduced accuracy
[
- 'piecewise', 5e-11, lambda r: (
+ 'piecewise', 2.5e-10, lambda r: (
np.isin(r['pct'], pct_range) &
np.isin(r['alpha'], alpha_range) &
np.isin(r['beta'], beta_range) &
@@ -4358,7 +4358,7 @@ def test_cdf_nolan_samples(
tests = [
# piecewise generally good accuracy
[
- 'piecewise', 1e-12, lambda r: (
+ 'piecewise', 2e-12, lambda r: (
np.isin(r['pct'], pct_range) &
np.isin(r['alpha'], alpha_range) &
np.isin(r['beta'], beta_range) &
@@ -4480,6 +4480,14 @@ def test_location_scale(
):
"""Tests for pdf and cdf where loc, scale are different from 0, 1
"""
+
+ uname = platform.uname()
+ is_linux_32 = uname.system == 'Linux' and "32bit" in platform.architecture()[0]
+ # Test seems to be unstable (see gh-17839 for a bug report on Debian
+ # i386), so skip it.
+ if is_linux_32 and case == 'pdf':
+ pytest.skip("Test unstable on some platforms; see gh-17839, 17859")
+
data = nolan_loc_scale_sample_data
# We only test against piecewise as location/scale transforms
# are same for other methods.
diff --git a/scipy/stats/tests/test_mstats_basic.py b/scipy/stats/tests/test_mstats_basic.py
index cd53c7b7914..76cbfd8c253 100644
--- a/scipy/stats/tests/test_mstats_basic.py
+++ b/scipy/stats/tests/test_mstats_basic.py
@@ -1768,8 +1768,8 @@ def test_skewtest_2D_WithMask(self):
r = stats.skewtest(x)
rm = stats.mstats.skewtest(xm)
- assert_allclose(r[0][0], rm[0][0], rtol=2e-15)
- assert_allclose(r[0][1], rm[0][1], rtol=1e-15)
+ assert_allclose(r[0][0], rm[0][0], rtol=1e-14)
+ assert_allclose(r[0][1], rm[0][1], rtol=1e-14)
def test_normaltest(self):
with np.errstate(over='raise'), suppress_warnings() as sup:

View File

@ -21,7 +21,7 @@
Summary: Scientific Tools for Python Summary: Scientific Tools for Python
Name: python%{python3_pkgversion}-scipy Name: python%{python3_pkgversion}-scipy
Version: 1.8.1 Version: 1.10.0
Release: 1%{?dist} Release: 1%{?dist}
# BSD -- whole package except: # BSD -- whole package except:
@ -30,13 +30,11 @@ Release: 1%{?dist}
License: BSD and Boost and Public Domain License: BSD and Boost and Public Domain
Url: http://www.scipy.org/scipylib/index.html Url: http://www.scipy.org/scipylib/index.html
Source0: https://github.com/scipy/scipy/releases/download/v%{version}/scipy-%{version}.tar.gz Source0: https://github.com/scipy/scipy/releases/download/v%{version}/scipy-%{version}.tar.gz
# https://bugzilla.redhat.com/show_bug.cgi?id=2099102
# https://github.com/scipy/scipy/issues/16527 # Fix some test failures on 32 bits
# https://github.com/scipy/scipy/pull/16528 # https://github.com/scipy/scipy/pull/17859
Patch0: scipy-1.8.1-syevr-operator-order-explicit.patch # https://github.com/scipy/scipy/pull/17931
# Fix test_moments failing test Patch0: fix-32bit-test-failures.patch
# https://github.com/scipy/scipy/pull/16593
Patch1: scipy-1.8.1-test_moments-benchmark.patch
BuildRequires: fftw-devel, suitesparse-devel BuildRequires: fftw-devel, suitesparse-devel
BuildRequires: %{blaslib}-devel BuildRequires: %{blaslib}-devel
@ -122,42 +120,94 @@ export SCIPY_USE_PYTHRAN=0%{?with_pythran}
# check against the reference BLAS/LAPACK # check against the reference BLAS/LAPACK
export FLEXIBLAS=netlib export FLEXIBLAS=netlib
# https://github.com/scipy/scipy/issues/17912
SKIP_ALL_ARCHS="\
not TestDatasets and \
not TestOde and \
not TestComplexOde and \
not TestVODECheckParameterUse and \
not TestZVODECheckParameterUse and \
not test_banded_ode_solvers and \
not test_examples[True-complex64]"
# skip also failing test_sygst for now
SKIP_X86_64="-k '$SKIP_ALL_ARCHS and \
not test_sygst'"
# https://bugzilla.redhat.com/show_bug.cgi?id=1959353
# TestConstructUtils::test_concatenate_int32_overflow is flaky on aarch64
SKIP_AARCH64="-k '$SKIP_ALL_ARCHS and \
not test_solve_discrete_are and \
not test_maxiter_worsening[lgmres] and \
not test_concatenate_int32_overflow'"
# Those tests fail on koji/brew for ppc64le but pass
# locally for that architecture
SKIP_PPC64LE="-k '$SKIP_ALL_ARCHS'"
# https://bugzilla.redhat.com/show_bug.cgi?id=1959353
SKIP_S390X="-k '$SKIP_ALL_ARCHS and \
not test_solve_discrete_are and \
not test_maxiter_worsening[lgmres] and \
not TestInterop and \
not TestSplder and \
not test_dblint and \
not TestUnivariateSpline and \
not TestLSQBivariateSpline and \
not TestPPoly and \
not TestLevyStable'"
# skip also test_cython_api: https://bugzilla.redhat.com/show_bug.cgi?id=2068496
# https://github.com/scipy/scipy/issues/17213
SKIP_32BIT="-k '$SKIP_ALL_ARCHS and \
not test_sygst and \
not test_cython_api and \
not test_examples and \
not test_shifts and \
not test_mu and \
not test_sum and \
not test_svdp and \
not test_resiliency_all_32 and \
not test_resiliency_random[TestCSC-test_sum_dtype] and \
not test_x0_equals_Mb[bicgstab] and \
not test_gh12218'"
export PYTEST_ADDOPTS="-k '$SKIP_ALL_ARCHS'"
# default test timeout # default test timeout
TIMEOUT=500 TIMEOUT=500
# skip failing TestSchur, it needs to be fixed to account for different %ifarch x86_64
# (but still valid) results from lapack >= 3.10 export PYTEST_ADDOPTS=$SKIP_X86_64
# see: https://github.com/Reference-LAPACK/lapack/issues/628 %endif
export PYTEST_ADDOPTS="-k 'not TestSchur'"
%ifarch aarch64
export PYTEST_ADDOPTS=$SKIP_AARCH64
TIMEOUT=1000
%endif
%ifarch ppc64le
export PYTEST_ADDOPTS=$SKIP_PPC64LE
TIMEOUT=1000
%endif
%ifarch s390x %ifarch s390x
# skip failing tests on s390x for now export PYTEST_ADDOPTS=$SKIP_S390X
export PYTEST_ADDOPTS="-k 'not TestSchur and \
not (TestNoData and test_nodata) and \
not test_solve_discrete_are'"
# some tests (namely test_logpdf_overflow) tend to run for a long time on s390x
TIMEOUT=1000 TIMEOUT=1000
%endif %endif
%ifarch aarch64 || ppc64le %ifarch armv7hl
# https://bugzilla.redhat.com/show_bug.cgi?id=1959353 export PYTEST_ADDOPTS=$SKIP_32BIT
export PYTEST_ADDOPTS="-k 'not TestSchur and not test_solve_discrete_are'"
TIMEOUT=1000
%endif %endif
%ifarch x86_64 %ifarch i686
# skip also failing test_sygst for now export PYTEST_ADDOPTS=$SKIP_32BIT
export PYTEST_ADDOPTS="-k 'not TestSchur and not test_sygst'"
%endif
%ifarch i686 || armv7hl
# skip also test_cython_api: https://bugzilla.redhat.com/show_bug.cgi?id=2068496
export PYTEST_ADDOPTS="-k 'not TestSchur and not test_sygst and not test_cython_api'"
%endif %endif
pushd %{buildroot}/%{python3_sitearch} pushd %{buildroot}/%{python3_sitearch}
%{pytest} scipy # Ignoring the datasets tests as we don't have the optional pooch
# dependency on RHEL.
%{pytest} --ignore=scipy/datasets/tests/test_data.py scipy
# Remove test remnants # Remove test remnants
rm -rf gram{A,B} rm -rf gram{A,B}
popd popd
@ -168,6 +218,9 @@ popd
%{python3_sitearch}/*.egg-info %{python3_sitearch}/*.egg-info
%changelog %changelog
* Sun Feb 19 2023 Charalampos Stratakis <cstratak@redhat.com> - 1.10.0-1
- Update to 1.10.0
* Thu Dec 01 2022 Charalampos Stratakis <cstratak@redhat.com> - 1.8.1-1 * Thu Dec 01 2022 Charalampos Stratakis <cstratak@redhat.com> - 1.8.1-1
- Initial package - Initial package
- Fedora contributions by: - Fedora contributions by:
@ -197,6 +250,7 @@ popd
Nikola Forró <nforro@redhat.com> Nikola Forró <nforro@redhat.com>
Nils Philippsen <nils@redhat.com> Nils Philippsen <nils@redhat.com>
Orion Poplawski <orion@nwra.com> Orion Poplawski <orion@nwra.com>
Pavel Šimovec <psimovec@redhat.com>
Peter Robinson <pbrobinson@fedoraproject.org> Peter Robinson <pbrobinson@fedoraproject.org>
Petr Viktorin <pviktori@redhat.com> Petr Viktorin <pviktori@redhat.com>
Robert Kuska <rkuska@redhat.com> Robert Kuska <rkuska@redhat.com>

View File

@ -1,69 +0,0 @@
--- scipy-1.8.1/scipy/linalg/flapack_sym_herm.pyf.src.debug 2022-04-30 06:14:37.965527300 +0900
+++ scipy-1.8.1/scipy/linalg/flapack_sym_herm.pyf.src 2022-07-01 22:51:14.057047006 +0900
@@ -772,10 +772,10 @@
integer intent(hide),dimension(liwork),depend(liwork) :: iwork
<ftype2> intent(out),dimension(n),depend(n) :: w
- <ftype2> intent(out),dimension((compute_v?MAX(0,n):0),(compute_v?(*range=='I'?iu-il+1:MAX(1,n)):0)),depend(n,compute_v,range,iu,il) :: z
+ <ftype2> intent(out),dimension((compute_v?MAX(0,n):0),(compute_v?((*range=='I')?(iu-il+1):MAX(1,n)):0)),depend(n,compute_v,range,iu,il) :: z
integer intent(out) :: m
! Only returned if range=='A' or range=='I' and il, iu = 1, n
- integer intent(out),dimension((compute_v?(2*(*range=='A'||(*range=='I' && iu-il+1==n)?n:0)):0)),depend(n,iu,il,compute_v,range) :: isuppz
+ integer intent(out),dimension((compute_v?(2*((*range=='A')||((*range=='I') && (iu-il+1==n))?n:0)):0)),depend(n,iu,il,compute_v,range) :: isuppz
integer intent(out) :: info
end subroutine <prefix2>syevr
@@ -844,7 +844,7 @@
integer intent(hide),dimension(liwork),depend(liwork) :: iwork
<ftype2> intent(out),dimension(n),depend(n) :: w
- <ftype2c> intent(out),dimension((compute_v?MAX(0,n):0),(compute_v?(*range=='I'?iu-il+1:MAX(1,n)):0)),depend(n,compute_v,range,iu,il) :: z
+ <ftype2c> intent(out),dimension((compute_v?MAX(0,n):0),(compute_v?((*range=='I')?(iu-il+1):MAX(1,n)):0)),depend(n,compute_v,range,iu,il) :: z
integer intent(out) :: m
! MKL implementation has a bug that still accesses isuppz array even if
! range=='A' or range=='I' and il, iu = 1, n which is not the case for
@@ -852,7 +852,7 @@
! of the settings. It is wasteful but necessary. The bug is fixed in
! mkl 2020 update 2 and when time comes change this line with
!
- ! integer intent(out),dimension((compute_v?(2*(*range=='A'||(*range=='I' && iu-il+1==n)?n:0)):0)),depend(n,iu,il,range,compute_v) :: isuppz
+ ! integer intent(out),dimension((compute_v?(2*(*range=='A'||((*range=='I') && (iu-il+1==n))?n:0)):0)),depend(n,iu,il,range,compute_v) :: isuppz
!
integer intent(out),dimension(2*max(1,n)),depend(n) :: isuppz
integer intent(out) :: info
@@ -919,7 +919,7 @@
integer intent(hide),dimension(5*n),depend(n) :: iwork
<ftype2> intent(out),dimension(n),depend(n) :: w
- <ftype2> intent(out),dimension((compute_v?MAX(0,n):0),(compute_v?(*range=='I'?iu-il+1:MAX(1,n)):0)),depend(n,compute_v,range,iu,il) :: z
+ <ftype2> intent(out),dimension((compute_v?MAX(0,n):0),(compute_v?((*range=='I')?(iu-il+1):MAX(1,n)):0)),depend(n,compute_v,range,iu,il) :: z
integer intent(out) :: m
integer intent(out),dimension((compute_v?n:0)),depend(compute_v,n):: ifail
integer intent(out) :: info
@@ -984,7 +984,7 @@
<ftype2> intent(hide),dimension(7*n),depend(n) :: rwork
<ftype2> intent(out),dimension(n),depend(n) :: w
- <ftype2c> intent(out),dimension((compute_v*n),(compute_v?(*range=='I'?iu-il+1:MAX(1,n)):0)),depend(compute_v,range,n,iu,il) :: z
+ <ftype2c> intent(out),dimension((compute_v*n),(compute_v?((*range=='I')?(iu-il+1):MAX(1,n)):0)),depend(compute_v,range,n,iu,il) :: z
integer intent(out) :: m
integer intent(out),dimension(compute_v*n),depend(compute_v,n):: ifail
integer intent(out) :: info
@@ -1222,7 +1222,7 @@
integer intent(hide),dimension(5*n),depend(n) :: iwork
<ftype2> intent(out),dimension(n),depend(n) :: w
- <ftype2> intent(out),dimension((jobz[0]=='V'?MAX(0,n):0),(jobz[0]=='V'?(range[0]=='I'?iu-il+1:MAX(1,n)):0)),depend(n,jobz,range,iu,il) :: z
+ <ftype2> intent(out),dimension((jobz[0]=='V'?MAX(0,n):0),(jobz[0]=='V'?((range[0]=='I')?(iu-il+1):MAX(1,n)):0)),depend(n,jobz,range,iu,il) :: z
integer intent(out) :: m
integer intent(out),dimension((jobz[0]=='N'?0:n)),depend(jobz,n):: ifail
integer intent(out) :: info
@@ -1293,7 +1293,7 @@
<ftype2> intent(hide),dimension(7*n),depend(n) :: rwork
<ftype2> intent(out),dimension(n),depend(n) :: w
- <ftype2c> intent(out),dimension((jobz[0]=='V'?MAX(0,n):0),(jobz[0]=='V'?(range[0]=='I'?iu-il+1:MAX(1,n)):0)),depend(n,jobz,range,iu,il) :: z
+ <ftype2c> intent(out),dimension((jobz[0]=='V'?MAX(0,n):0),(jobz[0]=='V'?((range[0]=='I')?(iu-il+1):MAX(1,n)):0)),depend(n,jobz,range,iu,il) :: z
integer intent(out) :: m
integer intent(out),dimension((jobz[0]=='N'?0:n)),depend(jobz,n):: ifail
integer intent(out) :: info

View File

@ -1,150 +0,0 @@
diff --git a/benchmarks/benchmarks/stats.py b/benchmarks/benchmarks/stats.py
index 0f105b39..ed399f4d 100644
--- a/benchmarks/benchmarks/stats.py
+++ b/benchmarks/benchmarks/stats.py
@@ -162,6 +162,33 @@ class InferentialStats(Benchmark):
stats.mstats.kruskal(self.a, self.b)
+# Benchmark data for the truncnorm stats() method.
+# The data in each row is:
+# a, b, mean, variance, skewness, excess kurtosis. Generated using
+# https://gist.github.com/WarrenWeckesser/636b537ee889679227d53543d333a720
+truncnorm_cases = [[-20, -19, -19.052343945976656, 0.002725073018195613,
+ -1.9838693623377885, 5.871801893091683],
+ [-30, -29, -29.034401237736176, 0.0011806604886186853,
+ -1.9929615171469608, 5.943905539773037],
+ [-40, -39, -39.02560741993011, 0.0006548827702932775,
+ -1.9960847672775606, 5.968744357649675],
+ [39, 40, 39.02560741993011, 0.0006548827702932775,
+ 1.9960847672775606, 5.968744357649675]]
+truncnorm_cases = np.array(truncnorm_cases)
+
+
+class TruncnormStats(Benchmark):
+ param_names = ['case', 'moment']
+ params = [list(range(len(truncnorm_cases))), ['m', 'v', 's', 'k']]
+
+ def track_truncnorm_stats_error(self, case, moment):
+ result_indices = dict(zip(['m', 'v', 's', 'k'], range(2, 6)))
+ ref = truncnorm_cases[case, result_indices[moment]]
+ a, b = truncnorm_cases[case, 0:2]
+ res = stats.truncnorm(a, b).stats(moments=moment)
+ return np.abs((res - ref)/ref)
+
+
class DistributionsAll(Benchmark):
# all distributions are in this list. A conversion to a set is used to
# remove duplicates that appear more than once in either `distcont` or
diff --git a/scipy/stats/tests/test_distributions.py b/scipy/stats/tests/test_distributions.py
index d18ad6f3..a15a9301 100644
--- a/scipy/stats/tests/test_distributions.py
+++ b/scipy/stats/tests/test_distributions.py
@@ -910,61 +910,52 @@ class TestTruncnorm:
assert_almost_equal(s, s0, decimal=decimal_s)
assert_almost_equal(k, k0)
- @pytest.mark.xfail_on_32bit("reduced accuracy with 32bit platforms.")
- def test_moments(self):
- # Values validated by changing TRUNCNORM_TAIL_X so as to evaluate
- # using both the _norm_XXX() and _norm_logXXX() functions, and by
- # removing the _stats and _munp methods in truncnorm tp force
- # numerical quadrature.
- # For m,v,s,k expect k to have the largest error as it is
- # constructed from powers of lower moments
-
- self._test_moments_one_range(-30, 30, [0, 1, 0.0, 0.0])
- self._test_moments_one_range(-10, 10, [0, 1, 0.0, 0.0])
- self._test_moments_one_range(-3, 3, [0.0, 0.9733369246625415,
- 0.0, -0.1711144363977444])
- self._test_moments_one_range(-2, 2, [0.0, 0.7737413035499232,
- 0.0, -0.6344632828703505])
-
- self._test_moments_one_range(0, np.inf, [0.7978845608028654,
- 0.3633802276324186,
- 0.9952717464311565,
- 0.8691773036059725])
- self._test_moments_one_range(-np.inf, 0, [-0.7978845608028654,
- 0.3633802276324186,
- -0.9952717464311565,
- 0.8691773036059725])
-
- self._test_moments_one_range(-1, 3, [0.2827861107271540,
- 0.6161417353578292,
- 0.5393018494027878,
- -0.2058206513527461])
- self._test_moments_one_range(-3, 1, [-0.2827861107271540,
- 0.6161417353578292,
- -0.5393018494027878,
- -0.2058206513527461])
-
- self._test_moments_one_range(-10, -9, [-9.1084562880124764,
- 0.0114488058210104,
- -1.8985607337519652,
- 5.0733457094223553])
- self._test_moments_one_range(-20, -19, [-19.0523439459766628,
- 0.0027250730180314,
- -1.9838694022629291,
- 5.8717850028287586])
- self._test_moments_one_range(-30, -29, [-29.0344012377394698,
- 0.0011806603928891,
- -1.9930304534611458,
- 5.8854062968996566],
- decimal_s=6)
- self._test_moments_one_range(-40, -39, [-39.0256074199326264,
- 0.0006548826719649,
- -1.9963146354109957,
- 5.6167758371700494])
- self._test_moments_one_range(39, 40, [39.0256074199326264,
- 0.0006548826719649,
- 1.9963146354109957,
- 5.6167758371700494])
+ # Test data for the truncnorm stats() method.
+ # The data in each row is:
+ # a, b, mean, variance, skewness, excess kurtosis. Generated using
+ # https://gist.github.com/WarrenWeckesser/636b537ee889679227d53543d333a720
+ _truncnorm_stats_data = [
+ [-30, 30,
+ 0.0, 1.0, 0.0, 0.0],
+ [-10, 10,
+ 0.0, 1.0, 0.0, -1.4927521335810455e-19],
+ [-3, 3,
+ 0.0, 0.9733369246625415, 0.0, -0.17111443639774404],
+ [-2, 2,
+ 0.0, 0.7737413035499232, 0.0, -0.6344632828703505],
+ [0, np.inf,
+ 0.7978845608028654,
+ 0.3633802276324187,
+ 0.995271746431156,
+ 0.8691773036059741],
+ [-np.inf, 0,
+ -0.7978845608028654,
+ 0.3633802276324187,
+ -0.995271746431156,
+ 0.8691773036059741],
+ [-1, 3,
+ 0.282786110727154,
+ 0.6161417353578293,
+ 0.5393018494027877,
+ -0.20582065135274694],
+ [-3, 1,
+ -0.282786110727154,
+ 0.6161417353578293,
+ -0.5393018494027877,
+ -0.20582065135274694],
+ [-10, -9,
+ -9.108456288012409,
+ 0.011448805821636248,
+ -1.8985607290949496,
+ 5.0733461105025075],
+ ]
+ _truncnorm_stats_data = np.array(_truncnorm_stats_data)
+
+ @pytest.mark.parametrize("case", _truncnorm_stats_data)
+ def test_moments(self, case):
+ a, b, m0, v0, s0, k0 = case
+ m, v, s, k = stats.truncnorm.stats(a, b, moments='mvsk')
+ assert_allclose([m, v, s, k], [m0, v0, s0, k0], atol=1e-17)
def test_9902_moments(self):
m, v = stats.truncnorm.stats(0, np.inf, moments='mv')

View File

@ -1 +1 @@
SHA512 (scipy-1.8.1.tar.gz) = f6fc71c209991fe82baa4b10d8ade0deb1057f6f5942a91dfb7ae45f3eb78a4535efa2861badf5e2d37239fa99dbd99de760aa7e4854b95991ade0263004e7ea SHA512 (scipy-1.10.0.tar.gz) = 13fec0a2c24b90617ad4701c43c54757c91d2c62ca4b9ea5e5c5d130177ba4d2bb8687aae9057b58c26d1a77e4291164bad7ba9e21352669c07ba18bf539ad32