Repository navigation
List databases in get_dbs through PhysioNet's API - #665
Conversation
PhysioNet has removed https://physionet.org/rest/database-list/, so get_dbs failed with a 404 error. Use the physionet package's list of published projects instead, keeping the latest version of each database. Fixes #439.
tompollard
left a comment
There was a problem hiding this comment.
The database filtering looks correct. I verified the live API result: get_dbs() returned 466 unique database slugs, including the expected MIT-BIH entry. The 26 focused offline tests and all 18 PR checks pass.
One minor cleanup request in src/wfdb/io/download.py:265: get_dbs() creates a PhysioNetClient but never closes it. The client owns a requests.Session and supports a context manager, so could this use with physionet.PhysioNetClient() as client: around client.projects.list_published()? That would close the session on both success and error; the client and its projects object reference each other, so leaving cleanup to garbage collection is unpredictable.
|
Thanks, good catch. In e25f8b8, I added a check to the existing test that the client is closed once, and a new test that it's closed when |
tompollard
left a comment
There was a problem hiding this comment.
Re-reviewed e25f8b8. The earlier client-cleanup finding is fixed: get_dbs() now closes its PhysioNetClient on both success and error, with tests for both paths. I found no further actionable issues, and all 27 focused offline tests pass. The updated commit's remaining CI jobs are still running; this looks good to merge once they pass.
Fixes #439.
PhysioNet has removed
https://physionet.org/rest/database-list/, sowfdb.get_dbs()now fails with a 404 error. This lists databases through PhysioNet's API instead, with thephysionetpackage (already a dependency), and keeps the latest version of each database. It returns the same[slug, title]pairs, sorted by slug, as before: currently 466 databases, in about 4 seconds.Testing
pytest -m "not network": all pass, also with--resolution lowest-direct(physionet 0.7.2). Ruff and the docs build pass.@tompollard 🟥 red 🦥 sloth · aspen