csv2ann truncates paths containing dots, lacks write_dir, tests and docs

Geschlossen
#595 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Ein zugehöriger Pull Request wurde bereits gemerged.

  • #599 von @TheNetherWatcher — gemerged

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
72/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
python
Bereich
backend

Rechercherichtung

Start with wfdb/io/convert/csv.py, especially csv2ann near the referenced line, and compare its output path handling with csv_to_wfdb and wrann. Add tests for dotted paths and write_dir, then update docs/convert.rst to list csv2ann; done means path handling is consistent and the function is covered and documented.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

bug

Found while reviewing #591.

csv2ann in wfdb/io/convert/csv.py has some problems:

  • The record name is derived with file_name.split(".")[0] (https://github.com/MIT-LCP/wfdb-python/blob/b8914e1c9c777c45571c894cb7b6579550a86f13/src/wfdb/io/convert/csv.py#L627), which breaks on paths containing dots: ./x.csv becomes "" and data/v1.2/x.csv becomes data/v1. os.path.splitext would avoid this. (csv_to_wfdb also uses the base name only, so the expected output location should be the same for both.)
  • There is no write_dir parameter, unlike csv_to_wfdb and wrann, so output paths depend on the input path and the current directory.
  • It has no tests.
  • It is not included in the API docs (docs/convert.rst only lists csv_to_wfdb).
Vorherrschende Sprache
Jupyter Notebook
Sterne
853
Forks
324
Ø Merge
15 Std.
Gemergte PRs (30 T.)
32

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus MIT-LCP/wfdb-python

Alle Issues in MIT-LCP/wfdb-python

Ähnliche Issues

Weitere Issues zu Backend & API Design

Neue Issues direkt in Ihr Postfach

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