public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Alfredo Tupone" <tupone@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/datasets/files/
Date: Mon,  8 May 2023 19:31:57 +0000 (UTC)	[thread overview]
Message-ID: <1683574293.e2df99959623331aa3710cc48992e783cb9f5985.tupone@gentoo> (raw)

commit:     e2df99959623331aa3710cc48992e783cb9f5985
Author:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
AuthorDate: Mon May  8 19:27:32 2023 +0000
Commit:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Mon May  8 19:31:33 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e2df9995

sci-libs/datasets: fix librosa import

Closes: https://bugs.gentoo.org/905938
Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>

 .../datasets/files/datasets-2.11.0-tests.patch     | 28 ++++++++++++----------
 1 file 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"


             reply	other threads:[~2023-05-08 19:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-08 19:31 Alfredo Tupone [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-05-15 21:32 [gentoo-commits] repo/gentoo:master commit in: sci-libs/datasets/files/ Alfredo Tupone
2024-02-21  7:24 Alfredo Tupone
2025-03-07 10:02 Alfredo Tupone

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1683574293.e2df99959623331aa3710cc48992e783cb9f5985.tupone@gentoo \
    --to=tupone@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox