summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfredo Tupone <tupone@gentoo.org>2023-05-08 21:27:32 +0200
committerAlfredo Tupone <tupone@gentoo.org>2023-05-08 21:31:33 +0200
commite2df99959623331aa3710cc48992e783cb9f5985 (patch)
treeb4b42cefa8be55ba036c7a946602013c1ff3cc8a
parentdev-python/pyrqlite: add 2.2.0 (diff)
downloadgentoo-e2df99959623331aa3710cc48992e783cb9f5985.tar.gz
gentoo-e2df99959623331aa3710cc48992e783cb9f5985.tar.bz2
gentoo-e2df99959623331aa3710cc48992e783cb9f5985.zip
sci-libs/datasets: fix librosa import
Closes: https://bugs.gentoo.org/905938 Signed-off-by: Alfredo Tupone <tupone@gentoo.org>
-rw-r--r--sci-libs/datasets/files/datasets-2.11.0-tests.patch28
1 files changed, 15 insertions, 13 deletions
diff --git a/sci-libs/datasets/files/datasets-2.11.0-tests.patch b/sci-libs/datasets/files/datasets-2.11.0-tests.patch
index 01e5d9c70e7b..0bbf200acbd0 100644
--- a/sci-libs/datasets/files/datasets-2.11.0-tests.patch
+++ b/sci-libs/datasets/files/datasets-2.11.0-tests.patch
@@ -59,7 +59,7 @@
@pytest.mark.parametrize(
"build_example",
[
-@@ -82,6 +82,7 @@
+@@ -81,6 +82,7 @@
assert decoded_example.keys() == {"path", "array", "sampling_rate"}
@@ -75,7 +75,7 @@
@pytest.mark.parametrize("sampling_rate", [16_000, 48_000])
def test_audio_decode_example_pcm(shared_datadir, sampling_rate):
audio_path = str(shared_datadir / "test_audio_16000.pcm")
-@@ -416,6 +417,7 @@
+@@ -414,6 +417,7 @@
assert column[0]["sampling_rate"] == 16000
@@ -83,7 +83,7 @@
@pytest.mark.parametrize(
"build_data",
[
-@@ -440,6 +442,7 @@
+@@ -438,6 +442,7 @@
assert item["audio"].keys() == {"path", "array", "sampling_rate"}
@@ -91,7 +91,7 @@
def test_dataset_concatenate_audio_features(shared_datadir):
# we use a different data structure between 1 and 2 to make sure they are compatible with each other
audio_path = str(shared_datadir / "test_audio_44100.wav")
-@@ -453,6 +456,7 @@
+@@ -451,6 +456,7 @@
assert concatenated_dataset[1]["audio"]["array"].shape == dset2[0]["audio"]["array"].shape
@@ -99,7 +99,7 @@
def test_dataset_concatenate_nested_audio_features(shared_datadir):
# we use a different data structure between 1 and 2 to make sure they are compatible with each other
audio_path = str(shared_datadir / "test_audio_44100.wav")
-@@ -616,6 +616,7 @@
+@@ -610,6 +616,7 @@
assert isinstance(ds, Dataset)
@@ -107,7 +107,7 @@
def test_dataset_with_audio_feature_undecoded(shared_datadir):
audio_path = str(shared_datadir / "test_audio_44100.wav")
data = {"audio": [audio_path]}
-@@ -633,6 +634,7 @@
+@@ -627,6 +634,7 @@
assert column[0] == {"path": audio_path, "bytes": None}
@@ -115,7 +115,7 @@
def test_formatted_dataset_with_audio_feature_undecoded(shared_datadir):
audio_path = str(shared_datadir / "test_audio_44100.wav")
data = {"audio": [audio_path]}
-@@ -664,6 +666,7 @@
+@@ -658,6 +666,7 @@
assert column[0] == {"path": audio_path, "bytes": None}
@@ -135,24 +135,26 @@
wrong_scheme = "ERROR"
--- a/tests/packaged_modules/test_audiofolder.py 2023-05-06 14:00:39.560876163 +0200
+++ b/tests/packaged_modules/test_audiofolder.py 2023-05-06 14:01:26.005212423 +0200
-@@ -4,7 +4,6 @@
- import librosa
+@@ -1,10 +1,8 @@
+ import shutil
+ import textwrap
+
+-import librosa
import numpy as np
import pytest
-import soundfile as sf
from datasets import Audio, ClassLabel, Features, Value
from datasets.data_files import DataFilesDict, get_data_patterns_locally
-@@ -191,9 +190,11 @@
- assert len(data_files_with_two_splits_and_metadata["test"]) == 2
+@@ -192,8 +190,11 @@
return data_files_with_two_splits_and_metadata
--
+
+@pytest.mark.skip(reason="require soundfile")
@pytest.fixture
def data_files_with_zip_archives(tmp_path, audio_file):
+ import soundfile as sf
-+
++ import librosa
data_dir = tmp_path / "audiofolder_data_dir_with_zip_archives"
data_dir.mkdir(parents=True, exist_ok=True)
archive_dir = data_dir / "archive"