Skip to content

Commit

Permalink
Add NumPy 2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrnr committed Oct 9, 2024
1 parent d3439da commit 7f946d6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
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"
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

0 comments on commit 7f946d6

Please sign in to comment.