spikeinterface
spikeinterface copied to clipboard
Improve performance on `generate_unit_locations`
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.