From 1db1ccfeee49d5e1befb96b35b804ae0ec0f750e Mon Sep 17 00:00:00 2001 From: Edwin Onuonga Date: Sat, 17 Apr 2021 14:44:30 +0400 Subject: [PATCH 1/5] [patch:test] Remove platform-dependent torch installation (#1) * Remove platform-dependent torch installation * Gix dataset transforms tests * Remove keyword arguments test --- lib/test/requirements.txt | 9 +++------ lib/test/test_dataset.py | 20 ++++++++------------ 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/lib/test/requirements.txt b/lib/test/requirements.txt index ab5e23c..9356259 100644 --- a/lib/test/requirements.txt +++ b/lib/test/requirements.txt @@ -1,8 +1,5 @@ --find-links https://download.pytorch.org/whl/torch_stable.html -torch==1.6.0+cpu; sys_platform == 'linux' -torch==1.6.0; sys_platform == 'darwin' -torchaudio==0.6.0+cpu; sys_platform == 'linux' -torchaudio==0.6.0; sys_platform == 'darwin' -torchvision==0.7.0+cpu; sys_platform == 'linux' -torchvision==0.7.0; sys_platform == 'darwin' +torch==1.6.0 +torchaudio==0.6.0 +torchvision==0.7.0 pytest==6.2.3 \ No newline at end of file diff --git a/lib/test/test_dataset.py b/lib/test/test_dataset.py index ea0b260..7335db5 100644 --- a/lib/test/test_dataset.py +++ b/lib/test/test_dataset.py @@ -250,15 +250,17 @@ def test_generator_train_val_test_split_17_50_33(): assert len(test) == 960 def test_dataset_no_transforms(): + """Note: This test may fail if not on Linux.""" fsdd = TorchFSDD(glob.glob('lib/test/data/v1.0.10/*.wav')) x, y = fsdd[0] assert isinstance(x, torch.Tensor) assert x.ndim == 1 assert x.min() >= -1 assert x.max() <= 1 - assert y == 5 + assert y == 7 def test_dataset_transforms_single(): + """Note: This test may fail if not on Linux.""" files = glob.glob('lib/test/data/v1.0.10/*.wav') x_original, y = TorchFSDD(files)[0] x_trans, _ = TorchFSDD(files, transforms=TrimSilence(threshold=0.1))[0] @@ -267,9 +269,10 @@ def test_dataset_transforms_single(): assert x_trans.min() >= -1 assert x_trans.max() <= 1 assert len(x_original) != len(x_trans) - assert y == 5 + assert y == 7 def test_dataset_transforms_multiple(): + """Note: This test may fail if not on Linux.""" n_mfcc = 13 files = glob.glob('lib/test/data/v1.0.10/*.wav') x_original, y = TorchFSDD(files)[0] @@ -279,8 +282,8 @@ def test_dataset_transforms_multiple(): ]))[0] assert isinstance(x_trans, torch.Tensor) assert x_trans.ndim == 2 - assert x_trans.shape == (n_mfcc, 12) - assert y == 5 + assert x_trans.shape == (n_mfcc, 9) + assert y == 7 def test_dataset_load_all_false(): files = glob.glob('lib/test/data/v1.0.10/*.wav') @@ -298,11 +301,4 @@ def test_dataset_load_all_true(): assert hasattr(fsdd, 'labels') assert isinstance(fsdd.labels, list) assert isinstance(fsdd.labels[0], int) - assert len(fsdd.labels) == len(files) - -def test_dataset_args(): - offset = 100 - files = glob.glob('lib/test/data/v1.0.10/*.wav') - x1, _ = TorchFSDD(files)[0] - x2, _ = TorchFSDD(files, offset=offset)[0] - assert torch.eq(x2, x1[100:]).all() \ No newline at end of file + assert len(fsdd.labels) == len(files) \ No newline at end of file From 8426bce03cd9410de34cdb6e140f386ae52bfeef Mon Sep 17 00:00:00 2001 From: Edwin Onuonga Date: Sat, 17 Apr 2021 14:58:44 +0400 Subject: [PATCH 2/5] [patch:lib] Upgrade minimum torch version to v1.8 (#3) --- README.md | 4 ++-- lib/test/requirements.txt | 6 +++--- lib/torchfsdd/__init__.py | 6 +++--- notebooks/requirements.txt | 12 ++++++------ setup.py | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 34acef8..46e7316 100644 --- a/README.md +++ b/README.md @@ -69,8 +69,8 @@ pip install torchfsdd **Note**: TorchFSDD assumes you have the following packages already installed (along with Python v3.6+). -- [`torch`](https://github.com/pytorch/audio) (>= 1.6.0) -- [`torchaudio`](https://github.com/pytorch/pytorch) (>= 0.6.0) +- [`torch`](https://github.com/pytorch/audio) (>= 1.8.0) +- [`torchaudio`](https://github.com/pytorch/pytorch) (>= 0.8.0) Since there are many different possible configurations when installing PyTorch (e.g. CPU or GPU, CUDA version), we leave this up to the user instead of specifying particular binaries to install alongside TorchFSDD. diff --git a/lib/test/requirements.txt b/lib/test/requirements.txt index 9356259..fba1c74 100644 --- a/lib/test/requirements.txt +++ b/lib/test/requirements.txt @@ -1,5 +1,5 @@ --find-links https://download.pytorch.org/whl/torch_stable.html -torch==1.6.0 -torchaudio==0.6.0 -torchvision==0.7.0 +torch==1.8.0 +torchaudio==0.8.0 +torchvision==0.9.0 pytest==6.2.3 \ No newline at end of file diff --git a/lib/torchfsdd/__init__.py b/lib/torchfsdd/__init__.py index a7ff36c..1eb068a 100644 --- a/lib/torchfsdd/__init__.py +++ b/lib/torchfsdd/__init__.py @@ -7,8 +7,8 @@ else: from importlib import metadata -MIN_TORCH_VERSION = '1.6' -MIN_TORCHAUDIO_VERSION = '0.6' +MIN_TORCH_VERSION = '1.8' +MIN_TORCHAUDIO_VERSION = '0.8' def check_package(pkg, min_version, url): """Checks whether a specified package has been installed, @@ -20,7 +20,7 @@ def check_package(pkg, min_version, url): Name of the package. min_version: str - Minimum version for the package, e.g. `1.6`. + Minimum version for the package, e.g. `1.8`. url: str Package installation page URL (for help). diff --git a/notebooks/requirements.txt b/notebooks/requirements.txt index ba2df7b..5dd54e5 100644 --- a/notebooks/requirements.txt +++ b/notebooks/requirements.txt @@ -1,10 +1,10 @@ --find-links https://download.pytorch.org/whl/torch_stable.html -torch==1.6.0+cpu; sys_platform == 'linux' -torch==1.6.0; sys_platform == 'darwin' -torchaudio==0.6.0+cpu; sys_platform == 'linux' -torchaudio==0.6.0; sys_platform == 'darwin' -torchvision==0.7.0+cpu; sys_platform == 'linux' -torchvision==0.7.0; sys_platform == 'darwin' +torch==1.8.0+cpu; sys_platform == 'linux' +torch==1.8.0; sys_platform == 'darwin' +torchaudio==0.8.0+cpu; sys_platform == 'linux' +torchaudio==0.8.0; sys_platform == 'darwin' +torchvision==0.9.0+cpu; sys_platform == 'linux' +torchvision==0.9.0; sys_platform == 'darwin' jupyter matplotlib tqdm diff --git a/setup.py b/setup.py index 142b57e..74a39b1 100644 --- a/setup.py +++ b/setup.py @@ -47,5 +47,5 @@ ], python_requires = '>=3.6', install_requires = install_requires, - extra_requires = {'torch': ['torch>=1.6+cpu', 'torchaudio>=0.6+cpu']} + extra_requires = {'torch': ['torch>=1.8+cpu', 'torchaudio>=0.8+cpu']} ) \ No newline at end of file From 946844c891ba473047970f20e1923ad41d00f926 Mon Sep 17 00:00:00 2001 From: Edwin Onuonga Date: Sat, 17 Apr 2021 15:42:18 +0400 Subject: [PATCH 3/5] [patch:docs] Add torch dependencies to docs/requirements.txt (#4) * Add torch dependencies to docs/requirements.txt * Use newer torch version --- docs/requirements.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/requirements.txt b/docs/requirements.txt index d9e7071..519ade0 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1 +1,3 @@ +torch==1.8.0 +torchaudio==0.8.0 sphinx==3.5.4 \ No newline at end of file From 3365ef0fd28268189b570f14515bd5172d52629a Mon Sep 17 00:00:00 2001 From: Edwin Onuonga Date: Sat, 17 Apr 2021 16:02:12 +0400 Subject: [PATCH 4/5] [patch:docs] Move Travis badges to separate README.md section (#2) * Move travis badges to README section * Update RTD badge --- README.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 46e7316..9a81f2d 100644 --- a/README.md +++ b/README.md @@ -16,11 +16,8 @@ PyPI - License - - Read The Docs - Documentation - - - Travis - Build + + Read The Docs - Documentation

@@ -33,6 +30,12 @@ The data set can be though of as an audio version of the popular [MNIST data set Models based on recurrent neural networks that can be implemented in PyTorch are a common approach for this task, and TorchFSDD aims to provide an interface to FSDD for such neural networks in PyTorch, by providing a [`torch.utils.data.Dataset`](https://pytorch.org/docs/stable/data.html#torch.utils.data.Dataset) wrapper that is ready to be used with a [`torch.utils.data.DataLoader`](https://pytorch.org/docs/stable/data.html#torch.utils.data.DataLoader). +## Build status + +| `master` | `dev` | +| -------- | ------| +| [![Travis Build (Master)](https://img.shields.io/travis/com/eonu/torch-fsdd?logo=travis&style=flat-square)](https://travis-ci.com/github/eonu/torch-fsdd) | [![Travis Build (Development)](https://img.shields.io/travis/com/eonu/torch-fsdd/dev?logo=travis&style=flat-square)](https://travis-ci.com/github/eonu/torch-fsdd) | + ## Examples ```python From 133b151ae028d3c1bbde29d532caa15052d17c87 Mon Sep 17 00:00:00 2001 From: Edwin Onuonga Date: Sat, 17 Apr 2021 16:47:21 +0400 Subject: [PATCH 5/5] =?UTF-8?q?[release]=200.1.1=20=F0=9F=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 17 ++++++++++++++++- lib/torchfsdd/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ad532b..c924d66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ +## [0.1.1](https://github.com/eonu/torch-fsdd/releases/tag/v0.1.1) + +### Major changes + +- Add `torch` and `torchaudio` dependencies to `docs/requirements.txt`. ([#4](https://github.com/eonu/torch-fsdd/pull/4)) +- Upgrade minimum package dependency versions: ([#3](https://github.com/eonu/torch-fsdd/pull/3)) + - `torch` (>= 1.8) + - `torchaudio` (>= 0.8) + - `torchvision` (>= 0.9) - only used in tests and notebooks + +### Minor changes + +- Remove platform-dependent `torch`, `torchaudio` and `torchvision` installation for tests. ([#1](https://github.com/eonu/torch-fsdd/pull/1)) +- Move Travis badges to separate `README.md` section. ([#2](https://github.com/eonu/torch-fsdd/pull/2)) + ## [0.1.0](https://github.com/eonu/torch-fsdd/releases/tag/v0.1.0) -#### Major changes +### Major changes Nothing, initial release! \ No newline at end of file diff --git a/lib/torchfsdd/__init__.py b/lib/torchfsdd/__init__.py index 1eb068a..c7300d6 100644 --- a/lib/torchfsdd/__init__.py +++ b/lib/torchfsdd/__init__.py @@ -1,4 +1,4 @@ -__version__ = '0.1.0' +__version__ = '0.1.1' import importlib, platform from pkg_resources import packaging diff --git a/setup.py b/setup.py index 74a39b1..3bb6c89 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from pkg_resources import packaging from setuptools import setup, find_packages -VERSION = '0.1.0' +VERSION = '0.1.1' with open('README.md', 'r', encoding='utf8') as fh: long_description = fh.read()