wrsamp: IndexError: Channel 0 contains values outside the allowed range [-32768, 32767] for fmt 16
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
Research direction
Start by reproducing the wrsamp call with the reported input range and inspect how values are scaled for fmt 16 before the range check. The payload does not name source files or tests; done means the described data can be written without producing values outside the allowed fmt 16 range, with regression coverage for the case.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Jupyter Notebook
- Stars
- 853
- Forks
- 322
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MIT-LCP/wfdb-python
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
MIT-LCP/wfdb-python#568 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
MIT-LCP/wfdb-python#557 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 58/100
MIT-LCP/wfdb-python#554 ·
-
WFDB path ignored Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
MIT-LCP/wfdb-python#545 ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
MIT-LCP/wfdb-python#540 ·
All issues in MIT-LCP/wfdb-python
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
removeToken
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
cowprotocol/token-lists#1514 · 2 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
anomalyco/models.dev#7670 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
cisagov/cyhy-reports#149 · 3 comments ·
-
remove entry
Difficulty 1/5 Under an hour Newbie friendliness 74/100