From 9112c20da06b7ca4781e6a5da1141cfa1423acdc Mon Sep 17 00:00:00 2001 From: Stefan Balke Date: Thu, 8 May 2025 15:37:28 +0200 Subject: [PATCH 1/3] update workflow --- .github/workflows/test_pip.yml | 49 ++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/.github/workflows/test_pip.yml b/.github/workflows/test_pip.yml index b52da37..50a541b 100644 --- a/.github/workflows/test_pip.yml +++ b/.github/workflows/test_pip.yml @@ -1,6 +1,3 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - name: build on: @@ -11,37 +8,55 @@ on: jobs: build: - runs-on: ubuntu-latest strategy: fail-fast: false matrix: - python-version: [3.7, 3.8, 3.9] + python-version: [3.7, 3.8, 3.9, 3.10, 3.11] steps: - - uses: actions/checkout@v2 + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Install libnsdfile + + - name: Install system dependencies run: | - sudo apt update - sudo apt install libsndfile1-dev libsndfile1 - - name: Install dependencies + sudo apt-get update + sudo apt-get install -y libsndfile1-dev libsndfile1 + + - name: Cache pip + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml', '**/setup.cfg', '**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: Install Python dependencies run: | python -m pip install --upgrade pip - python -m pip install flake8 - python -m pip install -e .['tests'] + pip install flake8 + pip install -e '.[tests]' python --version pip --version - python -m pip list + pip list + - name: Lint with flake8 run: | - # stop the build if there are Python syntax errors or undefined names + echo "::group::Strict lint (fail on syntax errors)" flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + echo "::endgroup::" + + echo "::group::Full lint report" flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest + echo "::endgroup::" + + - name: Run tests with pytest run: | pytest + pip install pytest-cov + pytest --cov=your_package_name tests/ From a09d4006a8f39d943c48e629e6c1b47a48da23bc Mon Sep 17 00:00:00 2001 From: Stefan Balke Date: Thu, 8 May 2025 15:42:45 +0200 Subject: [PATCH 2/3] update readme --- README.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 915cf6f..a0c99f8 100644 --- a/README.md +++ b/README.md @@ -4,31 +4,42 @@ # libf0 -This repository contains a Python package called libf0 which provides open-source implementations for four popular model-based F0-estimation approaches, YIN (Cheveigné & Kawahara, 2002), pYIN (Mauch & Dixon, 2014), an approach inspired by Melodia (Salamon & Gómez, 2012), and SWIPE (Camacho & Harris, 2008). +This repository contains a Python package called libf0 which provides open-source implementations for four popular model-based F0-estimation approaches, YIN (Cheveigné & Kawahara, 2002), pYIN (Mauch & Dixon, 2014), an approach inspired by Melodia (Salamon & Gómez, 2012), and SWIPE (Camacho & Harris, 2008). If you use the libf0 in your research, please consider the following references. ## References +```bibtex Sebastian Rosenzweig, Simon Schwär, and Meinard Müller. [libf0: A Python Library for Fundamental Frequency Estimation.](https://archives.ismir.net/ismir2022/latebreaking/000003.pdf) In Late Breaking Demos of the International Society for Music Information Retrieval Conference (ISMIR), Bengaluru, India, 2022. +``` +```bibtex Alain de Cheveigné and Hideki Kawahara. YIN, a fundamental frequency estimator for speech and music. Journal of the Acoustical Society of America (JASA), 111(4):1917–1930, 2002. +``` +```bibtex Matthias Mauch and Simon Dixon. pYIN: A fundamental frequency estimator using probabilistic threshold distributions. In IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 659–663, Florence, Italy, 2014. +``` +```bibtex Justin Salamon and Emilia Gómez. Melody extraction from polyphonic music signals using pitch contour characteristics. IEEE Transactions on Audio, Speech, and Language Processing, 20(6): 1759–1770, 2012. +``` +```bibtex Arturo Camacho and John G. Harris. A sawtooth waveform inspired pitch estimator for speech and music. The Journal of the Acoustical Society of America, 124(3):1638–1652, 2008. +``` +```bibtex Meinard Müller. Fundamentals of Music Processing – Using Python and Jupyter Notebooks. Springer Verlag, 2nd edition, 2021. ISBN 978-3-030-69807-2. doi: 10.1007/978-3-030-69808-9. - +``` ## Installing @@ -66,7 +77,7 @@ https://groupmm.github.io/libf0 ## Contributing -We are happy for suggestions and contributions. We would be grateful for either directly contacting us via email (meinard.mueller@audiolabs-erlangen.de) or for creating an issue in our Github repository. Please do not submit a pull request without prior consultation with us. +We are happy for suggestions and contributions. We would be grateful for either directly contacting us via email (meinard.mueller@audiolabs-erlangen.de) or for creating an issue in our GitHub repository. Please do not submit a pull request without prior consultation with us. ## Tests From de23a46781245d2793f9dd48372ba34539c4ce89 Mon Sep 17 00:00:00 2001 From: Stefan Balke Date: Thu, 8 May 2025 15:46:16 +0200 Subject: [PATCH 3/3] ditch 3.7 --- .github/workflows/test_pip.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_pip.yml b/.github/workflows/test_pip.yml index 50a541b..39cafcc 100644 --- a/.github/workflows/test_pip.yml +++ b/.github/workflows/test_pip.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.7, 3.8, 3.9, 3.10, 3.11] + python-version: [3.8, 3.9, 3.10, 3.11] steps: - name: Checkout code