Skip to content

Accessing a file in a subfolder on PhysioNet using pn_dir #467

Description

@alistairewj

I'm using wfdb 4.1.2, and when I try to run this code it fails with a 404:

import wfdb
record = wfdb.rdrecord('p1003/p10030753/s40735970/40735970', pn_dir='mimic-iv-ecg')

NetFileNotFoundError: 404 Error: Not Found for url: https://physionet.org/files/mimic-iv-ecg/1.0/40735970.hea

Looks like this relates to hacky path parsing which there is an open (semi-complete) PR for (#346).

I also tried:

import wfdb
record = wfdb.rdrecord('40735970', pn_dir='mimic-iv-ecg/1.0/p1003/p10030753/s40735970')

NetFileNotFoundError: 404 Error: Not Found for url: https://physionet.org/files/mimic-iv-ecg/1.0/p1003/p10030753/s40735970/40735970.hea

So I played with the path, and this ends up working:

import wfdb
record = wfdb.rdrecord('40735970', pn_dir='mimic-iv-ecg/1.0/files/p1003/p10030753/s40735970')

Seems a bit unintuitive to me that you have to put files in there, am I doing something wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions