Skip to content

Commit

Permalink
workaround for numpy 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
r9y9 committed Jun 29, 2024
1 parent 3248a60 commit 2827731
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/test_preprocessing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import librosa
import numpy as np
import pysptk
import pytest
Expand All @@ -20,6 +19,7 @@
example_file_data_sources_for_acoustic_model,
example_file_data_sources_for_duration_model,
)
from packaging.version import Version
from scipy.io import wavfile


Expand Down Expand Up @@ -449,12 +449,18 @@ def test_dtw_frame_length_adjustment():
assert X_aligned.shape == Y_aligned.shape


@pytest.mark.skipif(
Version(np.__version__) >= Version("2.0.0"), reason="numpy >= 2.0.0"
)
def test_dtw_aligner():
from nnmnkwii.preprocessing.alignment import DTWAligner, IterativeDTWAligner

fs, x = wavfile.read(example_audio_file())
x = (x / 32768.0).astype(np.float32)
assert fs == 16000
# NOTE: librosa deps need to be updated for numpy 2.0.0
import librosa

x_fast = librosa.effects.time_stretch(x, rate=2.0)

X = _get_mcep(x, fs)
Expand Down

0 comments on commit 2827731

Please # to comment.