Remove `segment_index` from the spike vector(s)
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 32/100
- Tipo di issue
- Refactoring
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- numpy, python
- Ambito
- data, performance
Direzione di ricerca
Start with to_spike_vector(return_slices=True) in waveform_tools.py and review the linked usages in analyzer_extension_core.py and numpyextractors.py. Trace the repeated np.searchsorted calls across waveform_tools.py, basesorting.py, zarrextractors.py, sorting_tools.py, and remove_excess_spikes.py. Done means the segment index is removed, slices are used instead, and a compatibility path remains for saved sortings that contain the field.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I am reviewing #4809 (optimize SpikeRetriever and RAM usage for extensions) and I want to bring back the topic of simplifying the spike vector (time ordered and unit ordered) data model. A lot of the memory cost on @alejoe91's benchmark is the spike vector itself and of that 1/3 is the segment index and the segment index is unnecessary. This is an edge case (most recordings are not multi-segment) and the field is only a convenience, syntactic sugar. These are the main places where we use it:
-
To find the boundaries of a segment (the sorting already caches them as
segment_slices, seeto_spike_vector(return_slices=True)):
https://github.com/SpikeInterface/spikeinterface/blob/93c612f51cca09ecafe2c23a283132cf0ad57869/src/spikeinterface/core/waveform_tools.py#L357
The samenp.searchsortedis repeated three more times inwaveform_tools.pyand inbasesorting.py,zarrextractors.py,sorting_tools.pyandremove_excess_spikes.py. -
To mask the spikes of one unit in one segment (this could be a slice of the segment plus a mask on
unit_index):
https://github.com/SpikeInterface/spikeinterface/blob/93c612f51cca09ecafe2c23a283132cf0ad57869/src/spikeinterface/core/analyzer_extension_core.py#L131-L133 -
As a sort key when building a sorting from peaks (the slices could be computed once at construction instead):
https://github.com/SpikeInterface/spikeinterface/blob/93c612f51cca09ecafe2c23a283132cf0ad57869/src/spikeinterface/core/numpyextractors.py#L498
As a side effect this would remove the branching for the mono-segment case, like the special cases that #4809 adds to SpikeRetriever, PeakRetriever and _get_spike_vector_segment_slices.
The cost is a big refactor: using the slices wherever we rely on np.searchsorted (which I also think would be more efficient) and a compatibility path for the sortings that were saved with the field.
What do you think? Is there something I am missing?
- 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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di SpikeInterface/spikeinterface
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
SpikeInterface/spikeinterface#5008 ·
I maintainer di solito rispondono entro 2 giorni
-
`plot_potential_merges` draws the correlograms of other units when a merge group is not sortedAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
SpikeInterface/spikeinterface#5007 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
SpikeInterface/spikeinterface#5006 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
SpikeInterface/spikeinterface#5005 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
SpikeInterface/spikeinterface#5004 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di SpikeInterface/spikeinterface
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 69/100
daniel-ospina/tortoise#15308 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
difficulty:easy prio:low type:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
NatronGitHub/Natron#2405 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Jstar269/nakagawa-recomp#3746 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno