MIT-LCP / MIT-LCP/wfdb-python

New interface for specifying different data sources for read/write

Offen
#367 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Jupyter Notebook
Sterne
853
Forks
322
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Looking at the current rdrecord for example, there are two parameters used to specify the location of the record:

  1. record_name : str
  2. 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.

class DataSourceType(Enum):
    LOCAL = 1  # Not sure if this is necessary?
    HTTP = 2
    GCS = 3
    S3 = 4

class DataSource:
    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:

  1. record_name: str
  2. data_source: str | DataSource - The key of the data source in the global data sources map, or a DataSource object.

This would be much more explicit. Thoughts?

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginnen Sie mit dem Lesen des aktuellen rdrecord-Interfaces und von download.py, die der Issue als relevante Einstiegspunkte für den lokalen Zugriff und den Zugriff auf PhysioNet identifiziert. Vergleichen Sie, wie diese Pfade mehrere Remote-Quellen darstellen müssten, und dokumentieren Sie anschließend eine konkrete API sowie Akzeptanzkriterien für Lese-/Schreibunterstützung für lokale Quellen, HTTP, S3 und GCS, bevor Sie mit der Implementierung beginnen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
backend-api-design
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.