Skip to content

Computation of unit_locations doesn't respect unit_id order #4328

@chrishalcrow

Description

@chrishalcrow

The computation of unit locations (actually the bug in is compute_monopolar_triangulation) assumes that when you give unit ids, they are in the same order as the analyzer's ids.

One way to see something is wrong is that changing the order of unit_ids gives the same result:

import spikeinterface.full as si
rec, sort = si.generate_ground_truth_recording(seed=1205)
sa = si.create_sorting_analyzer(sort, rec)
sa.compute(['random_spikes', 'templates'])
unit_locs_3_6 = sa.compute('unit_locations', unit_ids = ['3','6'])
unit_locs_6_3 = sa.compute('unit_locations', unit_ids = ['6','3'])

np.all(unit_locs_3_6.get_data() == unit_locs_6_3.get_data())
>>> True

Not a problem for most workflows: but is a problem when doing merges.

Fix is pretty easy, but want to extend the AnalyzerExtensionCommonTestSuite to check for this type of bug across the repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcurationRelated to curation modulepostprocessingRelated to postprocessing module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions