-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix missing tqdm dependency for cli test (#81)
* add simple cli workflow * add tqdm, rename test * update version * add averagemeter and earlystopping tests * remove 3.6 from unit tests (keeping cli test 3.6)
- Loading branch information
Showing
4 changed files
with
57 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: UMX | ||
# thanks for @mpariente for copying this workflow | ||
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows | ||
# Trigger the workflow on push or pull request | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
src-test: | ||
name: separation test | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.6, 3.7, 3.8, 3.9] | ||
|
||
# Timeout: https://stackoverflow.com/a/59076067/4521646 | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install libnsdfile, ffmpeg and sox | ||
run: | | ||
sudo apt update | ||
sudo apt install libsndfile1-dev libsndfile1 ffmpeg sox | ||
- name: Install package dependencies | ||
run: | | ||
python -m pip install --upgrade --user pip --quiet | ||
python -m pip install .["stempeg"] | ||
python --version | ||
pip --version | ||
python -m pip list | ||
- name: CLI tests | ||
run: | | ||
umx https://samples.ffmpeg.org/A-codecs/wavpcm/test-96.wav --audio-backend stempeg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from openunmix.utils import AverageMeter, EarlyStopping | ||
|
||
|
||
def test_average_meter(): | ||
losses = AverageMeter() | ||
losses.update(1.0) | ||
losses.update(3.0) | ||
assert losses.avg == 2.0 | ||
|
||
|
||
def test_early_stopping(): | ||
es = EarlyStopping(patience=2) | ||
es.step(1.0) | ||
|
||
assert not es.step(0.5) | ||
assert not es.step(0.6) | ||
assert es.step(0.7) |