`analyse_residual` fails with its default arguments since `detect_peaks` changed signature
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 benchmark/residual_analysis.py 和 benchmark_sorter_without_gt.py 开始,然后检查 detect_peaks 的签名以及 issue 中提到的两个被跳过的测试。验证默认参数和 job kwargs 在两条 benchmark 路径中都能正常工作;当报告的 TypeError 消失且相关测试通过时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
I found this while reading benchmark/residual_analysis.py, not in my own analyses, so this is a "for the sake of improvement" report.
analyse_residual calls detect_peaks(residual, **detect_peaks_kwargs, **job_kwargs), but since #4793 detect_peaks only accepts method, method_kwargs, pipeline_kwargs, verbose and job_kwargs. The default detect_peaks_kwargs (with peak_sign and detect_threshold) and any job kwarg now raise a TypeError.
from spikeinterface.core import generate_ground_truth_recording, create_sorting_analyzer
from spikeinterface.benchmark import analyse_residual
recording, sorting = generate_ground_truth_recording(durations=[10.0], num_channels=8, num_units=4, seed=0)
analyzer = create_sorting_analyzer(sorting, recording, sparse=True)
analyzer.compute(["random_spikes", "templates", "noise_levels"])
analyzer.compute("amplitude_scalings", handle_collisions=False)
for args, job_kwargs in (((), {}), (({"method": "locally_exclusive"},), {"n_jobs": 1})):
try:
analyse_residual(analyzer, *args, **job_kwargs)
except TypeError as error:
print(error)
# Output on current main:
# detect_peaks() got an unexpected keyword argument 'peak_sign'
# detect_peaks() got an unexpected keyword argument 'n_jobs'
# Expected: no error
Reading the code, SorterBenchmarkWithoutGroundTruth.compute_result makes the same call, so SorterStudyWithoutGroundTruth.compute_results() fails too; the two related tests are marked skip.
Fix: call detect_peaks(residual, method=..., method_kwargs=..., job_kwargs=job_kwargs), and update the default dict and the call in benchmark_sorter_without_gt.py.
I can open a PR with a test if you agree.
- 主要语言
- Python
- 星标
- 883
- 派生
- 291
- 平均合并
- 3 天 17 小时
- 30 天内合并 PR
- 40
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
SpikeInterface/spikeinterface 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 83/100
SpikeInterface/spikeinterface#5008 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
SpikeInterface/spikeinterface#5007 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
SpikeInterface/spikeinterface#5006 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
SpikeInterface/spikeinterface#5005 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
SpikeInterface/spikeinterface#5003 ·
维护者通常 2 天内回复
查看 SpikeInterface/spikeinterface 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
available bug good first issue tooling
难度 2/5 1-3 小时 新手友好度 88/100
Nixitov/Riptide-Native#816 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 70/100
teng-lin/notebooklm-py#2593 ·
维护者通常 1 天内回复
-
claimed-by:collie role:small-fix status:running
难度 2/5 1-3 小时 新手友好度 82/100
Beovulfo/herd-sdlc#325 · 1 条评论 ·
维护者通常 1 天内回复
-
good first issue
难度 1/5 1 小时以内 新手友好度 94/100
omarelshamy25x/shamy-arabic-nlp#267 ·
维护者通常 1 天内回复