`BenchmarkStudy.create` reuses the main channels of another dataset

未关闭 适合新手
#4,990 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
88/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
data

调研方向

从 benchmark/benchmark_base.py 中的 BenchmarkStudy.create 开始,追踪 main_channel_indices 在传递给 create_sorting_analyzer 之前是如何设置的。issue 提供了一个复现示例,使用 SorterStudy.create,其中一个 dataset 缺少 gt_unit_locations;先运行该示例并检查 analyzer 的通道索引。完成标准是每个 dataset 都获得适当的主通道,并且有一个回归测试覆盖属性缺失的情况。

由索引模型根据 Issue 内容生成。

描述

I found this while reading benchmark/benchmark_base.py, not in my own analyses, so this is a "for the sake of improvement" report.

In BenchmarkStudy.create, main_channel_indices is only set when the ground truth sorting has the gt_unit_locations property, but it is always passed to create_sorting_analyzer (since #4734). A dataset without this property gets the main channels of the previous dataset, or an UnboundLocalError if it is the first one. The sparsity, templates and SNR are then wrong without an error.

import tempfile
from pathlib import Path
from spikeinterface.core import generate_ground_truth_recording
from spikeinterface.benchmark import SorterStudy

if __name__ == "__main__":
    datasets = {}
    for key, seed in (("a", 0), ("b", 5)):
        datasets[key] = generate_ground_truth_recording(num_channels=32, num_units=4, durations=[10.0], seed=seed)
    datasets["b"][1].delete_property("gt_unit_locations")
    cases = {key: {"label": key, "dataset": key, "params": {"sorter_name": "simple"}} for key in datasets}
    study = SorterStudy.create(Path(tempfile.mkdtemp()) / "study", datasets=datasets, cases=cases)
    print(study.analyzers["a"].main_channel_indices, study.analyzers["b"].main_channel_indices)

Both datasets get the same main channels. Fix: set main_channel_indices = None in the else branch, so that they are estimated. I have this locally with a test. Should I open a PR, or would you rather fix it yourselves?

主要语言
Python
星标
883
派生
291
平均合并
3 天 17 小时
30 天内合并 PR
40

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

SpikeInterface/spikeinterface 的其他 Issue

查看 SpikeInterface/spikeinterface 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。