spikeinterface icon indicating copy to clipboard operation
spikeinterface copied to clipboard

Improve performance on `generate_unit_locations`

Open h-mayorquin opened this issue 5 months ago • 0 comments

Currently the generate_unic_locations enforces the unit constrain with a simple rejection sampling algorithm that is non-deterministic:

https://github.com/SpikeInterface/spikeinterface/blob/55c7de1f2762315af406b5131b5bf0da5fd5767c/src/spikeinterface/core/generate.py#L2007-L2029

But I think this is a clear use case for the Bridson's algorithm for sampling on a poison disk with is log(N)

https://www.cs.ubc.ca/~rbridson/docs/bridson-siggraph07-poissondisk.pdf

  • [ ] Time the current implementation for some channel locations
  • [ ] Implement Bridson algorithm in Python
  • [ ] Profile it.

This is a good first issue.

h-mayorquin avatar Sep 16 '24 20:09 h-mayorquin