Skip to content

Commit ca9c7f3

Browse files
authored
Bump dependencies for NumPy 2 compatibility (#511)
All tests pass and `demo.ipynb` works without any errors or warnings using NumPy >= 2.
2 parents e5c6fe5 + ec5e24f commit ca9c7f3

File tree

5 files changed

+51
-37
lines changed

5 files changed

+51
-37
lines changed

.github/workflows/docs.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
docs:
13+
runs-on: ubuntu-20.04
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: Install dependencies
17+
run: |
18+
python -m pip install --upgrade pip
19+
pip install -r docs/requirements.txt
20+
- name: Build documentation
21+
run: |
22+
cd docs
23+
make html
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
# Link repository with GitHub Actions
2-
# https://docs.github.com/en/actions/learn-github-actions/introduction-to-github-actions
1+
name: Test
32

4-
name: run-tests
53
on:
64
push:
75
branches:
@@ -10,30 +8,38 @@ on:
108
branches:
119
- main
1210

13-
# Set the language, install dependencies, and run the tests
11+
env:
12+
NPY_PROMOTION_STATE: weak_and_warn
13+
1414
jobs:
15-
build:
16-
runs-on: ${{ matrix.os }}
15+
test:
16+
name: Python ${{ matrix.python-version }} / ${{ matrix.os }} / ${{ matrix.numpy }}
1717
strategy:
18+
fail-fast: false
1819
matrix:
1920
os: [windows-latest, ubuntu-latest, macos-latest]
20-
python-version: ["3.8", "3.9", "3.10", "3.11"]
21+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
22+
numpy: ["numpy"]
23+
include:
24+
- os: ubuntu-latest
25+
python-version: "3.9"
26+
numpy: "numpy==1.26.4"
27+
runs-on: ${{ matrix.os }}
2128
steps:
2229
- uses: actions/checkout@v4
23-
- name: Setup uv
24-
uses: astral-sh/setup-uv@v3
30+
- uses: astral-sh/setup-uv@v3
2531
- name: Install Python ${{ matrix.python-version }}
2632
run: uv python install ${{ matrix.python-version }}
2733
- name: Install libsndfile
2834
if: startsWith(matrix.os, 'ubuntu')
29-
run: |
30-
sudo apt-get install -y libsndfile1
35+
run: sudo apt-get install -y libsndfile1
3136
- name: Run tests
32-
run: uv run --extra dev pytest
33-
- name: Check source code format
37+
run: uv run --with ${{ matrix.numpy }} --extra dev pytest
38+
- name: Check style
3439
run: uv run --extra dev black --check --diff .
3540

3641
test-deb10-i386:
42+
name: Python 3.7 on Debian 10 i386
3743
runs-on: ubuntu-latest
3844
container: i386/debian:10
3945
steps:
@@ -49,26 +55,11 @@ jobs:
4955
python3-soundfile \
5056
python3-pytest \
5157
git
52-
58+
python3 --version
5359
# Note: "actions/checkout@v2" requires libstdc++6:amd64 to be
5460
# installed in the container. To keep things simple, use
5561
# "actions/checkout@v1" instead.
5662
# https://github.com/actions/checkout/issues/334
5763
- uses: actions/checkout@v1
58-
5964
- name: Run tests
60-
run: |
61-
pytest-3
62-
63-
build-documentation:
64-
runs-on: ubuntu-20.04
65-
steps:
66-
- uses: actions/checkout@v3
67-
- name: Install dependencies
68-
run: |
69-
python -m pip install --upgrade pip
70-
pip install -r docs/requirements.txt
71-
- name: Build documentation
72-
run: |
73-
cd docs
74-
make html
65+
run: pytest-3

.readthedocs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ version: 2
55
build:
66
os: "ubuntu-20.04"
77
tools:
8-
python: "3.9"
8+
python: "3.10"
99

1010
# Build from the docs/ directory with Sphinx
1111
sphinx:

pyproject.toml

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ description = "The WFDB Python package: tools for reading, writing, and processi
88
authors = [{name = "The Laboratory for Computational Physiology", email = "contact@physionet.org"}]
99
license = {text = "MIT License"}
1010
readme = "README.md"
11-
requires-python = ">= 3.8"
11+
requires-python = ">= 3.9"
1212
dependencies = [
13-
"numpy >= 1.10.1, < 2.0.0",
14-
"scipy >= 1.0.0",
15-
"pandas >= 1.3.0",
13+
"numpy >= 1.26.4",
14+
"scipy >= 1.13.0",
15+
"pandas >= 2.2.3",
1616
"soundfile >= 0.10.0",
1717
"matplotlib >= 3.2.2",
1818
"requests >= 2.8.1",
@@ -35,7 +35,7 @@ documentation = "https://wfdb.readthedocs.io/"
3535

3636
[tool.black]
3737
line-length = 80
38-
target-version = ['py37']
38+
target-version = ["py39"]
3939

4040
[tool.hatch.build.targets.sdist]
4141
exclude = [

wfdb/processing/peaks.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
def find_peaks(sig):
7-
"""
7+
r"""
88
Find hard peaks and soft peaks in a signal, defined as follows:
99
1010
- Hard peak: a peak that is either /\ or \/.

0 commit comments

Comments
 (0)