spikeinterface: `mountainsort5` failing due to change in `from_times_labels`

MRE

import spikeinterface.full as si
import probeinterface as pi
import numpy as np

recording, _ = si.generate_ground_truth_recording(durations=[600], sampling_frequency=30_000, num_channels=128)
# this code is for the Cambridge neurotech option to glue to probes together which naturally fits well with a probe group :)

probe = pi.get_probe("cambridgeneurotech", "ASSY-77-H5")
probe1 = probe.copy()
probe1.move([650,0])
wiring = np.arange(0,128)
multishank = pi.ProbeGroup()
multishank.add_probe(probe)
multishank.add_probe(probe1)
multishank.set_global_device_channel_indices(wiring)

recording = recording.set_probegroup(multishank)

# adding this because my normal work flow removes some channels based on bad impedance values.
# I don't know if this matters yet.
recording = recording.remove_channels(['10', '35', '67'])

ms_sorting = si.run_sorter_by_property(sorter_name="mountainsort5", recording=recording, grouping_property="group", folder='test')

Error

This fails with the following error

extract_snippets
    snippets[j] = traces[t1:t2]
    ~~~~~~~~^^^
ValueError: could not broadcast input array from shape (0,64) into shape (40,64)

But this happens no matter what data I’m working with (both simulated or real data). On version 0.102.1 this error does not happen.

Actual Problem

Not a clue yet. Unfortunately the error happens in sorting so I’m assuming something goes wrong either in channel slicing or in preprocessing. Mountainsort5 internally runs our bandpass_filter and our whiten so either of those functions since the update to preprocessing could be the problem. I need to run more tests. But I’m pretty busy today, so if someone else wants to pick this up too that would be great.

Environment

spikeinterface: main branch 
neo: main branch
numpy 1.26.0
scipy 1.11.3
python 3.11.6

EDIT typed out my script too fast… edited to fix 😃

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (15 by maintainers)

Most upvoted comments

Update. Shutting off filter and whiten in mountainsort5 did not fix the issue. Removing the remove_channels did not fix it.