wfdb.io._url.NetFileNotFoundError: 404 Error: Not Found for url: https://physionet.org/files/ecg-arrhythmia/1.0.0/WFDBRecords/01/010/.hea
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start at wfdb.dl_database in wfdb/io/record.py and trace the download through wfdb/io/download.py and wfdb/io/_url.py. Reproduce the request for the ecg-arrhythmia dataset and inspect how WFDBRecords/01/010/ is interpreted. Done means the dataset can be downloaded without requesting the missing .hea path.
Written by the indexing model from the issue text.
Description
import os
import wfdb
for db in wfdb.get_dbs():
print(db)
def download_dataset_from_physionet(dataset_name: str):
# https://wfdb.readthedocs.io/en/latest/io.html#module-1
print(f"Downloading {dataset_name} dataset from PhysioNet...")
if not os.path.exists("physionet"):
os.makedirs("physionet")
if not os.path.exists("physionet/" + dataset_name):
os.makedirs("physionet/" + dataset_name)
wfdb.dl_database(db_dir=dataset_name,
dl_dir=os.path.join(os.getcwd(), "physionet", dataset_name),
records='all',
annotators='all',
keep_subdirs=True,
overwrite=False)
print(f"Downloaded {dataset_name} dataset from PhysioNet!")
# Download the MIT-BIH dataset
download_dataset_from_physionet("mitdb") # This one downloads
# Download the ECG arrhythmia dataset
download_dataset_from_physionet("ecg-arrhythmia") # This one doesn't, see traceback below
...
['ecg-arrhythmia', 'A large scale 12-lead electrocardiogram database for arrhythmia study']
.....
Downloading mitdb dataset from PhysioNet...
Downloading ecg-arrhythmia dataset from PhysioNet...
Generating list of all files for: WFDBRecords/01/010/
Traceback (most recent call last):
File "I:\nasty\Python_Projects\Healthcare\ECG_Classification_Scholarship_Project\main.py", line 27, in <module>
download_dataset_from_physionet("ecg-arrhythmia")
File "I:\nasty\Python_Projects\Healthcare\ECG_Classification_Scholarship_Project\main.py", line 15, in download_dataset_from_physionet
wfdb.dl_database(db_dir=dataset_name,
File "C:\Users\chalu\AppData\Local\Programs\Python\Python311\Lib\site-packages\wfdb\io\record.py", line 3065, in dl_database
record = rdheader(
^^^^^^^^^
File "C:\Users\chalu\AppData\Local\Programs\Python\Python311\Lib\site-packages\wfdb\io\record.py", line 1847, in rdheader
header_content = download._stream_header(file_name, pn_dir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\chalu\AppData\Local\Programs\Python\Python311\Lib\site-packages\wfdb\io\download.py", line 109, in _stream_header
content = f.read()
^^^^^^^^
File "C:\Users\chalu\AppData\Local\Programs\Python\Python311\Lib\site-packages\wfdb\io\_url.py", line 581, in read
result = b"".join(self._read_range(start, end))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\chalu\AppData\Local\Programs\Python\Python311\Lib\site-packages\wfdb\io\_url.py", line 474, in _read_range
with RangeTransfer(self._current_url, req_start, req_end) as xfer:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\chalu\AppData\Local\Programs\Python\Python311\Lib\site-packages\wfdb\io\_url.py", line 168, in __init__
self._parse_headers(method, self._response)
File "C:\Users\chalu\AppData\Local\Programs\Python\Python311\Lib\site-packages\wfdb\io\_url.py", line 214, in _parse_headers
raise cls(
wfdb.io._url.NetFileNotFoundError: 404 Error: Not Found for url: https://physionet.org/files/ecg-arrhythmia/1.0.0/WFDBRecords/01/010/.hea
Seems to be trying to find a filename that doesn't exist? When you navigate to https://physionet.org/files/ecg-arrhythmia/1.0.0/WFDBRecords/01/010 there are files in there, but the code is looking for .hea which doesn't exist?
- 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
-
bug triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
fivetran/great_expectations#12253 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
correction metadata
Difficulty 1/5 Under an hour Newbie friendliness 78/100
acl-org/acl-anthology#10071 · 1 comment ·
-
data:css needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
mdn/browser-compat-data#30618 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
basedosdados/pipelines#2095 ·