Errors in `get_record_list`
import wfdb
print(wfdb.get_record_list("antimicrobial-resistance-uti")) # The 7th database from get_dbs()
Rather than returning a list of records, it returns a list of lines of a 403 Error HTML file.
['<!DOCTYPE html>', '', '<html lang="en">', ' <head>', ' <meta charset="UTF-8">', ' <title>', '403: Forbidden Access', '</title>', ... , '</html>']
Beyond either removing, renaming or fixing the dbname. I would also recommend detecting that the file accessed is an Error Page and not a valid list of records and raise a corresponding Python Error.
Also:
print(wfdb.get_record_list("bhx-brain-bounding-box")) # The 9th database from get_dbs()
Raises a Value Error:
ValueError: The database https://physionet.org/files/bhx-brain-bounding-box/1.1 has no WFDB files to download
Hello @WilliamDixon, thanks for the feedback! I like your suggestion for returning a Python error if some of these errors occur! Here's the explanations:
-
antimicrobial-resistance-uti: It returns 403 because it's a credentialed project so I believe once you are a credentialed user on PhysioNet then it will appear as intended. The Python exception could say "Forbidden access: you must be a credentialed PhysioNet user" or something along those lines.
-
bhx-brain-bounding-box: There is no RECORDS file so it has no
record_listso the Python exception could say "No RECORDS files found".
Thanks for the explanation @Lucas-Mc, good to know this was expected behaviour.