You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for raising this, and sorry for the slow reply. wfdb-python deliberately reads the path it's given rather than searching for records, so that it's always clear which file was read. We'd like to keep that, but we could add an explicit search step, along these lines:
path=wfdb.find_record("mitdb/100", search_path=["/data/physionet", "."])
record=wfdb.rdrecord(path) # path is the full location that was found
find_record would return the path to the first folder in search_path that contains the record, and raise an error listing the folders it searched if none does. A helper could also read the folders listed in your WFDB environment variable, for example search_path=wfdb.wfdb_search_path(), but only when you ask for it.
Is this still something you need, and would this approach meet your needs? It would also help to know a little about your setup. For example, do you keep a record's files (such as signals and annotations) in different folders, or use entries in WFDB other than local folders?
This is now available in wfdb 5.12.0 via #824. The search is explicit: wfdb.find_record("mitdb/100", search_path=wfdb.wfdb_search_path()) returns the first matching local record path, which you can pass to wfdb.read_record(...). You can also pass your own ordered list of directories as search_path. Readers still use exactly the path they receive; they do not silently consult WFDB. The helper supports local directories separated by the OS path separator, but not every form accepted by the C library (such as URL entries or indirect path files). If your setup relies on one of those forms, please let us know and we can track that separately.
Activity
tompollard commentedon Nov 29, 2026
Thanks for raising this, and sorry for the slow reply. wfdb-python deliberately reads the path it's given rather than searching for records, so that it's always clear which file was read. We'd like to keep that, but we could add an explicit search step, along these lines:
find_recordwould return the path to the first folder insearch_paththat contains the record, and raise an error listing the folders it searched if none does. A helper could also read the folders listed in yourWFDBenvironment variable, for examplesearch_path=wfdb.wfdb_search_path(), but only when you ask for it.Is this still something you need, and would this approach meet your needs? It would also help to know a little about your setup. For example, do you keep a record's files (such as signals and annotations) in different folders, or use entries in
WFDBother than local folders?Find local WFDB records with an explicit search path (#824)
tompollard commentedon Dec 1, 2026
This is now available in wfdb 5.12.0 via #824. The search is explicit:
wfdb.find_record("mitdb/100", search_path=wfdb.wfdb_search_path())returns the first matching local record path, which you can pass towfdb.read_record(...). You can also pass your own ordered list of directories assearch_path. Readers still use exactly the path they receive; they do not silently consultWFDB. The helper supports local directories separated by the OS path separator, but not every form accepted by the C library (such as URL entries or indirect path files). If your setup relies on one of those forms, please let us know and we can track that separately.Update README guidance for explicit source paths (#826)