diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..3dcbd965 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,23 @@ +name: Build + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + docs: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r docs/requirements.txt + - name: Build documentation + run: | + cd docs + make html diff --git a/.github/workflows/run-tests.yml b/.github/workflows/test.yml similarity index 61% rename from .github/workflows/run-tests.yml rename to .github/workflows/test.yml index dc0d322e..66cb211b 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/test.yml @@ -1,7 +1,5 @@ -# Link repository with GitHub Actions -# https://docs.github.com/en/actions/learn-github-actions/introduction-to-github-actions +name: Test -name: run-tests on: push: branches: @@ -10,30 +8,38 @@ on: branches: - main -# Set the language, install dependencies, and run the tests +env: + NPY_PROMOTION_STATE: weak_and_warn + jobs: - build: - runs-on: ${{ matrix.os }} + test: + name: Python ${{ matrix.python-version }} / ${{ matrix.os }} / ${{ matrix.numpy }} strategy: + fail-fast: false matrix: os: [windows-latest, ubuntu-latest, macos-latest] - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + numpy: ["numpy"] + include: + - os: ubuntu-latest + python-version: "3.9" + numpy: "numpy==1.26.4" + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - name: Setup uv - uses: astral-sh/setup-uv@v3 + - uses: astral-sh/setup-uv@v3 - name: Install Python ${{ matrix.python-version }} run: uv python install ${{ matrix.python-version }} - name: Install libsndfile if: startsWith(matrix.os, 'ubuntu') - run: | - sudo apt-get install -y libsndfile1 + run: sudo apt-get install -y libsndfile1 - name: Run tests - run: uv run --extra dev pytest - - name: Check source code format + run: uv run --with ${{ matrix.numpy }} --extra dev pytest + - name: Check style run: uv run --extra dev black --check --diff . test-deb10-i386: + name: Python 3.7 on Debian 10 i386 runs-on: ubuntu-latest container: i386/debian:10 steps: @@ -49,26 +55,11 @@ jobs: python3-soundfile \ python3-pytest \ git - + python3 --version # Note: "actions/checkout@v2" requires libstdc++6:amd64 to be # installed in the container. To keep things simple, use # "actions/checkout@v1" instead. # https://github.com/actions/checkout/issues/334 - uses: actions/checkout@v1 - - name: Run tests - run: | - pytest-3 - - build-documentation: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r docs/requirements.txt - - name: Build documentation - run: | - cd docs - make html + run: pytest-3 diff --git a/.readthedocs.yml b/.readthedocs.yml index 9fedd977..7d45d867 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -5,7 +5,7 @@ version: 2 build: os: "ubuntu-20.04" tools: - python: "3.9" + python: "3.10" # Build from the docs/ directory with Sphinx sphinx: diff --git a/pyproject.toml b/pyproject.toml index 09fbdad9..f550ebd7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,11 +8,11 @@ description = "The WFDB Python package: tools for reading, writing, and processi authors = [{name = "The Laboratory for Computational Physiology", email = "contact@physionet.org"}] license = {text = "MIT License"} readme = "README.md" -requires-python = ">= 3.8" +requires-python = ">= 3.9" dependencies = [ - "numpy >= 1.10.1, < 2.0.0", - "scipy >= 1.0.0", - "pandas >= 1.3.0", + "numpy >= 1.26.4", + "scipy >= 1.13.0", + "pandas >= 2.2.3", "soundfile >= 0.10.0", "matplotlib >= 3.2.2", "requests >= 2.8.1", @@ -35,7 +35,7 @@ documentation = "https://wfdb.readthedocs.io/" [tool.black] line-length = 80 -target-version = ['py37'] +target-version = ["py39"] [tool.hatch.build.targets.sdist] exclude = [ diff --git a/wfdb/processing/peaks.py b/wfdb/processing/peaks.py index dd276950..47d7ce48 100644 --- a/wfdb/processing/peaks.py +++ b/wfdb/processing/peaks.py @@ -4,7 +4,7 @@ def find_peaks(sig): - """ + r""" Find hard peaks and soft peaks in a signal, defined as follows: - Hard peak: a peak that is either /\ or \/.