`plot_isi_distribution` adds the per-segment densities with several segments
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 83/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- matplotlib, numpy, python
- Área
- data-visualization
Línea de trabajo
Empieza con widgets/isi_distribution.py e inspecciona el bucle que calcula y combina el histograma de cada segmento. El issue sugiere sumar los recuentos con density=False y normalizar una vez después del bucle; usa los dos ejemplos proporcionados para comprobar que el área total es 1 y que un segmento con un solo pico produce barras finitas. La persona que reportó el issue se ofrece a añadir una prueba, pero no se nombra ningún archivo de prueba.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
I found this while reading widgets/isi_distribution.py, not in my own analyses, so this is a "for the sake of improvement" report.
With several segments, the histogram of each segment is computed with density=True and the densities are added (there is a TODO about this in the loop). The area is then the number of segments, and a segment with 10 spikes weighs as much as one with 5000, without an error. If one segment has a single spike, all the bars of the unit are NaN.
import matplotlib
matplotlib.use("Agg")
import numpy as np
from spikeinterface.core import NumpySorting
from spikeinterface.widgets import plot_isi_distribution
rng = np.random.default_rng(0)
seg0 = np.cumsum(rng.integers(150, 600, 5000)) # 5000 spikes, ISI 5-20 ms
seg1 = np.cumsum(rng.integers(2100, 2700, 10)) # 10 spikes, ISI 70-90 ms
sorting = NumpySorting.from_unit_dict([{0: seg0}, {0: seg1}], sampling_frequency=30000.0)
w = plot_isi_distribution(sorting, window_ms=100.0, bin_ms=1.0)
heights = np.array([bar.get_height() for bar in w.axes.flatten()[0].patches])
print("area:", heights.sum() * 1.0)
# area: 2.0 expected 1.0
print("fraction of ISI in 70-90 ms:", heights[70:90].sum() / heights.sum())
# fraction of ISI in 70-90 ms: 0.5 expected about 0.002 (9 of 5008 intervals)
sorting = NumpySorting.from_unit_dict([{0: seg0}, {0: seg1[:1]}], sampling_frequency=30000.0)
w = plot_isi_distribution(sorting, window_ms=100.0, bin_ms=1.0)
heights = np.array([bar.get_height() for bar in w.axes.flatten()[0].patches])
print("finite bars:", np.isfinite(heights).sum(), "of", heights.size)
# finite bars: 0 of 99 expected 99 of 99
Fix: add the counts of all segments with density=False and normalize once after the loop.
I can open a PR with a test if you agree.
- Lenguaje dominante
- Python
- Estrellas
- 883
- Forks
- 291
- Merge medio
- 3 d 17 h
- PR fusionados (30 d)
- 40
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de SpikeInterface/spikeinterface
-
`plot_potential_merges` draws the correlograms of other units when a merge group is not sortedAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
SpikeInterface/spikeinterface#5007 ·
Los mantenedores suelen responder en 2 días
-
`plot_unit_presence` shows bin indices on the `Time (s)` axis when `time_range` is not givenAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
SpikeInterface/spikeinterface#5006 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
SpikeInterface/spikeinterface#5005 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
SpikeInterface/spikeinterface#5004 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
SpikeInterface/spikeinterface#5003 ·
Los mantenedores suelen responder en 2 días
Todos los issues de SpikeInterface/spikeinterface
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
available bug good first issue tooling
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Nixitov/Riptide-Native#816 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
teng-lin/notebooklm-py#2593 ·
Los mantenedores suelen responder en 1 día
-
claimed-by:collie role:small-fix status:running
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Beovulfo/herd-sdlc#325 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
good first issue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 94/100
omarelshamy25x/shamy-arabic-nlp#267 ·
Los mantenedores suelen responder en 1 día