Better API for specifying return data of signals
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Jupyter Notebook
- Sterne
- 853
- Forks
- 322
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
The current rdrecord API is rather confusing when dealing with more complex records/signals. Namely: multi-frequency signals.
We should create a better API to allow users to:
- Specify/know the exact return types/dimensions of the signals being read
- Deal with single and multi-frequency records consistently.
In addition, the current API is also limiting when reading single-frequency records, as there is no way for users to explicitly specify whether they want 1d or 2d numpy arrays.
We current have: https://github.com/MIT-LCP/wfdb-python/blob/0d42dfb4b2946625f00cbf500d830d374a201153/wfdb/io/record.py#L1715 where the only parameter that influences the return type is: smooth_frames
We've chatted about the issue here, where I suggested a new set of params:
https://github.com/MIT-LCP/wfdb-python/pull/313#issuecomment-1058363761
What do people think of the suggestion of having two params: return_dims and smooth_frames? return_dims will apply for both single and multi-frequency signals, and smooth_frames will apply only to multi-frequency signals. Given the combination of the params, the return value of the signals will be:
(1, True): List of 1d arrays. Guaranteed to be same length.
(1, False): List of 1d arrays. Not guaranteed to be same length for multi-frequency signals.
(2, True): Single 2d array.
(2, False): Illegal combination.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Lies zuerst wfdb/io/record.py um Zeile 1715 sowie die verknüpfte Diskussion zum Pull Request, da die vorgeschlagenen Parameter und Kompatibilitätsfragen noch diskutiert werden. Als abgeschlossen gilt die Aufgabe, wenn die Rückgabeformen für Einzel- und Mehrfrequenzsignale über return_dims und smooth_frames hinweg festgelegt und dokumentiert sind und die ungültige Kombination konsistent behandelt wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- numpy, python
- Bereich
- backend-api-design, data
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 30/100