diff --git a/python-librosa.changes b/python-librosa.changes index bed4a64..2897f9b 100644 --- a/python-librosa.changes +++ b/python-librosa.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Oct 21 06:29:51 UTC 2022 - Daniel Garcia + +- Add update-tests-for-numpy-123.patch gh#librosa/librosa#1581 +- Add remove-hanning-from-tests.patch gh#librosa/librosa#1548 + ------------------------------------------------------------------- Mon Sep 26 02:21:59 UTC 2022 - Steve Kowalik diff --git a/python-librosa.spec b/python-librosa.spec index c12df90..32f8fd0 100644 --- a/python-librosa.spec +++ b/python-librosa.spec @@ -33,6 +33,10 @@ Source2: librosa-pooch-cache.tar.gz Patch0: remove-contextlib2.patch # PATCH-FIX-OPENSUSE Skip tests that require further test data that is ~180MiB Patch1: skip-test-data-missing-tests.patch +# PATCH-FIX-UPSTREAM update-tests-for-numpy-123.patch gh#librosa/librosa#1581 +Patch2: update-tests-for-numpy-123.patch +# PATCH-FIX-UPSTREAM remove-hanning-from-tests.patch gh#librosa/librosa#1548 +Patch3: remove-hanning-from-tests.patch BuildRequires: %{python_module SoundFile >= 0.10.2} BuildRequires: %{python_module audioread >= 2.1.9} BuildRequires: %{python_module decorator >= 4.0.0} diff --git a/remove-hanning-from-tests.patch b/remove-hanning-from-tests.patch new file mode 100644 index 0000000..84f1a4d --- /dev/null +++ b/remove-hanning-from-tests.patch @@ -0,0 +1,21 @@ +From 2f4f68869b708e8e5dca3a4b64ac59fc86dcb2a1 Mon Sep 17 00:00:00 2001 +From: Brian McFee +Date: Fri, 5 Aug 2022 12:10:28 -0400 +Subject: [PATCH] removed hanning from tests, fixes #1547 + +--- + tests/test_filters.py | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/tests/test_filters.py b/tests/test_filters.py +index 14c2f1dea5..59e351d3e0 100644 +--- a/tests/test_filters.py ++++ b/tests/test_filters.py +@@ -226,7 +226,6 @@ def test_chroma_issue1295(freq): + "flattop", + "hamming", + "hann", +- "hanning", + "nuttall", + "parzen", + "triang", diff --git a/update-tests-for-numpy-123.patch b/update-tests-for-numpy-123.patch new file mode 100644 index 0000000..292508b --- /dev/null +++ b/update-tests-for-numpy-123.patch @@ -0,0 +1,66 @@ +From 5dd212036667a524cf29480d5351ee5e5eca5693 Mon Sep 17 00:00:00 2001 +From: Brian McFee +Date: Mon, 26 Sep 2022 13:26:26 -0400 +Subject: [PATCH] updated tests for numpy 1.23 compatibility + +--- + tests/test_core.py | 2 ++ + tests/test_multichannel.py | 6 +++--- + tests/test_util.py | 6 +++--- + 3 files changed, 8 insertions(+), 6 deletions(-) + +diff --git a/tests/test_core.py b/tests/test_core.py +index 57c3458aee..d83f5b6e5a 100644 +--- a/tests/test_core.py ++++ b/tests/test_core.py +@@ -2122,6 +2122,8 @@ def test_pcen_stream_multi(axis): + slice2 = [slice(None)] * x.ndim + slice2[axis] = slice(10, None) + ++ slice1 = tuple(slice1) ++ slice2 = tuple(slice2) + # Compute pcen piecewise + p1, zf1 = librosa.pcen(x[slice1], return_zf=True, axis=axis) + p2, zf2 = librosa.pcen(x[slice2], zi=zf1, return_zf=True, axis=axis) +diff --git a/tests/test_multichannel.py b/tests/test_multichannel.py +index 19531842fd..8a0490bd82 100644 +--- a/tests/test_multichannel.py ++++ b/tests/test_multichannel.py +@@ -65,13 +65,13 @@ def test_sync_multi(aggregate, ndim, axis): + idx = [slice(None)] * ndim + idx[axis] = 0 + if aggregate is np.sum: +- assert np.allclose(dsync[idx], 2) ++ assert np.allclose(dsync[tuple(idx)], 2) + else: +- assert np.allclose(dsync[idx], 1) ++ assert np.allclose(dsync[tuple(idx)], 1) + + # The second slice will sum to 1 and have mean 1 + idx[axis] = 1 +- assert np.allclose(dsync[idx], 1) ++ assert np.allclose(dsync[tuple(idx)], 1) + + + def test_stft_multi(y_multi): +diff --git a/tests/test_util.py b/tests/test_util.py +index 1b90087611..eebbf432c2 100644 +--- a/tests/test_util.py ++++ b/tests/test_util.py +@@ -877,13 +877,13 @@ def test_sync(aggregate, ndim, axis): + idx = [slice(None)] * ndim + idx[axis] = 0 + if aggregate is np.sum: +- assert np.allclose(dsync[idx], 2) ++ assert np.allclose(dsync[tuple(idx)], 2) + else: +- assert np.allclose(dsync[idx], 1) ++ assert np.allclose(dsync[tuple(idx)], 1) + + # The second slice will sum to 1 and have mean 1 + idx[axis] = 1 +- assert np.allclose(dsync[idx], 1) ++ assert np.allclose(dsync[tuple(idx)], 1) + + + @pytest.mark.parametrize("aggregate", [np.mean, np.max])