ann2rr filters intervals by length instead of by time in the record

Đang mở
#617 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@TheNetherWatcher đang làm issue này rồi.

Từ ngày 1/11/2026.

  • #622 của @TheNetherWatcher — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
data

Hướng nghiên cứu

The ann2rr function lives in wfdb/processing.py; start by reading its docstring and the filtering lines shown. Compute each interval's end time as cumulative sum of RR intervals from start_time, then keep those between bounds. Done means ann2rr('sample-data/100','atr', start_time=0.9) returns intervals after 0.9s, and tests pass.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

The ann2rr docstring describes start_time and stop_time as "the time to start the intervals" and "the time to stop the intervals", in seconds. But they're compared with the length of each interval, not with its position in the record:

time_interval = rr_interval / ann.fs
if start_time is not None:
    time_interval = time_interval[(time_interval > start_time).astype(bool)]
if stop_time is not None:
    time_interval = time_interval[(time_interval < stop_time).astype(bool)]

For example, with record 100 (360 Hz):

from wfdb import processing

len(processing.ann2rr("sample-data/100", "atr"))                  # 2274
processing.ann2rr("sample-data/100", "atr", start_time=0.9)       # 30 intervals, all longer than 0.9 s
processing.ann2rr("sample-data/100", "atr", stop_time=0.5)        # 2 intervals, both shorter than 0.5 s

So start_time=0.9 drops every interval shorter than 0.9 s, rather than the intervals before 0.9 s into the record.

The WFDB ann2rr program's -f and -t options select annotations by time in the record. ann2rr should probably do the same: keep the intervals that end between start_time and stop_time, measuring the first interval from start_time, as ann2rr -f does.

This is separate from #584, which changes which annotations are used but leaves this filtering unchanged.

Ngôn ngữ chính
Jupyter Notebook
Star
853
Fork
324
Merge trung bình
1 ngày 12 giờ
Pull request đã merge (30 ngày)
36

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của MIT-LCP/wfdb-python

Tất cả issue của MIT-LCP/wfdb-python

Issue tương tự

Thêm issue về Data Engineering

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.