You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're encountering an issue when trying to write data to WFDB files using the wrsamp function. Specifically, we’re seeing an error that prevents us from writing the files correctly. When attempting to call wrsamp to save our data, we receive the following error message:
IndexError: Channel 0 contains values outside the allowed range [-32768, 32767] for fmt 16.
To investigate the issue further, we modified the WFDB source code to provide additional debugging information. The csv file we’re attempting to convert to wfdb has values ranging between:
Minimum: -90.113269
Maximum: 622.269327
But this is being scaled to -32767 and 32772 after calling wrsamp, so the max value allowed in fmt 16 is being exceeded.
We are using package versions:
Please see a screenshot below depicting the error we get using:
wfdb==4.1.2
pandas==2.2.3
numpy==2.1.2
We have a minimal reproducible sample that we sent to Ben Moody and Tom Pollard.
The text was updated successfully, but these errors were encountered:
Hey @tompollard, Tyler Law shared the reproducible code sample and data with you on 2024-12-04; it's the same thread that you responded to yesterday suggesting we open a GH issue 😃
Let me know if you want me to send to you again via email. We'd like to avoid posting the data here publicly.
@nickfong , thanks for privately sharing the CSV of data that allows for reproducing this problem. I haven't looked into it in detail but when I ran your code + data in a new environment I was able to reproduce the error. When I went to my wfdb-python environment I could not reproduce the error with the same code + data. We don't currently support numpy versions > 2 . This seemed like the obvious difference in setups, so I confirmed that with numpy==1.26.1 in both environments that the error does not occur. I haven't dug much further but this may be related to: #493 . We are actively working on support for numpy > 2 : #511 .
We're encountering an issue when trying to write data to WFDB files using the wrsamp function. Specifically, we’re seeing an error that prevents us from writing the files correctly. When attempting to call wrsamp to save our data, we receive the following error message:
To investigate the issue further, we modified the WFDB source code to provide additional debugging information. The csv file we’re attempting to convert to wfdb has values ranging between:
But this is being scaled to -32767 and 32772 after calling
wrsamp
, so the max value allowed in fmt 16 is being exceeded.We are using package versions:
We have a minimal reproducible sample that we sent to Ben Moody and Tom Pollard.
The text was updated successfully, but these errors were encountered: