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

Add support for Python 3.13 #241

Merged
merged 11 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
39 changes: 19 additions & 20 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools", "setuptools-scm", "wheel", "numpy>=2,<3"]
requires = ["setuptools", "setuptools-scm", "wheel", "numpy>=2"]
build-backend = "setuptools.build_meta"

[project]
Expand All @@ -22,27 +22,28 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Typing :: Typed",
]
keywords = ["sleep", "ecg", "qrs", "peak"]
dependencies = [
"numpy >= 1.25.0, < 3.0.0",
"PyYAML >= 5.4.0",
"requests >= 2.25.0",
"scipy >= 1.7.0",
"tqdm >= 4.60.0",
"numpy >= 1.26.0",
"pyyaml >= 6.0.0",
"requests >= 2.32.3",
"scipy >= 1.13.0",
"tqdm >= 4.66.0",
]
dynamic = ["version"]

[project.optional-dependencies]
full = [ # complete package functionality
"edfio >= 0.4.0",
"joblib >= 1.0.0",
"matplotlib >= 3.5.0",
"numba >= 0.59.1",
"tensorflow >= 2.16.1",
"wfdb >= 3.4.0",
"edfio >= 0.4.4",
"joblib >= 1.4.2",
"matplotlib >= 3.9.2",
"numba >= 0.60.0; python_version < '3.13'",
"tensorflow >= 2.17.0; python_version < '3.13'",
"wfdb >= 4.1.2",
]

dev = [ # everything needed for development
Expand All @@ -52,20 +53,18 @@ dev = [ # everything needed for development
"pre-commit >= 2.13.0",
"pytest >= 6.2.0",
"ruff >= 0.4.0",
"setuptools >= 56.0.0",
"setuptools >= 72.1.0",
]

doc = [ # RTD uses this when building the documentation
"mkdocs-material >= 8.4.0",
"mkdocstrings-python >= 0.8.2",
"mkdocs-material >= 9.5.0",
"mkdocstrings-python >= 1.11.1",
]

cibw = [ # cibuildwheel uses this for running the test suite
"edfio >= 0.4.0",
"numba >= 0.59.1",
"wfdb >= 3.4.0",
# https://github.com/MIT-LCP/wfdb-python/pull/511
"numpy < 2.0.0", # TODO: just for wfdb!
"edfio >= 0.4.4",
"numba >= 0.60.0; python_version < '3.13'",
"wfdb >= 4.1.2",
]

[project.urls]
Expand Down
2 changes: 1 addition & 1 deletion readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.11"
python: "3.12"

mkdocs:
configuration: mkdocs.yml
Expand Down
4 changes: 2 additions & 2 deletions src/sleepecg/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

import datetime
import warnings
from collections.abc import Iterable
from collections.abc import Callable, Iterable
from pathlib import Path
from typing import Any, Callable, TypeVar
from typing import Any, TypeVar

import numpy as np

Expand Down
16 changes: 15 additions & 1 deletion tests/test_heartbeats.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

"""Tests for heartbeat detection and detector evaluation."""

import sys

import numpy as np
import pytest

Expand All @@ -30,7 +32,19 @@ def mitdb_234_MLII():
return next(read_mitdb(records_pattern="234"))


@pytest.mark.parametrize("backend", ["c", "numba", "python"])
@pytest.mark.parametrize(
"backend",
[
"c",
pytest.param(
"numba",
marks=pytest.mark.skipif(
sys.version_info >= (3, 13), reason="numba does not support Python 3.13"
),
),
"python",
],
)
def test_detect_heartbeats(mitdb_234_MLII, backend):
"""Test heartbeat detection on mitdb:234:MLII."""
record = mitdb_234_MLII
Expand Down
Loading