Compare commits

..

35 Commits
f29 ... master

Author SHA1 Message Date
Nikola Forró
138e3931a6 Skip factorial() float tests on Python 3.10
- resolves: #1898157
2020-11-25 19:08:00 +01:00
Nikola Forró
d411bdc4f2 New upstream release 1.5.4
- resolves: #1894887
2020-11-05 20:11:20 +01:00
Nikola Forró
6b3a6c9407 New upstream release 1.5.3
- resolves: #1889132
2020-10-19 14:27:31 +02:00
Nikola Forró
94c45e83c5 Skip one more test expected to fail on 32-bit architectures 2020-09-30 20:22:12 +02:00
Nikola Forró
803fd0655e New upstream release 1.5.2
- resolves: #1853871 and #1840077
2020-09-30 15:34:25 +02:00
Iñaki Úcar
de8cee97b4 https://fedoraproject.org/wiki/Changes/FlexiBLAS_as_BLAS/LAPACK_manager 2020-08-19 17:34:00 +02:00
Fedora Release Engineering
f9718c404a - Second attempt - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-08-01 08:57:42 +00:00
Fedora Release Engineering
3d2d3e1fed - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-07-29 10:23:12 +00:00
Elliott Sales de Andrade
8b264e22b8 Update to latest version. 2020-06-24 22:43:42 +00:00
Elliott Sales de Andrade
77fd7b5f42 Use pytest macro. 2020-06-24 22:43:42 +00:00
Troy Dawson
87b7e4491e Minor conditional tweak for ELN
Signed-off-by: Troy Dawson tdawson@redhat.com
2020-06-24 21:25:50 +00:00
Miro Hrončok
3b286e1db7 Desperate times call for desperate measures 2020-05-26 01:03:22 +02:00
Miro Hrončok
8bfea1df6b Rebuilt for Python 3.9 2020-05-25 21:59:38 +02:00
Orion Poplawski
5b99b78e2c Update to 1.4.1 (bz#1771154)
Workaround FTBFS with gcc 10 (bz#1800078)
2020-03-01 14:01:01 -07:00
Fedora Release Engineering
9c18ea8292 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-01-30 23:01:42 +00:00
Miro Hrončok
6ac9ed170a acceptable_failure_rate.patch: Don't use pytest private API
The private API used here was removed in pytest 5.
There is a public API now, pytest.ExitCode.TESTS_FAILED,
however that is not yet available in pytest 4.

We hardcode the value 1 instead, it is unlikely to be changed.
Once pytest 4 is gone, we can switch to the new API.

See https://github.com/pytest-dev/pytest/issues/5125
2020-01-02 16:22:28 +01:00
Miro Hrončok
567bfb565c Drop bogus subpackage license 2019-11-26 10:40:12 +01:00
Miro Hrončok
e73966d9bf 1.3.1 sources 2019-11-09 00:18:57 +01:00
Lumir Balhar
0516e73d2e Add patch to bugfix cKDTree 2019-11-07 13:54:51 +01:00
Miro Hrončok
70ed1cdf04 Update to 1.3.1, drop Py2 packages (not supported)
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1674101
2019-10-18 14:29:03 +02:00
Miro Hrončok
76ca11c616 Rebuilt for Python 3.8.0rc1 (#1748018) 2019-10-03 14:38:30 +02:00
Miro Hrončok
b2dc08c359 Deselect TestIQR.test_scale on Python 3 2019-08-19 20:00:40 +02:00
Miro Hrončok
0d2dfdebae Rebuilt for Python 3.8 2019-08-19 11:05:33 +02:00
Petr Viktorin
a36526471b Enable parallel tests in Python 3 %%check
Also, use macros for the Python interpreter in tests.
`python -m pytest` is more robust than `pytest` in ensuring
the tests run with correct interpreter.
2019-07-30 14:10:01 +02:00
Petr Viktorin
bf2f2311a1 Remove build dependency on python2-pytest-xdist and python2-pytest-timeout 2019-07-30 14:10:01 +02:00
Fedora Release Engineering
5dd1dba41f - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-07-26 22:54:43 +00:00
Zbigniew Jędrzejewski-Szmek
33637a11cb Remove trailing comments that rpm-4.15 doesn't like 2019-07-12 15:14:03 +02:00
Zbigniew Jędrzejewski-Szmek
a07631500b Remove duplicate %descriptions 2019-07-12 15:12:53 +02:00
Marcel Plch
180d9017e2 Fix FTBFS with Py3.8 2019-07-04 16:55:38 +02:00
Orion Poplawski
0bf871d600 Build only against openblasp (bugz#1709161) 2019-05-16 20:07:02 -06:00
Orion Poplawski
1d12442e10 Do not create *-PYTEST.pyc files 2019-04-26 21:10:08 -06:00
Orion Poplawski
32c93448e8 Update to 1.2.1
Drop scipy2-doc
2019-04-23 21:28:06 -06:00
Charalampos Stratakis
98a80e211d Update to 1.2.0 2019-02-07 00:43:31 +01:00
Fedora Release Engineering
b491c27147 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-02-02 14:57:51 +00:00
Igor Gnatenko
4b0880421d Remove obsolete Group tag
References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag
2019-01-28 20:24:49 +01:00
6 changed files with 242 additions and 143 deletions

8
.gitignore vendored
View File

@ -24,3 +24,11 @@ scipy-0.7.2.tar.gz
/scipy-0.19.1.tar.xz
/scipy-1.0.0.tar.xz
/scipy-1.1.0.tar.gz
/scipy-1.2.0.tar.gz
/scipy-1.2.1.tar.gz
/scipy-1.3.1.tar.gz
/scipy-1.4.1.tar.gz
/scipy-1.5.0.tar.gz
/scipy-1.5.2.tar.gz
/scipy-1.5.3.tar.gz
/scipy-1.5.4.tar.gz

View File

@ -1,28 +0,0 @@
diff --git a/scipy/conftest.py b/scipy/conftest.py
index b0edcdd..f5c3c0b 100644
--- a/scipy/conftest.py
+++ b/scipy/conftest.py
@@ -3,6 +3,7 @@ from __future__ import division, absolute_import, print_function
import os
import pytest
+import _pytest
import warnings
from scipy._lib._fpumode import get_fpu_mode
@@ -33,3 +34,15 @@ def check_fpu_mode(request):
warnings.warn("FPU mode changed from {0:#x} to {1:#x} during "
"the test".format(old_mode, new_mode),
category=FPUModeChangeWarning, stacklevel=0)
+
+
+ACCEPTABLE_FAILURE_RATE = int(os.environ.get('ACCEPTABLE_FAILURE_RATE', 0))
+
+
+@pytest.hookimpl()
+def pytest_sessionfinish(session, exitstatus):
+ if exitstatus != _pytest.main.EXIT_TESTSFAILED:
+ return
+ failure_rate = (100.0 * session.testsfailed) / session.testscollected
+ if failure_rate <= ACCEPTABLE_FAILURE_RATE:
+ session.exitstatus = 0

View File

@ -1,15 +1,22 @@
# without means enabled
%bcond_without doc
%bcond_with doc
# Set to pre-release version suffix if building pre-release, else %%{nil}
%global rcver %{nil}
%if 0%{?fedora} >= 33 || 0%{?rhel} >= 9
%global blaslib flexiblas
%global blasvar %{nil}
%else
%global blaslib openblas
%global blasvar p
%endif
Summary: Scientific Tools for Python
Name: scipy
Version: 1.1.0
Release: 3%{?dist}
Version: 1.5.4
Release: 2%{?dist}
Group: Development/Libraries
# BSD -- whole package except:
# Boost -- scipy/special/cephes/scipy_iv.c
# Public Domain -- scipy/odr/__odrpack.c
@ -17,40 +24,33 @@ License: BSD and Boost and Public Domain
Url: http://www.scipy.org/scipylib/index.html
Source0: https://github.com/scipy/scipy/releases/download/v%{version}/scipy-%{version}.tar.gz
# Previously we ignored the tests results, because they don't always pass
# Instead of ignoring the results entirely, we allow certain failure rate
# https://stackoverflow.com/a/47731333/1839451
Patch0: acceptable_failure_rate.patch
# https://github.com/scipy/scipy/pull/12899
Patch0: skip-certain-tests-on-32-bit-arches.patch
# https://github.com/scipy/scipy/pull/13130
Patch1: skip-factorial-float-tests-on-py310.patch
BuildRequires: python2-numpy, python2-devel,python2-numpy-f2py
BuildRequires: python2-pytest
BuildRequires: python2-pytest-xdist
BuildRequires: python2-pytest-timeout
BuildRequires: fftw-devel, blas-devel, lapack-devel, suitesparse-devel
%ifarch %{openblas_arches}
BuildRequires: openblas-devel
%else
BuildRequires: atlas-devel
%endif
BuildRequires: fftw-devel, suitesparse-devel
BuildRequires: %{blaslib}-devel
BuildRequires: gcc-gfortran, swig, gcc-c++
BuildRequires: qhull-devel
BuildRequires: /usr/bin/pathfix.py
BuildRequires: pybind11-devel
BuildRequires: python3-pybind11 >= 2.4.0
BuildRequires: python3-numpy, python3-devel, python3-numpy-f2py
BuildRequires: python3-setuptools
BuildRequires: python3-Cython
BuildRequires: python3-pytest
BuildRequires: python3-pytest-xdist
BuildRequires: python3-pytest-timeout
%if %{with doc}
BuildRequires: python2-sphinx
BuildRequires: python2-matplotlib
BuildRequires: python2-numpydoc
BuildRequires: python3-sphinx
BuildRequires: python3-matplotlib
BuildRequires: python3-numpydoc
%endif # with doc
%endif
%description
%global _description %{expand:
Scipy is open-source software for mathematics, science, and
engineering. The core library is NumPy which provides convenient and
fast N-dimensional array manipulation. The SciPy library is built to
@ -59,58 +59,23 @@ numerical routines such as routines for numerical integration and
optimization. Together, they run on all popular operating systems, are
quick to install, and are free of charge. NumPy and SciPy are easy to
use, but powerful enough to be depended upon by some of the world's
leading scientists and engineers.
leading scientists and engineers.}
%description %_description
%package -n python2-scipy
%package -n python3-scipy
Summary: Scientific Tools for Python
Requires: numpy, f2py
%{?python_provide:%python_provide python2-scipy}
# General provides of plain 'scipy' in F24
Provides: scipy = %{version}-%{release}
Provides: scipy%{?_isa} = %{version}-%{release}
Obsoletes: scipy <= 0.16.0
%description -n python2-scipy
Scipy is open-source software for mathematics, science, and
engineering. The core library is NumPy which provides convenient and
fast N-dimensional array manipulation. The SciPy library is built to
work with NumPy arrays, and provides many user-friendly and efficient
numerical routines such as routines for numerical integration and
optimization. Together, they run on all popular operating systems, are
quick to install, and are free of charge. NumPy and SciPy are easy to
use, but powerful enough to be depended upon by some of the world's
leading scientists and engineers.
Requires: python3-numpy, python3-f2py
%{?python_provide:%python_provide python3-scipy}
%description -n python3-scipy %_description
%if %{with doc}
%package -n python2-scipy-doc
Summary: Scientific Tools for Python - documentation
Requires: python2-scipy = %{version}-%{release}
%description -n python2-scipy-doc
HTML documentation for Scipy
%package -n python3-scipy-doc
Summary: Scientific Tools for Python - documentation
Requires: python3-scipy = %{version}-%{release}
%description -n python3-scipy-doc
HTML documentation for Scipy
%endif # with doc
%package -n python3-scipy
Summary: Scientific Tools for Python
Group: Development/Libraries
License: BSD and LGPLv2+
Requires: python3-numpy, python3-f2py
%{?python_provide:%python_provide python3-scipy}
%description -n python3-scipy
Scipy is open-source software for mathematics, science, and
engineering. The core library is NumPy which provides convenient and
fast N-dimensional array manipulation. The SciPy library is built to
work with NumPy arrays, and provides many user-friendly and efficient
numerical routines such as routines for numerical integration and
optimization. Together, they run on all popular operating systems, are
quick to install, and are free of charge. NumPy and SciPy are easy to
use, but powerful enough to be depended upon by some of the world's
leading scientists and engineers.
%endif
%prep
@ -127,26 +92,29 @@ library_dirs = %{_libdir}
include_dirs = /usr/include/suitesparse
umfpack_libs = umfpack
%ifarch %{openblas_arches}
[openblas]
libraries = %{blaslib}%{blasvar}
library_dirs = %{_libdir}
openblas_libs = openblasp
%endif
EOF
# Docs won't build unless the .dat files are specified here
sed -i 's/metadata = dict(/metadata = dict(package_data={"": ["*.dat"]},/' setup.py
# remove bundled numpydoc
rm doc/sphinxext -r
rm $(grep -rl '/\* Generated by Cython') PKG-INFO
%build
for PY in %{python3_version} %{python2_version}; do
for PY in %{python3_version}; do
# Adding -fallow-argument-mismatch workaround for https://github.com/scipy/scipy/issues/11611
env CFLAGS="$RPM_OPT_FLAGS -lm" \
FFLAGS="$RPM_OPT_FLAGS -fPIC" \
%ifarch %{openblas_arches}
OPENBLAS=%{_libdir} \
%if 0%{?fedora} >= 32 || 0%{?rhel} >= 9
FFLAGS="$RPM_OPT_FLAGS -fPIC -fallow-argument-mismatch" \
%else
ATLAS=%{_libdir}/atlas \
FFLAGS="$RPM_OPT_FLAGS -fPIC" \
%endif
OPENBLAS=%{_libdir} \
FFTW=%{_libdir} BLAS=%{_libdir} LAPACK=%{_libdir} \
%{_bindir}/python$PY setup.py config_fc \
--fcompiler=gnu95 --noarch \
@ -164,52 +132,35 @@ done
%install
%py3_install
%py2_install
# Some files got ambiguous python shebangs, we fix them after everything else is done
pathfix.py -pni "%{__python3} %{py3_shbang_opts}" %{buildroot}%{python3_sitearch}
%check
# Skip all tests on s390x because they hangs unexpectedly and randomly
# and pytest-timeout has no effect. Note that the outcome of the tests
# was previously ignored anyway so by disabling the test for s390x we
# are not doing anything more dangerous.
# check against the reference BLAS/LAPACK
export FLEXIBLAS=netlib
%ifarch s390x
exit 0
%endif
%ifarch x86_64
export ACCEPTABLE_FAILURE_RATE=0
%else
# there are usually 10-21 test failing, so we allow 1% failure rate
export ACCEPTABLE_FAILURE_RATE=1
%endif
%ifarch ppc64le
# test_decomp segfaults on ppc64le
export k="not test_denormals and not test_decomp"
%else
# test_denormals tends to stuck
export k="not test_denormals"
# skip failing tests on s390x for now
export PYTEST_ADDOPTS="-k '\
not (TestNoData and test_nodata) and \
not test_fortranfile_read_mixed_record and \
not test_kde_1d and \
not test_kde_1d_weighted and \
not test_kde_2d and \
not test_kde_2d_weighted and \
not test_gaussian_kde_subclassing and \
not test_gaussian_kde_covariance_caching and \
not test_kde_integer_input and \
not test_pdf_logpdf and \
not test_pdf_logpdf_weighted'"
%endif
pushd %{buildroot}/%{python3_sitearch}
py.test-3 --timeout=300 -k "$k" scipy
%{pytest} --timeout=500 scipy --numprocesses=auto
# Remove test remnants
rm -rf gram{A,B}
popd
pushd %{buildroot}/%{python2_sitearch}
py.test-2 --timeout=300 -k "$k" scipy
popd
%files -n python2-scipy
%doc LICENSE.txt
%{python2_sitearch}/scipy/
%{python2_sitearch}/*.egg-info
%if %{with doc}
%files -n python2-scipy-doc
%license LICENSE.txt
%doc doc/build-%{python2_version}/html
%endif # with doc
%files -n python3-scipy
%doc LICENSE.txt
%{python3_sitearch}/scipy/
@ -219,9 +170,91 @@ popd
%files -n python3-scipy-doc
%license LICENSE.txt
%doc doc/build-%{python3_version}/html
%endif # with doc
%endif
%changelog
* Wed Nov 25 2020 Nikola Forró <nforro@redhat.com> - 1.5.4-2
- Skip factorial() float tests on Python 3.10
resolves: #1898157
* Thu Nov 05 2020 Nikola Forró <nforro@redhat.com> - 1.5.4-1
- New upstream release 1.5.4
- Increase test timeout, 300 seconds is not always enough
for test_logpdf_overflow on s390x
resolves: #1894887
* Mon Oct 19 2020 Nikola Forró <nforro@redhat.com> - 1.5.3-1
- New upstream release 1.5.3
resolves: #1889132
* Wed Sep 30 2020 Nikola Forró <nforro@redhat.com> - 1.5.2-2
- Skip one more test expected to fail on 32-bit architectures
* Mon Aug 31 2020 Nikola Forró <nforro@redhat.com> - 1.5.2-1
- New upstream release 1.5.2
resolves: #1853871 and #1840077
* Sun Aug 16 2020 Iñaki Úcar <iucar@fedoraproject.org> - 1.5.0-4
- https://fedoraproject.org/wiki/Changes/FlexiBLAS_as_BLAS/LAPACK_manager
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.0-3
- Second attempt - Rebuilt for
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue Jun 23 2020 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 1.5.0-1
- Update to latest version
* Mon May 25 2020 Miro Hrončok <mhroncok@redhat.com> - 1.4.1-2
- Rebuilt for Python 3.9
* Sun Mar 01 2020 Orion Poplawski <orion@nwra.com> - 1.4.1-1
- Update to 1.4.1 (bz#1771154)
- Workaround FTBFS with gcc 10 (bz#1800078)
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Fri Oct 18 2019 Miro Hrončok <mhroncok@redhat.com> - 1.3.1-1
- Update to 1.3.1 (#1674101)
- Drop Python 2 packages (not supported by SciPy >= 1.3)
- Backported upstream patch for cKDTree (fixes FTBFS)
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 1.2.1-8
- Rebuilt for Python 3.8.0rc1 (#1748018)
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.2.1-7
- Rebuilt for Python 3.8
* Tue Jul 30 2019 Petr Viktorin <pviktori@redhat.com> - 1.2.1-6
- Remove build dependency on python2-pytest-xdist and python2-pytest-timeout
- Enable parallel tests in Python 3 %%check
- Use macros for Python interpreter in tests
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Mon Jun 10 2019 Marcel Plch <mplch@redhat.com> - 1.2.1-4
- Fix FTBFS with Py3.8 (#1606315)
* Thu May 16 2019 Orion Poplawski <orion@nwra.com> - 1.2.1-3
- Build only against openblasp (bugz#1709161)
* Fri Apr 26 2019 Orion Poplawski <orion@nwra.com> - 1.2.1-2
- Do not create *-PYTEST.pyc files
* Tue Apr 23 2019 Orion Poplawski <orion@nwra.com> - 1.2.1-1
- Update to 1.2.1
- Drop scipy2-doc
* Wed Feb 06 2019 Charalampos Stratakis <cstratak@redhat.com> - 1.2.0-1
- Update to 1.2.0
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
@ -287,7 +320,7 @@ popd
* Tue Jul 26 2016 Than Ngo <than@redhat.com> - 0.18.0-1
- 0.18.0
- %%check: make non-fatal as temporary workaround for scipy build on arm
- %%check: make non-fatal as temporary workaround for scipy build on arm
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.17.0-2
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
@ -577,4 +610,3 @@ popd
- Add changelog
- Removed Prefix, Vendor
- Fix Source0

View File

@ -0,0 +1,47 @@
From ea0a77cf8761a8b8636b93314139ed0fc0a9d1db Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nikola=20Forr=C3=B3?= <nforro@redhat.com>
Date: Wed, 30 Sep 2020 11:44:25 +0200
Subject: [PATCH] TST: make a couple of tests expected to fail on 32-bit
architectures
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
In TestConstructUtils.test_concatenate_int32_overflow
and test_nnz_overflow, on a 32-bit architecture, in case
check_free_memory() passes, ValueError is raised on an attempt
to create a numpy array too large for a 32-bit architecture.
Signed-off-by: Nikola Forró <nforro@redhat.com>
---
scipy/sparse/tests/test_construct.py | 1 +
scipy/sparse/tests/test_sparsetools.py | 1 +
2 files changed, 2 insertions(+)
diff --git a/scipy/sparse/tests/test_construct.py b/scipy/sparse/tests/test_construct.py
index 3a882c6cc..5a2b92667 100644
--- a/scipy/sparse/tests/test_construct.py
+++ b/scipy/sparse/tests/test_construct.py
@@ -378,6 +378,7 @@ class TestConstructUtils(object):
excinfo.match(r'Got blocks\[0,1\]\.shape\[0\] == 1, expected 2')
@pytest.mark.slow
+ @pytest.mark.xfail_on_32bit("Can't create large array for test")
def test_concatenate_int32_overflow(self):
""" test for indptr overflow when concatenating matrices """
check_free_memory(30000)
diff --git a/scipy/sparse/tests/test_sparsetools.py b/scipy/sparse/tests/test_sparsetools.py
index 0c208ef44..e95df1ba0 100644
--- a/scipy/sparse/tests/test_sparsetools.py
+++ b/scipy/sparse/tests/test_sparsetools.py
@@ -61,6 +61,7 @@ def test_regression_std_vector_dtypes():
@pytest.mark.slow
+@pytest.mark.xfail_on_32bit("Can't create large array for test")
def test_nnz_overflow():
# Regression test for gh-7230 / gh-7871, checking that coo_todense
# with nnz > int32max doesn't overflow.
--
2.26.2

View File

@ -0,0 +1,40 @@
From eabd8ea25fe291665f37fd069a1c574cd30d12cc Mon Sep 17 00:00:00 2001
From: Victor Stinner <vstinner@python.org>
Date: Wed, 25 Nov 2020 11:41:15 +0100
Subject: [PATCH] GH-13122: Skip factorial() float tests on Python 3.10
special.factorial() argument should be an array of integers.
On Python 3.10, math.factorial() reject float.
On Python 3.9, a DeprecationWarning is emitted.
A numpy array casts all integers to float if the array contains a
single NaN.
---
scipy/special/tests/test_basic.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/scipy/special/tests/test_basic.py b/scipy/special/tests/test_basic.py
index 9b7260e8435..e2ae29812a5 100644
--- a/scipy/special/tests/test_basic.py
+++ b/scipy/special/tests/test_basic.py
@@ -19,6 +19,7 @@
import itertools
import platform
+import sys
import numpy as np
from numpy import (array, isnan, r_, arange, finfo, pi, sin, cos, tan, exp,
@@ -1822,6 +1823,13 @@ def test_nan_inputs(self, x, exact):
result = special.factorial(x, exact=exact)
assert_(np.isnan(result))
+ # GH-13122: special.factorial() argument should be an array of integers.
+ # On Python 3.10, math.factorial() reject float.
+ # On Python 3.9, a DeprecationWarning is emitted.
+ # A numpy array casts all integers to float if the array contains a
+ # single NaN.
+ @pytest.mark.skipif(sys.version_info >= (3, 10),
+ reason="Python 3.10+ math.factorial() requires int")
def test_mixed_nan_inputs(self):
x = np.array([np.nan, 1, 2, 3, np.nan])
with suppress_warnings() as sup:

View File

@ -1 +1 @@
SHA512 (scipy-1.1.0.tar.gz) = 72fe32c6c009613cb78202598e5db14f8e630b3218839cfe18d43d40550d94cc5aa100c6f5d41f40e86ae148e9b6a13431bb91b0f9be44b0569ccd7b725fe973
SHA512 (scipy-1.5.4.tar.gz) = d23f68911a8880f87767819750d4d175ba8f9c72fcb9b8080305ee65722c046d4485fde4f0c85cc53c46247dd99813afe675a38b3b0569a683ddc2c2e021b8fc