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 NumPy 2 support #505

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ license = "MIT"

[tool.poetry.dependencies]
python = ">=3.7"
numpy = ">=1.10.1,<2.0.0"
numpy = ">=2.0.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could even remain numpy = ">=1.26.0", since all changes should work with both NumPy 1.x and NumPy 2.x.

scipy = ">=1.0.0"
pandas = ">=1.3.0"
SoundFile = ">=0.10.0"
Expand Down
2 changes: 2 additions & 0 deletions wfdb/io/_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -2312,6 +2312,8 @@ def wr_dat_file(
# Non-expanded format always has 1 sample per frame
n_sig = d_signal.shape[1]
samps_per_frame = [1] * n_sig

d_signal = d_signal.astype("int64")

# Total number of samples per frame (equal to number of signals if
# expanded=False, but may be greater for expanded=True)
Expand Down
2 changes: 1 addition & 1 deletion wfdb/io/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2237,7 +2237,7 @@ def proc_core_fields(filebytes, bpi):

# Not a skip - it is the actual sample number + annotation type store value
label_store = filebytes[bpi, 1] >> 2
sample_diff += int(filebytes[bpi, 0] + 256 * (filebytes[bpi, 1] & 3))
sample_diff += int(filebytes[bpi, 0]) + 256 * int(filebytes[bpi, 1] & 3)
bpi = bpi + 1

return sample_diff, label_store, bpi
Expand Down
Loading