From 86e5fec1638853ab440228338add4a71a8a90a0a Mon Sep 17 00:00:00 2001 From: LeonieBorne Date: Thu, 29 Jun 2023 11:44:09 +0200 Subject: [PATCH 1/9] limit pytorch-lightning to 1.x versions --- requirements/install.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/install.txt b/requirements/install.txt index 92cbcff52..5a61830aa 100644 --- a/requirements/install.txt +++ b/requirements/install.txt @@ -2,7 +2,7 @@ -r ./torchhub.txt PyYAML>=5.0 pandas>=0.23.4 -pytorch-lightning>=1.5.0 +pytorch-lightning>=1.5.0,<2.0.0 torchaudio>=0.8.0 pb_bss_eval>=0.0.2 torch_stoi>=0.0.1 From 726ca16f168ddfd17ebbdf035931987f47c54d38 Mon Sep 17 00:00:00 2001 From: LeonieBorne Date: Thu, 29 Jun 2023 12:07:07 +0200 Subject: [PATCH 2/9] torch<2.0.0 + add limit in setup.py --- requirements/install.txt | 2 +- requirements/torchhub.txt | 2 +- setup.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/requirements/install.txt b/requirements/install.txt index 5a61830aa..568d9c3f3 100644 --- a/requirements/install.txt +++ b/requirements/install.txt @@ -2,7 +2,7 @@ -r ./torchhub.txt PyYAML>=5.0 pandas>=0.23.4 -pytorch-lightning>=1.5.0,<2.0.0 +pytorch-lightning>=1.5.0,<2.0.0 torchaudio>=0.8.0 pb_bss_eval>=0.0.2 torch_stoi>=0.0.1 diff --git a/requirements/torchhub.txt b/requirements/torchhub.txt index 88bf49b88..00e0ddbfc 100644 --- a/requirements/torchhub.txt +++ b/requirements/torchhub.txt @@ -2,7 +2,7 @@ # Note that Asteroid itself is not required to be installed. numpy>=1.16.4 scipy>=1.1.0 -torch>=1.8.0 +torch>=1.8.0,<2.0.0 asteroid-filterbanks>=0.4.0 requests filelock diff --git a/setup.py b/setup.py index 4501822a9..2c77772b1 100644 --- a/setup.py +++ b/setup.py @@ -39,14 +39,14 @@ def find_version(*file_paths): # From requirements/torchhub.txt "numpy>=1.16.4", "scipy>=1.1.0", - "torch>=1.8.0", + "torch>=1.8.0,<2.0.0", "asteroid-filterbanks>=0.4.0", "SoundFile>=0.10.2", "huggingface_hub>=0.0.2", # From requirements/install.txt "PyYAML>=5.0", "pandas>=0.23.4", - "pytorch-lightning>=1.5.0", + "pytorch-lightning>=1.5.0,<2.0.0", "torchaudio>=0.5.0", "pb_bss_eval>=0.0.2", "torch_stoi>=0.1.2", From 004b411ddbbca90af22c4190dc00a9f4350709a7 Mon Sep 17 00:00:00 2001 From: LeonieBorne Date: Wed, 5 Jul 2023 15:49:04 +0200 Subject: [PATCH 3/9] replace py.test by pytest --- .github/workflows/test_asteroid_package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_asteroid_package.yml b/.github/workflows/test_asteroid_package.yml index 7cbe7c7a9..c860083a6 100644 --- a/.github/workflows/test_asteroid_package.yml +++ b/.github/workflows/test_asteroid_package.yml @@ -47,14 +47,14 @@ jobs: - name: Source code tests run: | - coverage run -a -m py.test tests --ignore tests/models/publish_test.py + coverage run -a -m pytest tests --ignore tests/models/publish_test.py chmod +x ./tests/cli_test.sh ./tests/cli_test.sh # This tends to fail despite the code works, when Zenodo is slow. - name: Model-sharing tests run: | - coverage run -a -m py.test tests/models/publish_test.py + coverage run -a -m pytest tests/models/publish_test.py env: ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} From 27593e93f7c823d7ed0be2b44aedde7f9093bb01 Mon Sep 17 00:00:00 2001 From: LeonieBorne Date: Wed, 5 Jul 2023 15:56:10 +0200 Subject: [PATCH 4/9] move flake8 ignore comments --- .flake8 | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.flake8 b/.flake8 index 2590a183e..2bb811b6b 100644 --- a/.flake8 +++ b/.flake8 @@ -6,8 +6,13 @@ verbose = 2 # https://pep8.readthedocs.io/en/latest/intro.html#error-codes format = pylint ignore = - E731 # E731 - Do not assign a lambda expression, use a def - W605 # W605 - invalid escape sequence '\_'. Needed for docs - W504 # W504 - line break after binary operator - W503 # W503 - line break before binary operator, need for black - E203 # E203 - whitespace before ':'. Opposite convention enforced by black + # E731 - Do not assign a lambda expression, use a def + E731 + # W605 - invalid escape sequence '\_'. Needed for docs + W605 + # W504 - line break after binary operator + W504 + # W503 - line break before binary operator, need for black + W503 + # E203 - whitespace before ':'. Opposite convention enforced by black + E203 From d88979477b69ae927e46e363bcb38eedceda6988 Mon Sep 17 00:00:00 2001 From: LeonieBorne Date: Wed, 5 Jul 2023 16:28:42 +0200 Subject: [PATCH 5/9] scipy.signal.get_window(window=hanning) not supported in scipy v1.10.1, replaced by hann --- asteroid/dsp/overlap_add.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asteroid/dsp/overlap_add.py b/asteroid/dsp/overlap_add.py index 7ba624f2f..256b43bc5 100644 --- a/asteroid/dsp/overlap_add.py +++ b/asteroid/dsp/overlap_add.py @@ -55,7 +55,7 @@ def __init__( n_src, window_size, hop_size=None, - window="hanning", + window="hann", reorder_chunks=True, enable_grad=False, ): From fe83b2c0d5e48c9faa973ee8968c3a14d74247a5 Mon Sep 17 00:00:00 2001 From: LeonieBorne Date: Wed, 5 Jul 2023 16:48:19 +0200 Subject: [PATCH 6/9] scipy>=1.10.1 --- requirements/torchhub.txt | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements/torchhub.txt b/requirements/torchhub.txt index 00e0ddbfc..c6cd82628 100644 --- a/requirements/torchhub.txt +++ b/requirements/torchhub.txt @@ -1,7 +1,7 @@ # Minimal set of requirements required to be able to run Asteroid models from Torch Hub. # Note that Asteroid itself is not required to be installed. numpy>=1.16.4 -scipy>=1.1.0 +scipy>=1.10.1 torch>=1.8.0,<2.0.0 asteroid-filterbanks>=0.4.0 requests diff --git a/setup.py b/setup.py index 2c77772b1..0ac895729 100644 --- a/setup.py +++ b/setup.py @@ -38,7 +38,7 @@ def find_version(*file_paths): install_requires=[ # From requirements/torchhub.txt "numpy>=1.16.4", - "scipy>=1.1.0", + "scipy>=1.10.1", "torch>=1.8.0,<2.0.0", "asteroid-filterbanks>=0.4.0", "SoundFile>=0.10.2", From 38b7038b121e17470b2a688cb0c5383d6f73ebe7 Mon Sep 17 00:00:00 2001 From: LeonieBorne Date: Wed, 5 Jul 2023 17:04:47 +0200 Subject: [PATCH 7/9] pytorch-lightning<=1.7.7 because Callback.on_epoch_start hook was removed in v1.8 --- requirements/install.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements/install.txt b/requirements/install.txt index 568d9c3f3..ab521c439 100644 --- a/requirements/install.txt +++ b/requirements/install.txt @@ -2,7 +2,8 @@ -r ./torchhub.txt PyYAML>=5.0 pandas>=0.23.4 -pytorch-lightning>=1.5.0,<2.0.0 +pytorch-lightning>=1.5.0,<=1.7.7 +torchmetrics<=0.11.4 torchaudio>=0.8.0 pb_bss_eval>=0.0.2 torch_stoi>=0.0.1 From 16910929359233bdb15bd4c78635e0a44d0bfd1b Mon Sep 17 00:00:00 2001 From: LeonieBorne Date: Wed, 5 Jul 2023 17:07:32 +0200 Subject: [PATCH 8/9] use window=hann instead of hanning in the unit tests --- tests/dsp/overlap_add_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/dsp/overlap_add_test.py b/tests/dsp/overlap_add_test.py index fc43f38ff..18572f78a 100644 --- a/tests/dsp/overlap_add_test.py +++ b/tests/dsp/overlap_add_test.py @@ -8,7 +8,7 @@ @pytest.mark.parametrize("length", [1390, 8372]) @pytest.mark.parametrize("batch_size", [1, 2]) @pytest.mark.parametrize("n_src", [1, 2]) -@pytest.mark.parametrize("window", ["hanning", None]) +@pytest.mark.parametrize("window", ["hann", None]) @pytest.mark.parametrize("window_size", [128]) @pytest.mark.parametrize("hop_size", [64]) def test_overlap_add(length, batch_size, n_src, window, window_size, hop_size): From f72e80cb6cfb98579fcac72e1c052cf3d538a759 Mon Sep 17 00:00:00 2001 From: LeonieBorne Date: Wed, 5 Jul 2023 17:11:05 +0200 Subject: [PATCH 9/9] pytorch-lightning<=1.7.7 in setup.py --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 0ac895729..0b287c21c 100644 --- a/setup.py +++ b/setup.py @@ -46,7 +46,8 @@ def find_version(*file_paths): # From requirements/install.txt "PyYAML>=5.0", "pandas>=0.23.4", - "pytorch-lightning>=1.5.0,<2.0.0", + "pytorch-lightning>=1.5.0,<=1.7.7", + "torchmetrics<=0.11.4", "torchaudio>=0.5.0", "pb_bss_eval>=0.0.2", "torch_stoi>=0.1.2",