- Add update-tests-for-numpy-123.patch gh#librosa/librosa#1581

- Add remove-hanning-from-tests.patch gh#librosa/librosa#1548

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-librosa?expand=0&rev=25
This commit is contained in:
Daniel Garcia 2022-10-21 06:31:18 +00:00 committed by Git OBS Bridge
parent 1ae0e469e9
commit 20d85c46a2
4 changed files with 97 additions and 0 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Oct 21 06:29:51 UTC 2022 - Daniel Garcia <daniel.garcia@suse.com>
- 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 <steven.kowalik@suse.com>

View File

@ -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}

View File

@ -0,0 +1,21 @@
From 2f4f68869b708e8e5dca3a4b64ac59fc86dcb2a1 Mon Sep 17 00:00:00 2001
From: Brian McFee <brian.mcfee@nyu.edu>
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",

View File

@ -0,0 +1,66 @@
From 5dd212036667a524cf29480d5351ee5e5eca5693 Mon Sep 17 00:00:00 2001
From: Brian McFee <brian.mcfee@nyu.edu>
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])