csv_to_wfdb mishandles defaults, scalar broadcasting and checksums
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Read src/wfdb/io/convert/csv.py, especially the csv_to_wfdb section around lines 338–409, and review the related work in issue #592. Check how defaults, scalar broadcasting, checksums, and initial values behave with the examples in this issue, including record_only=True. Done means those cases use the intended values and the relevant tests pass.
由索引模型根据 Issue 内容生成。
描述
Found while reviewing #591.
The code in csv_to_wfdb that fills in defaults and broadcasts scalars to all channels (https://github.com/MIT-LCP/wfdb-python/blob/b8914e1c9c777c45571c894cb7b6579550a86f13/src/wfdb/io/convert/csv.py#L338-L409) has several problems:
- Scalars are only broadcast when
type(x) is int(orstr). NumPy integers and floats such asadc_gain=200.5are not broadcast to a list. - Defaults are applied with
if not x:, so an explicit0is treated as missing. For example,baseline=0withadc_zero=1024gives a baseline of 1024. - When
adc_zerois a list andbaselineis not given, the default baseline becomes[adc_zero] * n_sig, a list of lists (https://github.com/MIT-LCP/wfdb-python/blob/b8914e1c9c777c45571c894cb7b6579550a86f13/src/wfdb/io/convert/csv.py#L355-L357). - With
record_only=True, the defaultchecksumis computed from the physical values rather than the digital samples (https://github.com/MIT-LCP/wfdb-python/blob/b8914e1c9c777c45571c894cb7b6579550a86f13/src/wfdb/io/convert/csv.py#L401-L402), andinit_valueis an approximation frombaseline + adc_gain * p_signal[0](https://github.com/MIT-LCP/wfdb-python/blob/b8914e1c9c777c45571c894cb7b6579550a86f13/src/wfdb/io/convert/csv.py#L393-L396).
The checksum and initial value could be computed from the digital signal (e.g. via Record.adc()) instead. This may be easiest to address together with #592.
- 主要语言
- Jupyter Notebook
- 星标
- 853
- 派生
- 324
- 平均合并
- 17 小时 39 分钟
- 30 天内合并 PR
- 10
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
MIT-LCP/wfdb-python 的其他 Issue
-
难度 1/5 1-3 小时 新手友好度 83/100
MIT-LCP/wfdb-python#594 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 72/100
MIT-LCP/wfdb-python#590 ·
维护者通常 1 天内回复
-
pandas 3.0: three remaining set_index(<str column>.values) calls still raise TypeError (custom-labels paths)可能已有人在做 @wenh06 于 6 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
MIT-LCP/wfdb-python#574 · 1 条评论 ·
维护者通常 1 天内回复
-
`find_local_peaks` ignores the sample at `i + radius`, so points on a rising slope are returned as peaks可能已有人在做 @rmz-oz 于 27 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
MIT-LCP/wfdb-python#572 ·
维护者通常 1 天内回复
-
bug
难度 3/5 1-2 天 新手友好度 72/100
MIT-LCP/wfdb-python#595 ·
维护者通常 1 天内回复
查看 MIT-LCP/wfdb-python 的全部 Issue
相似的 Issue
-
automation missing-model model-sync provider:tinfoil
难度 2/5 1-3 小时 新手友好度 68/100
anomalyco/models.dev#12053 ·
维护者通常 1 天内回复
-
`_small_angle_of_2_vectors` loses accuracy for nearly parallel vectors (naive difference of products in Kahan's formula)可能已有人在做 @hongyuchen1030 今天认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 3 天内回复
-
kind/bug kind/security
难度 2/5 1-3 小时 新手友好度 82/100
spiceai/spiceai#15826 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
-
approved correction metadata
难度 1/5 1 小时以内 新手友好度 65/100
acl-org/acl-anthology#10687 · 2 条评论 ·
维护者通常 1 天内回复