From 67ff5ff860e1630b4c8b6ad657254c1615c11095 Mon Sep 17 00:00:00 2001 From: Hiroshi Nishijima Date: Mon, 24 Jun 2024 16:32:32 +0900 Subject: [PATCH 01/10] fix the requirement version of numpy --- pyproject.toml | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e2999ca..9ba1972 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = [ "wheel", "setuptools", "cython>=0.21.0", - "numpy>=v1.20.0", + "numpy>=v1.20.0, <=1.26.4", "scipy", ] diff --git a/setup.py b/setup.py index 79b894d..17632d7 100644 --- a/setup.py +++ b/setup.py @@ -157,7 +157,7 @@ def package_files(directory): package_data={"": package_data}, ext_modules=ext_modules, cmdclass=cmdclass, - setup_requires=["numpy >= 1.20.0"], + setup_requires=["numpy >= 1.20.0, <=1.26.4"], install_requires=install_requires, tests_require=["nose", "coverage"], extras_require={ From d4479ba343ebc799cfeb06cf989066c0ac8e7ca3 Mon Sep 17 00:00:00 2001 From: Ryuichi Yamamoto Date: Tue, 25 Jun 2024 12:06:43 +0900 Subject: [PATCH 02/10] Update ci.yaml --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ad175c9..ea7d076 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -37,7 +37,7 @@ jobs: with: submodules: true - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install OS dependencies From f70ba0fb7b7248096516e3d2457117fbdb2b89e3 Mon Sep 17 00:00:00 2001 From: decfrr Date: Tue, 25 Jun 2024 13:10:37 +0900 Subject: [PATCH 03/10] change version designation from less than to equal to --- pyproject.toml | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9ba1972..7f10099 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = [ "wheel", "setuptools", "cython>=0.21.0", - "numpy>=v1.20.0, <=1.26.4", + "numpy>=v1.20.0, <2", "scipy", ] diff --git a/setup.py b/setup.py index 17632d7..dea68bd 100644 --- a/setup.py +++ b/setup.py @@ -157,7 +157,7 @@ def package_files(directory): package_data={"": package_data}, ext_modules=ext_modules, cmdclass=cmdclass, - setup_requires=["numpy >= 1.20.0, <=1.26.4"], + setup_requires=["numpy >= 1.20.0, <2"], install_requires=install_requires, tests_require=["nose", "coverage"], extras_require={ From 918b16172c1839cc89a30095720154385a97f312 Mon Sep 17 00:00:00 2001 From: decfrr Date: Tue, 25 Jun 2024 21:33:51 +0900 Subject: [PATCH 04/10] use install_requires instead of setup_requires for numpy --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index dea68bd..b2f525d 100644 --- a/setup.py +++ b/setup.py @@ -141,6 +141,7 @@ def package_files(directory): "scikit-learn", "pysptk >= 0.1.17", "tqdm", + "numpy >= 1.20.0, <2", ] setup( @@ -157,7 +158,6 @@ def package_files(directory): package_data={"": package_data}, ext_modules=ext_modules, cmdclass=cmdclass, - setup_requires=["numpy >= 1.20.0, <2"], install_requires=install_requires, tests_require=["nose", "coverage"], extras_require={ From c8e6a5785a0035160ccd540ea07d0fc7abc9def2 Mon Sep 17 00:00:00 2001 From: decfrr Date: Tue, 25 Jun 2024 21:34:36 +0900 Subject: [PATCH 05/10] fix tests --- tests/test_datasets.py | 2 +- tests/test_preprocessing.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_datasets.py b/tests/test_datasets.py index 7cbd48a..1f41f13 100644 --- a/tests/test_datasets.py +++ b/tests/test_datasets.py @@ -72,7 +72,7 @@ def __test_wrong_num_collected_files(): X[0] yield raises(TypeError)(__test_wrong_num_args) - yield raises(RuntimeError)(__test_wrong_num_collected_files) + yield raises(ValueError)(__test_wrong_num_collected_files) @attr("pickle") diff --git a/tests/test_preprocessing.py b/tests/test_preprocessing.py index 4741cc9..e3bd5bc 100644 --- a/tests/test_preprocessing.py +++ b/tests/test_preprocessing.py @@ -124,7 +124,7 @@ def test_mulaw_real(): mu = 256 y = P.mulaw_quantize(x, mu) assert y.min() >= 0 and y.max() < mu - assert y.dtype == np.int + assert y.dtype == np x = P.inv_mulaw_quantize(y, mu) * 32768 assert x.dtype == np.float32 x = x.astype(np.int16) @@ -460,7 +460,7 @@ def test_dtw_aligner(): fs, x = wavfile.read(example_audio_file()) x = (x / 32768.0).astype(np.float32) assert fs == 16000 - x_fast = librosa.effects.time_stretch(x, 2.0) + x_fast = librosa.effects.time_stretch(x, rate=2.0) X = _get_mcep(x, fs) Y = _get_mcep(x_fast, fs) From c9fb7e5a0dfd737ae0eb19b99b286adca283c8d2 Mon Sep 17 00:00:00 2001 From: decfrr Date: Tue, 25 Jun 2024 21:37:22 +0900 Subject: [PATCH 06/10] fix typo --- tests/test_preprocessing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_preprocessing.py b/tests/test_preprocessing.py index e3bd5bc..4da89d9 100644 --- a/tests/test_preprocessing.py +++ b/tests/test_preprocessing.py @@ -124,7 +124,7 @@ def test_mulaw_real(): mu = 256 y = P.mulaw_quantize(x, mu) assert y.min() >= 0 and y.max() < mu - assert y.dtype == np + assert y.dtype == int x = P.inv_mulaw_quantize(y, mu) * 32768 assert x.dtype == np.float32 x = x.astype(np.int16) From e9a96b10dd8d03031604ff2c0e6a899a80d73d32 Mon Sep 17 00:00:00 2001 From: decfrr Date: Tue, 25 Jun 2024 21:46:00 +0900 Subject: [PATCH 07/10] fix deprecated field error --- nnmnkwii/preprocessing/alignment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nnmnkwii/preprocessing/alignment.py b/nnmnkwii/preprocessing/alignment.py index 6f21336..960a249 100644 --- a/nnmnkwii/preprocessing/alignment.py +++ b/nnmnkwii/preprocessing/alignment.py @@ -130,7 +130,7 @@ def transform(self, XY): Xc = X.copy() # this will be updated iteratively X_aligned = np.zeros_like(longer_features) Y_aligned = np.zeros_like(longer_features) - refined_paths = np.empty(len(X), dtype=np.object) + refined_paths = np.empty(len(X), dtype=object) for idx in range(self.n_iter): for idx, (x, y) in enumerate(zip(Xc, Y)): From cb11709dfa8affd806b9b7452902ce06e8b13051 Mon Sep 17 00:00:00 2001 From: Ryuichi Yamamoto Date: Tue, 25 Jun 2024 23:10:59 +0900 Subject: [PATCH 08/10] updates from 127 --- nnmnkwii/preprocessing/alignment.py | 2 +- pyproject.toml | 2 +- setup.py | 1 + tests/data/questions-radio_dnn_416.hed | 0 tests/test_datasets.py | 2 +- tests/test_preprocessing.py | 4 ++-- 6 files changed, 6 insertions(+), 5 deletions(-) mode change 100644 => 100755 tests/data/questions-radio_dnn_416.hed diff --git a/nnmnkwii/preprocessing/alignment.py b/nnmnkwii/preprocessing/alignment.py index 6f21336..960a249 100644 --- a/nnmnkwii/preprocessing/alignment.py +++ b/nnmnkwii/preprocessing/alignment.py @@ -130,7 +130,7 @@ def transform(self, XY): Xc = X.copy() # this will be updated iteratively X_aligned = np.zeros_like(longer_features) Y_aligned = np.zeros_like(longer_features) - refined_paths = np.empty(len(X), dtype=np.object) + refined_paths = np.empty(len(X), dtype=object) for idx in range(self.n_iter): for idx, (x, y) in enumerate(zip(Xc, Y)): diff --git a/pyproject.toml b/pyproject.toml index e2999ca..7ef0819 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = [ "wheel", "setuptools", "cython>=0.21.0", - "numpy>=v1.20.0", + "numpy>=v1.20.0, <2.0.0", "scipy", ] diff --git a/setup.py b/setup.py index 79b894d..0bbc1d3 100644 --- a/setup.py +++ b/setup.py @@ -141,6 +141,7 @@ def package_files(directory): "scikit-learn", "pysptk >= 0.1.17", "tqdm", + "numpy >= 1.20.0, <2.0.0", ] setup( diff --git a/tests/data/questions-radio_dnn_416.hed b/tests/data/questions-radio_dnn_416.hed old mode 100644 new mode 100755 diff --git a/tests/test_datasets.py b/tests/test_datasets.py index 7cbd48a..1f41f13 100644 --- a/tests/test_datasets.py +++ b/tests/test_datasets.py @@ -72,7 +72,7 @@ def __test_wrong_num_collected_files(): X[0] yield raises(TypeError)(__test_wrong_num_args) - yield raises(RuntimeError)(__test_wrong_num_collected_files) + yield raises(ValueError)(__test_wrong_num_collected_files) @attr("pickle") diff --git a/tests/test_preprocessing.py b/tests/test_preprocessing.py index 4741cc9..4da89d9 100644 --- a/tests/test_preprocessing.py +++ b/tests/test_preprocessing.py @@ -124,7 +124,7 @@ def test_mulaw_real(): mu = 256 y = P.mulaw_quantize(x, mu) assert y.min() >= 0 and y.max() < mu - assert y.dtype == np.int + assert y.dtype == int x = P.inv_mulaw_quantize(y, mu) * 32768 assert x.dtype == np.float32 x = x.astype(np.int16) @@ -460,7 +460,7 @@ def test_dtw_aligner(): fs, x = wavfile.read(example_audio_file()) x = (x / 32768.0).astype(np.float32) assert fs == 16000 - x_fast = librosa.effects.time_stretch(x, 2.0) + x_fast = librosa.effects.time_stretch(x, rate=2.0) X = _get_mcep(x, fs) Y = _get_mcep(x_fast, fs) From 907162ed95aeaafeab2422d0cc9bd290c1ea9505 Mon Sep 17 00:00:00 2001 From: Ryuichi Yamamoto Date: Tue, 25 Jun 2024 23:11:38 +0900 Subject: [PATCH 09/10] fix num_workers=0 to avoid any multiprocessing trouble --- tests/test_pack_pad_sequence.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_pack_pad_sequence.py b/tests/test_pack_pad_sequence.py index c7c405c..6e400cb 100644 --- a/tests/test_pack_pad_sequence.py +++ b/tests/test_pack_pad_sequence.py @@ -108,7 +108,7 @@ def test_pack_sequnce(): dataset = PyTorchDataset(X, Y, lengths) loader = data_utils.DataLoader( - dataset, batch_size=batch_size, num_workers=1, shuffle=True + dataset, batch_size=batch_size, num_workers=0, shuffle=True ) # Test if trining loop pass with no errors. The following code was adapted From 9ffbb90999c2ca4c302d4d4bcda291620cd0f248 Mon Sep 17 00:00:00 2001 From: Ryuichi Yamamoto Date: Tue, 25 Jun 2024 23:12:59 +0900 Subject: [PATCH 10/10] drop 3.7 --- .github/workflows/ci.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ea7d076..d52e5c7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,8 +18,6 @@ jobs: strategy: matrix: include: - - os: ubuntu-latest - python-version: 3.7 - os: ubuntu-latest python-version: 3.8 - os: ubuntu-latest