Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump dependencies for NumPy 2 compatibility #511

Open
wants to merge 56 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
45a832c
Bump dependencies for NumPy 2 compatibility
cbrnr Oct 23, 2024
53047e2
Fix CI
cbrnr Oct 23, 2024
3105f32
Bump scipy for Python 3.13
cbrnr Oct 23, 2024
6bd08fb
Bump Python to 3.10
cbrnr Oct 23, 2024
f1f1ab9
Include Python 3.9 again
cbrnr Oct 25, 2024
3445bef
Try to replace uv run
cbrnr Nov 18, 2024
e2ff829
Downgrade scipy
cbrnr Nov 18, 2024
4b3e4c6
Run as module
cbrnr Nov 18, 2024
7cffcda
Back to uv run
cbrnr Nov 18, 2024
7dd5617
Use --system option
cbrnr Nov 18, 2024
52dd99b
Revert
cbrnr Nov 18, 2024
1f3bacd
Sync
cbrnr Nov 18, 2024
7fb608e
Try forking
cbrnr Nov 18, 2024
b2ffd51
Try >= 3.10
cbrnr Nov 19, 2024
2349a41
Try with setup-python action
cbrnr Nov 19, 2024
7c3daab
Revert "Try with setup-python action"
cbrnr Nov 19, 2024
efcc574
Remove 3.13 (and add 3.9) for now
cbrnr Nov 19, 2024
a9366ec
Force numpy >= 2.0.0
cbrnr Nov 19, 2024
0556a67
Revert to numpy >= 1.26.4
cbrnr Nov 26, 2024
9825b4a
Use uv pip
cbrnr Nov 26, 2024
c1a4dae
Activate venv
cbrnr Nov 26, 2024
e0ade6a
Use system Python
cbrnr Nov 26, 2024
37df1e7
Use setup-python
cbrnr Nov 26, 2024
18edd50
Ping
cbrnr Nov 26, 2024
4e81718
Add 3.13
cbrnr Nov 26, 2024
16071e4
Split jobs
cbrnr Nov 26, 2024
dfdd451
Rename
cbrnr Nov 26, 2024
510e45f
Remove numpy matrix
cbrnr Nov 26, 2024
a7e7ed7
Fix name for Debian test
cbrnr Nov 26, 2024
3f43fd2
Downgrade pandas
cbrnr Nov 26, 2024
2ea3f8f
Revert pandas
cbrnr Nov 26, 2024
fc91a13
Numpy matrix
cbrnr Nov 26, 2024
c773875
Fix matrix
cbrnr Nov 26, 2024
fb7120e
Temporarily remove Debian
cbrnr Nov 26, 2024
6fd6bc0
Re-enable
cbrnr Nov 26, 2024
8357620
Test single OS
cbrnr Nov 26, 2024
386a462
Fix name
cbrnr Nov 26, 2024
d6df0ce
Remove quotes
cbrnr Nov 26, 2024
ae8ebe4
Forgot $
cbrnr Nov 26, 2024
fb5d6ad
Try single command
cbrnr Nov 26, 2024
39f3a98
Simplify matrix
cbrnr Nov 26, 2024
9e234ea
Add OS name
cbrnr Nov 26, 2024
781690d
Improve name
cbrnr Nov 26, 2024
f804e78
Revert
cbrnr Nov 26, 2024
1f91640
Try another variant
cbrnr Nov 26, 2024
fc4db50
OK forget it
cbrnr Nov 26, 2024
9ee8027
Only test NumPy 1.26.4 on Python 3.9
cbrnr Nov 26, 2024
e82bfac
Try with condition
cbrnr Nov 26, 2024
ad26811
Use weak_and_warn
cbrnr Nov 26, 2024
2387ca3
Don't fail fast
cbrnr Nov 26, 2024
537cc7a
Fix syntax
cbrnr Nov 26, 2024
235f215
Fix invalid escape sequence
cbrnr Nov 26, 2024
68d5c04
Fix dtype promotion warning
cbrnr Nov 26, 2024
afbf542
Try again
cbrnr Nov 26, 2024
1a437e6
Maybe better
cbrnr Nov 26, 2024
0269bf7
Fix style
cbrnr Nov 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -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
60 changes: 29 additions & 31 deletions .github/workflows/run-tests.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -10,30 +8,45 @@ on:
branches:
- main

# Set the language, install dependencies, and run the tests
env:
UV_SYSTEM_PYTHON: 1
NPY_PROMOTION_STATE: weak_and_warn

jobs:
build:
runs-on: ${{ matrix.os }}
test:
name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
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"]
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
- name: Install Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- uses: astral-sh/setup-uv@v3
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install libsndfile
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get install -y libsndfile1
- name: Install dependencies
run: |
uv pip install ".[dev]"
- if: ${{ matrix.numpy }}
run: uv pip install ${{ matrix.numpy }}
- name: Run tests
run: uv run --extra dev pytest
- name: Check source code format
run: uv run --extra dev black --check --diff .
run: pytest
- name: Check style
run: black --check --diff .

test-deb10-i386:
name: Python 3.7 on Debian 10 i386
runs-on: ubuntu-latest
container: i386/debian:10
steps:
Expand All @@ -49,26 +62,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
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ description = "The WFDB Python package: tools for reading, writing, and processi
authors = [{name = "The Laboratory for Computational Physiology", email = "[email protected]"}]
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",
Expand All @@ -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 = [
Expand Down
2 changes: 1 addition & 1 deletion wfdb/io/convert/edf.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ def read_edf(
}

sig_data = np.empty((sig_len, n_sig))
temp_sig_data = np.fromfile(edf_file, dtype=np.int16)
temp_sig_data = np.fromfile(edf_file, dtype=np.int16).astype("int64")
temp_sig_data = temp_sig_data.reshape((-1, sum(samps_per_block)))
temp_all_sigs = np.hsplit(temp_sig_data, np.cumsum(samps_per_block)[:-1])
for i in range(n_sig):
Expand Down
2 changes: 1 addition & 1 deletion wfdb/processing/peaks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 \/.
Expand Down
Loading