wrann ValueError
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 853
- Forks
- 322
- PR merge metrics
- No merged PRs in 30d
Description
When saving annotations, I get this error in wrann:
File "C:\Users\######\venv\Lib\site-packages\wfdb\io\annotation.py", line 943, in wr_ann_file
if fs_bytes == [] and cl_bytes == []:
^^^^^^^^^^^^^^
ValueError: operands could not be broadcast together with shapes (28,) (0,)
This error is raised when fs_bytes (or cl_bytes) is a numpy ndarray that is compared to the empty list.
A possible solution may be, to cast the arrays to lists and then compare them:
if list(fs_bytes) == [] and list(cl_bytes) == []:
(WFDB Version: 4.1.2, Python 3.11)
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.
Research direction
Start at wfdb/io/annotation.py line 943 in wr_ann_file and reproduce the annotation-saving path described in the report. Check how fs_bytes and cl_bytes are represented before the empty-value comparison; done means saving annotations no longer raises the reported NumPy broadcasting ValueError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100