SpikeInterface / SpikeInterface/spikeinterface

Monopolar triangulation for compute('unit_locations') is inconsistent with compute('spike_locations')

Open
#4,486 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

postprocessing
Dominant language
Python
Stars
847
Forks
280
Avg merge
3d 9h
Merged PRs (30d)
29

Description

compute_monopolar_triangulation() from localization_tools:
https://github.com/SpikeInterface/spikeinterface/blob/6b476031da1edbfc94d7adcb075f87347313ffc7/src/spikeinterface/postprocessing/localization_tools.py#L18-L27
is used for analyzer.compute('unit_locations') while LocalizeMonopolarTriangulation from sortincomponents.peak_localization
https://github.com/SpikeInterface/spikeinterface/blob/6b476031da1edbfc94d7adcb075f87347313ffc7/src/spikeinterface/sortingcomponents/peak_localization/monopolar.py#L45-L55
is used for motion correction and analyzer.compute('spike_locations').

The issue is that they have different default arguments (as can be seen above). Is that intended? I would think the args from LocalizeMonopolarTriangulation (which use more bells and whistles) make more sense overall.

A separate issue is that enforce_decrease has no effect in compute_monopolar_triangulation (it is just commented out)
https://github.com/SpikeInterface/spikeinterface/blob/6b476031da1edbfc94d7adcb075f87347313ffc7/src/spikeinterface/postprocessing/localization_tools.py#L118-L121
Is that also intended? Either it should be uncommented or the argument dropped.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare compute_monopolar_triangulation() in src/spikeinterface/postprocessing/localization_tools.py with LocalizeMonopolarTriangulation in src/spikeinterface/sortingcomponents/peak_localization/monopolar.py, focusing on their default arguments. Inspect the enforce_decrease handling around localization_tools.py lines 118-121. Done means the intended defaults and enforce_decrease behavior are decided and the two computation paths are consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.