Repository navigation
Warn on pn_dir and suggest explicit read paths - #818
Conversation
7ea45f1 to
5262244
Compare
tompollard
left a comment
There was a problem hiding this comment.
Thanks. The suggested replacements are correct and copyable: rdheader("100", pn_dir="mitdb") suggests physionet://mitdb/latest/100, which reads fine live (a version-less physionet://mitdb/100 doesn't, so including latest is needed), and a custom index gives the full https:// URL. Each public call warns exactly once at the caller's line (checked rdrecord, ann2rr, bxb_record), while download_records and dl_database stay silent despite using pn_dir internally. FutureWarning seems the right category for end users. The offline suite, Ruff and the strict docs build pass locally on the rebased branch.
Two small things:
- The suite now emits 19
FutureWarnings, and with-W error::FutureWarning12 existing tests fail. Wrapping thosepn_dirtests inpytest.warns(FutureWarning)(orfilterwarnings) would keep the output clean and assert the warning. docs/io.rststill presentspn_dircalls (wfdb.rdrecord("100", pn_dir="mitdb")and themimic-iv-ecgexamples in the "Reading From PhysioNet" section) without saying they're deprecated. Showing thephysionet://form, or labelling those as legacy, would match the warning.
|
Thanks — I addressed both points in fa873fe. The existing Ruff and the strict Sphinx build pass too. |
Summary
FutureWarningwhen a public reader is called withpn_dir. The warning suggests aphysionet://path or a complete HTTP URL for a custom server when the replacement can be formed without a network request.pn_dircalls working. Suppress warnings from internal reader calls, includingdownload_records.This is stacked on #817, which adds explicit HTTP URL reads for custom servers. Merge #817 first, then retarget this PR to
main. Related to #534 and #672.Checks