diff --git a/.gitignore b/.gitignore index 3b40922..ab0e569 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,4 @@ scipy-0.7.2.tar.gz /scipy-1.5.2.tar.gz /scipy-1.5.3.tar.gz /scipy-1.5.4.tar.gz +/scipy-1.6.0.tar.gz diff --git a/scipy.spec b/scipy.spec index 2c36e80..444aaad 100644 --- a/scipy.spec +++ b/scipy.spec @@ -14,7 +14,7 @@ Summary: Scientific Tools for Python Name: scipy -Version: 1.5.4 +Version: 1.6.0 Release: 1%{?dist} # BSD -- whole package except: @@ -24,8 +24,8 @@ 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 -# https://github.com/scipy/scipy/pull/12899 -Patch0: skip-certain-tests-on-32-bit-arches.patch +# https://github.com/scipy/scipy/pull/13387 +Patch0: wavfile.patch BuildRequires: fftw-devel, suitesparse-devel BuildRequires: %{blaslib}-devel @@ -171,6 +171,14 @@ popd %endif %changelog +* Mon Jan 04 2021 Nikola Forró - 1.6.0-1 +- New upstream release 1.6.0 + resolves: #1906692 + +* Wed Nov 25 2020 Nikola Forró - 1.5.4-2 +- Skip factorial() float tests on Python 3.10 + resolves: #1898157 + * Thu Nov 05 2020 Nikola Forró - 1.5.4-1 - New upstream release 1.5.4 - Increase test timeout, 300 seconds is not always enough diff --git a/skip-factorial-float-tests-on-py310.patch b/skip-factorial-float-tests-on-py310.patch new file mode 100644 index 0000000..46a8b78 --- /dev/null +++ b/skip-factorial-float-tests-on-py310.patch @@ -0,0 +1,40 @@ +From eabd8ea25fe291665f37fd069a1c574cd30d12cc Mon Sep 17 00:00:00 2001 +From: Victor Stinner +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: diff --git a/sources b/sources index 6efb04d..3250601 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (scipy-1.5.4.tar.gz) = d23f68911a8880f87767819750d4d175ba8f9c72fcb9b8080305ee65722c046d4485fde4f0c85cc53c46247dd99813afe675a38b3b0569a683ddc2c2e021b8fc +SHA512 (scipy-1.6.0.tar.gz) = 995ffaf56b713cdd4bdb98d8525b892e9ad84a511878b43213cb71a67f34d87c111da36cf1e0b044c75c0d5af64bfde4ad0f3e9c5e71cae2dbf053251f37064e diff --git a/wavfile.patch b/wavfile.patch new file mode 100644 index 0000000..06258c5 --- /dev/null +++ b/wavfile.patch @@ -0,0 +1,36 @@ +commit 09d753f0ae71441906f5cee7a44b2d2b80212082 +Author: Nikola Forró +Date: Thu Jan 14 14:34:14 2021 +0100 + + ENH: Support big-endian platforms and big-endian WAVs + + PR #12287 added support for reading arbitrary-bit-depth WAVs, but + the code doesn't consider big-endian WAVs, and doesn't work as expected + on big-endian platforms due to the use of native-byte-order data-types. + This change fixes that. + + There is also a simple test case that compares euqivalent RIFX + (big-endian) and RIFF (little-endian) files to verify the data read + are the same. + +diff --git a/scipy/io/wavfile.py b/scipy/io/wavfile.py +index 9b5845d6b..951f8d201 100644 +--- a/scipy/io/wavfile.py ++++ b/scipy/io/wavfile.py +@@ -458,10 +458,13 @@ def _read_data_chunk(fid, format_tag, channels, bit_depth, is_big_endian, + + if dtype == 'V1': + # Rearrange raw bytes into smallest compatible numpy dtype +- dt = numpy.int32 if bytes_per_sample == 3 else numpy.int64 +- a = numpy.zeros((len(data) // bytes_per_sample, dt().itemsize), ++ dt = f'{fmt}i4' if bytes_per_sample == 3 else f'{fmt}i8' ++ a = numpy.zeros((len(data) // bytes_per_sample, numpy.dtype(dt).itemsize), + dtype='V1') +- a[:, -bytes_per_sample:] = data.reshape((-1, bytes_per_sample)) ++ if is_big_endian: ++ a[:, :bytes_per_sample] = data.reshape((-1, bytes_per_sample)) ++ else: ++ a[:, -bytes_per_sample:] = data.reshape((-1, bytes_per_sample)) + data = a.view(dt).reshape(a.shape[:-1]) + else: + if bytes_per_sample in {1, 2, 4, 8}: