Skip to content

feat(io): list reader-ready record IDs for PhysioNet and NSRR - #360

Merged
cbrnr merged 4 commits into
cbrnr:mainfrom
viranovskaya:feat/list-available-records
Nov 25, 2026
Merged

cbrnr merged 4 commits into
cbrnr:mainfrom
viranovskaya:feat/list-available-records

Conversation

@viranovskaya

Copy link
Copy Markdown
Contributor

Closes #334.

List available records without downloading recordings or deriving selectors from filenames. The strings returned by list_physionet_records and list_nsrr_records can be passed directly as the corresponding reader's records_pattern.

For example, CAP returns n1 rather than n1.edf, MESA preserves leading zeros (0001), and SHHS keeps the visit prefix (shhs1-200001). NSRR discovery uses the public event annotation catalog and does not need a download token; access requirements for reading the recordings are unchanged.

Tests exercise the PhysioNet metadata cache and pass MESA and SHHS selectors directly to their readers on small local fixtures.

@cbrnr

cbrnr commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Thanks! Two small things:

  1. list_physionet_records("capslpdb") with the default "*" pattern now always raises the "Skipping n16" RuntimeWarning, even though nothing is being read. That breaks code that runs with warnings as errors. Could the listing leave out n16 silently and keep the warning only in read_capslpdb? A test with the default pattern would cover it, since the current one only uses "n1".
  2. list_nsrr_records("mesa") returns "0001", but the record that read_mesa yields has id == "mesa-sleep-0001". Passing record.id back as records_pattern returns nothing, and there's no error. SHHS doesn't have this problem. A short docstring note that MESA's listed values are selectors and not SleepRecord.id values would be enough.

@viranovskaya

Copy link
Copy Markdown
Contributor Author

Thanks for the review! I fixed both points in a4622c1. Listing CAP records now skips n16 silently; only the reader warns. I also clarified the difference between the MESA selector and SleepRecord.id in the docstring.

@cbrnr

cbrnr commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Perfect! If you remove the draft status I will go ahead and merge. You might have to rebase or merge main.

@viranovskaya
viranovskaya marked this pull request as ready for review November 23, 2026 14:28
@cbrnr
cbrnr merged commit e7bb031 into cbrnr:main Nov 25, 2026
10 checks passed
@cbrnr

cbrnr commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Thanks @viranovskaya!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide a public API to get the list of available records

2 participants