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

オープン 初心者向け
#4,990 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
88/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
data

調査の方向性

benchmark/benchmark_base.py の BenchmarkStudy.create から始め、create_sorting_analyzer に渡される前に main_channel_indices がどのように設定されるかをたどってください。issue には、gt_unit_locations が欠けているデータセットを使った SorterStudy.create による再現手順があります。まずその例を実行し、analyzer のチャンネルインデックスを確認してください。各データセットに適切なメインチャンネルが設定され、プロパティが欠けているケースを回帰テストでカバーできれば完了です。

索引モデルが 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時間
マージ済み PR(30日)
40

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

SpikeInterface/spikeinterface のほかの issue

SpikeInterface/spikeinterface の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。