Skip to content

Commit

Permalink
workaround pyworld installation issue
Browse files Browse the repository at this point in the history
pyworld's bindary distribution does not support numpy 2.0.0. so runtime
errors will happen on windows if numpy 2.0.0 is used

workaaround this issue by skipping the tests using pyworld
  • Loading branch information
r9y9 committed Jun 29, 2024
1 parent a84ce2f commit e7e4de6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/test_preprocessing.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import numpy as np
import pysptk
import pytest
import pyworld
from nnmnkwii import preprocessing as P
from nnmnkwii.datasets import FileSourceDataset, PaddedFileSourceDataset
from nnmnkwii.preprocessing import (
Expand All @@ -22,6 +21,14 @@
from packaging.version import Version
from scipy.io import wavfile

try:
import pyworld

pyworld_available = True
except ValueError:
# ValueError: numpy.dtype size changed, may indicate binary incompatibility.
pyworld_available = False


def _get_windows_set_bandmat():
windows_set = [
Expand Down Expand Up @@ -271,6 +278,7 @@ def test_interp1d():
assert np.all(if0 != 0)


@pytest.mark.skipif(not pyworld_available, reason="pyworld is not available")
def test_trim_remove_zeros_frames():
fs, x = wavfile.read(example_audio_file())
frame_period = 5
Expand Down Expand Up @@ -452,6 +460,7 @@ def test_dtw_frame_length_adjustment():
@pytest.mark.skipif(
Version(np.__version__) >= Version("2.0.0"), reason="numpy >= 2.0.0"
)
@pytest.mark.skipif(not pyworld_available, reason="pyworld is not available")
def test_dtw_aligner():
from nnmnkwii.preprocessing.alignment import DTWAligner, IterativeDTWAligner

Expand Down

0 comments on commit e7e4de6

Please sign in to comment.