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

Aperta Adatta ai principianti
#4,990 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
88/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
data

Direzione di ricerca

Inizia in benchmark/benchmark_base.py, da BenchmarkStudy.create, e segui come viene impostato main_channel_indices prima di passarlo a create_sorting_analyzer. L’issue fornisce una riproduzione che usa SorterStudy.create con un dataset a cui manca gt_unit_locations; esegui prima quell’esempio e controlla gli indici dei canali dell’analizzatore. Il lavoro è completato quando ogni dataset ottiene i canali principali appropriati e un test di regressione copre il caso della proprietà mancante.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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?

Lingua principale
Python
Stelle
883
Fork
291
Merge medio
3g 17h
PR unite (30g)
40

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di SpikeInterface/spikeinterface

Tutte le issue di SpikeInterface/spikeinterface

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.