MIT-LCP / MIT-LCP/wfdb-python

Error when calling rdedfann(): read_edf() got an unexpected keyword argument 'delete_file'

Open
#409 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
853
Forks
322
PR merge metrics
No merged PRs in 30d

Description

Hi!
I just encounter strange error. It seems for me like function rdedfann doesn't work at all. I confused, because it seems it doesn't represent any specific use case, just ordinary edf file. So, seems strange to me.
I just installed new 4.0.0 version and got this bug.

wfdb: 4.0.0

When calling on edf file:

from wfdb.io.convert.edf import rdedfann
rdedfann(f"data/{folder}/{filename}")
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Input In [6], in <cell line: 2>()
      1 from wfdb.io.convert.edf import rdedfann
----> 2 rdedfann(f"data/{folder}/{filename}")

File ~/.venv/fecg/lib/python3.8/site-packages/wfdb/io/convert/edf.py:1096, in rdedfann(record_name, pn_dir, delete_file, info_only, record_only, verbose)
   1087     raise Exception(
   1088         "Both `info_only` and `record_only` are set. Only one "
   1089         "can be set at a time."
   1090     )
   1092 # According to the EDF+ docs:
   1093 #   "The coding is EDF compatible in the sense that old EDF software would
   1094 #    simply treat this 'EDF Annotations' signal as if it were a (strange-
   1095 #    looking) ordinary signal"
-> 1096 rec = read_edf(
   1097     record_name,
   1098     pn_dir=pn_dir,
   1099     delete_file=delete_file,
   1100     record_only=True,
   1101     rdedfann_flag=True,
   1102 )
   1104 # Convert from array of integers to ASCII strings
   1105 annotation_string = ""

TypeError: read_edf() got an unexpected keyword argument 'delete_file'

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in wfdb/io/convert/edf.py around rdedfann at line 1096, then inspect the read_edf call and its accepted arguments. Reproduce the reported rdedfann invocation with wfdb 4.0.0; done means the call no longer raises an unexpected keyword argument error.

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
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.