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
{{ message }}
Repository navigation
New interface for specifying different data sources for read/write #367
Looking at the current rdrecord for example, there are two parameters used to specify the location of the record:
record_name : str
pn_dir : str
The current package supports reading files locally and from the global database index URL, which defaults to PhysioNet, as specified in download.py.
There are several things that we should aim to support:
Reading/writing from more types of data sources, such as S3, and GCS.
Having more than one remote source configured at a time.
One proposal might be to have a new DataSource class, and a global config dictionary with key:value pairs of ds_name(str):ds(DataSource). ie.
classDataSourceType(Enum):
LOCAL=1# Not sure if this is necessary?HTTP=2GCS=3S3=4classDataSource:
ds_type : DataSourceType# Other type-specific params here_physionet_ds=DataSource(ds_type=DataSourceType.HTTP, base_url="https://physionet.org/content/")
data_sources= { 'physionet' : _physionet_ds }
And the read/write functions could use these params:
record_name: str
data_source: str | DataSource - The key of the data source in the global data sources map, or a DataSource object.
Closing this because the source-selection goals are now served by explicit paths rather than a global DataSource registry. Readers accept local paths, HTTP URLs, physionet:// URIs, and supported cloud URIs; record writing accepts local and supported cloud destinations. A caller can use different sources in the same process without changing global configuration. HTTP remains read-only. The remaining pn_dir transition is tracked in #534.
Activity
tompollard commentedon Dec 1, 2026
Closing this because the source-selection goals are now served by explicit paths rather than a global DataSource registry. Readers accept local paths, HTTP URLs, physionet:// URIs, and supported cloud URIs; record writing accepts local and supported cloud destinations. A caller can use different sources in the same process without changing global configuration. HTTP remains read-only. The remaining pn_dir transition is tracked in #534.