Skip to content

Commit a861af7

Browse files
committed
solve conflicts
2 parents 2432ef6 + f632aa7 commit a861af7

385 files changed

Lines changed: 6194 additions & 2939 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/all-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ jobs:
105105
run: echo "dataset_hash=$(git ls-remote https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git HEAD | cut -f1)" >> $GITHUB_OUTPUT
106106

107107
- name: Cache datasets
108-
if: env.RUN_EXTRACTORS_TESTS == 'true'
108+
if: env.RUN_EXTRACTORS_TESTS == 'true' || env.RUN_PREPROCESSING_TESTS == 'true'
109109
id: cache-datasets
110110
uses: actions/cache/restore@v4
111111
with:
@@ -115,7 +115,7 @@ jobs:
115115

116116
- name: Install git-annex
117117
shell: bash
118-
if: env.RUN_EXTRACTORS_TESTS == 'true'
118+
if: env.RUN_EXTRACTORS_TESTS == 'true' || env.RUN_PREPROCESSING_TESTS == 'true'
119119
run: |
120120
pip install datalad-installer
121121
if [ ${{ runner.os }} = 'Linux' ]; then

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ examples/modules_gallery/**/*.zarr
141141

142142
# Files and folders generated during tests
143143
test_folder/
144+
*trained_pipeline/
144145

145146
# Mac OS
146147
.DS_Store
147148
test_data.json
149+
uv.lock

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ repos:
66
- id: end-of-file-fixer
77
- id: trailing-whitespace
88
- repo: https://github.com/psf/black-pre-commit-mirror
9-
rev: 26.1.0
9+
rev: 26.3.1
1010
hooks:
1111
- id: black
1212
files: ^src/

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,18 @@
4646

4747
[![Twitter](https://img.shields.io/badge/@spikeinterface-%231DA1F2.svg?style=for-the-badge&logo=Twitter&logoColor=white)](https://twitter.com/spikeinterface) [![Mastodon](https://img.shields.io/badge/-@spikeinterface-%232B90D9?style=for-the-badge&logo=mastodon&logoColor=white)](https://fosstodon.org/@spikeinterface)
4848

49+
Please [Star](https://github.com/SpikeInterface/spikeinterface/stargazers) the project to support us and [Watch](https://github.com/SpikeInterface/spikeinterface/subscription) to always stay up-to-date!
4950

50-
SpikeInterface is a Python framework designed to unify preexisting spike sorting technologies into a single code base.
51+
SpikeInterface is a Python package designed to unify preexisting spike sorting technologies into a single code base. If you use SpikeInterface, you are also using code and ideas from many other projects. Our codebase would be tiny without the amazing algorithms and formats that we interface with. See them all, and how to cite them, on our [references page](https://spikeinterface.readthedocs.io/en/latest/references.html). In the past year, we have added support for the following tools:
5152

52-
Please [Star](https://github.com/SpikeInterface/spikeinterface/stargazers) the project to support us and [Watch](https://github.com/SpikeInterface/spikeinterface/subscription) to always stay up-to-date!
53+
- Bombcell [Bombcell: automated curation and cell classification of spike-sorted electrophysiology data](https://doi.org/10.5281/zenodo.8172822>) ([docs](https://spikeinterface.readthedocs.io/en/latest/how_to/auto_label_units.html#bombcell))
54+
- SLAy. [SLAy-ing oversplitting errors in high-density electrophysiology spike sorting](https://www.biorxiv.org/content/10.1101/2025.06.20.660590v2) ([docs](https://spikeinterface.readthedocs.io/en/latest/modules/curation.html#auto-merging-units))
55+
- Lupin, Spykingcicus2 and Tridesclous2. [Opening the black box: a modular approach to spike sorting](https://www.biorxiv.org/content/10.64898/2026.01.23.701239v1) ([docs](https://spikeinterface.readthedocs.io/en/stable/modules/sorters.html#supported-spike-sorters))
56+
- rtsort. [RT-Sort: An action potential propagation-based algorithm for real time spike detection and sorting with millisecond latencies](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0312438) ([docs](https://spikeinterface.readthedocs.io/en/stable/modules/sorters.html#supported-spike-sorters))
57+
- MEDiCINe. [MEDiCINe: Motion Correction for Neural Electrophysiology Recordings](https://www.eneuro.org/content/12/3/ENEURO.0529-24.2025) ([docs](https://spikeinterface.readthedocs.io/en/latest/how_to/handle_drift.html))
58+
- UnitRefine. [UnitRefine: A Community Toolbox for Automated Spike Sorting Curation](https://www.biorxiv.org/content/10.1101/2025.03.30.645770v2) ([docs](https://spikeinterface.readthedocs.io/en/latest/tutorials_custom_index.html#automated-curation-tutorials))
5359

60+
If you would like us to add another tool, or you would like to integrate your project with our package, please [open an issue](https://github.com/SpikeInterface/spikeinterface/issues).
5461

5562
With SpikeInterface, users can:
5663

doc/api.rst

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,33 @@ spikeinterface.core
88
.. autofunction:: load
99
.. autoclass:: BaseRecording
1010
:members:
11+
.. automethod:: BaseRecording.save
12+
.. automethod:: BaseRecording.save_to_memory
13+
.. automethod:: BaseRecording.save_to_folder
14+
.. automethod:: BaseRecording.save_to_zarr
15+
.. automethod:: BaseRecording.dump
16+
.. automethod:: BaseRecording.dump_to_json
17+
.. automethod:: BaseRecording.dump_to_pickle
18+
.. automethod:: BaseRecording.remove_channels
1119
.. autoclass:: BaseSorting
1220
:members:
21+
.. automethod:: BaseSorting.save
22+
.. automethod:: BaseSorting.save_to_memory
23+
.. automethod:: BaseSorting.save_to_folder
24+
.. automethod:: BaseSorting.save_to_zarr
25+
.. automethod:: BaseSorting.dump
26+
.. automethod:: BaseSorting.dump_to_json
27+
.. automethod:: BaseSorting.dump_to_pickle
1328
.. autoclass:: BaseSnippets
1429
:members:
30+
.. automethod:: BaseSnippets.save
31+
.. automethod:: BaseSnippets.save_to_memory
32+
.. automethod:: BaseSnippets.save_to_folder
33+
.. automethod:: BaseSnippets.save_to_zarr
34+
.. automethod:: BaseSnippets.dump
35+
.. automethod:: BaseSnippets.dump_to_json
36+
.. automethod:: BaseSnippets.dump_to_pickle
37+
.. automethod:: BaseSnippets.remove_channels
1538
.. autoclass:: BaseEvent
1639
:members:
1740
.. autoclass:: SortingAnalyzer
@@ -204,6 +227,7 @@ spikeinterface.preprocessing
204227
.. autofunction:: remove_artifacts
205228
.. autofunction:: resample
206229
.. autofunction:: scale
230+
.. autofunction:: scale_to_uV
207231
.. autofunction:: silence_periods
208232
.. autofunction:: unsigned_to_signed
209233
.. autofunction:: whiten
@@ -287,8 +311,6 @@ spikeinterface.comparison
287311
.. autofunction:: compare_sorter_to_ground_truth
288312
.. autofunction:: compare_templates
289313
.. autofunction:: compare_multiple_templates
290-
.. autofunction:: create_hybrid_units_recording
291-
.. autofunction:: create_hybrid_spikes_recording
292314

293315
.. autoclass:: GroundTruthComparison
294316
:members:
@@ -375,6 +397,8 @@ spikeinterface.curation
375397
.. autofunction:: remove_duplicated_spikes
376398
.. autofunction:: remove_excess_spikes
377399
.. autofunction:: threshold_metrics_label_units
400+
.. autofunction:: bombcell_label_units
401+
.. autofunction:: bombcell_get_default_thresholds
378402
.. autofunction:: model_based_label_units
379403
.. autofunction:: load_model
380404
.. autofunction:: train_model
@@ -388,7 +412,7 @@ such as merging and splitting units, as well as defining labels for units.
388412

389413
.. automodule:: spikeinterface.curation.curation_model
390414

391-
.. autopydantic_model:: CurationModel
415+
.. autopydantic_model:: Curation
392416
.. autopydantic_model:: Merge
393417
.. autopydantic_model:: Split
394418
.. autopydantic_model:: ManualLabel

doc/development/development.rst

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,74 @@ Note, however, that the running time of the command above will be quite long. If
248248
249249
pytest src/spikeinterface/core/ --cov=spikeinterface/core --cov-report html
250250
251+
252+
Integrate your software with SpikeInterface
253+
-------------------------------------------
254+
255+
You've made a great analysis tool for ephys data - congrats! It's popular and people are using it.
256+
Why would you integrate it into SpikeInterface? And how can do you do that?
257+
258+
Why integrate it
259+
^^^^^^^^^^^^^^^^
260+
261+
SpikeInterface is designed to allow users to 1) read in any recording format 2) apply a wide variety
262+
of preprocessing steps to the recording 3) run any sorter on the data 4) compute standard
263+
postprocessing data about the sorting (and more!!). We work hard to be general and allow users to do
264+
anything they'd like with their data. Hence if your tool works with SpikeInterface, it works with an
265+
enormous array of possible analysis pipelines.
266+
267+
When they're first written, analysis tools are usually designed in a specific lab and are tested
268+
with a small number of collaborators and datasets. It's technically difficult to design a tool
269+
which can be applied to data from a wide variety of devices, set-ups and sorters. There are many
270+
edge cases and "gotcha"s to consider. But the SpikeInterface team have extensive experience with
271+
exactly this problem. We know how to write code so that it doesn't depend on data-specific or
272+
sorter-specific quirks. Hence we can help generalize the tool and widen its potential userbase.
273+
274+
Often, the first step when using an analysis tool is to wrangle the data into a specific format:
275+
"please save your recording to a binary file which is preprocessed in a certain way" or "ensure your
276+
sorting output is in this format". SpikeInterface deals with this painful data wrangling for you: we
277+
load many formats and internally represent them in a consistent way. We also apply all preprocessing
278+
steps lazily, meaning that users never need to save a copy of a preprocessed recording: they can work
279+
directly from the raw recording. We believe this reduces the barrier to entry for the end user, which
280+
makes your tool more likely to be used by many researchers.
281+
282+
How to integrate it
283+
^^^^^^^^^^^^^^^^^^^
284+
285+
If you'd like to integrate your tool into SpikeInterface: amazing! Just
286+
`raise an issue <https://github.com/SpikeInterface/spikeinterface/issues>`_. There are two main ways
287+
to integrate your software into SpikeInterface.
288+
289+
1) Wrapping
290+
291+
You keep your code in your own codebase, and write a thin wrapper in SpikeInterface which interacts
292+
with your library. Most external sorters that SpikeInterface can call are organized in this way. To
293+
use the tool, the user will have to install your package and the maintenance of the software is primarily
294+
on your shoulders.
295+
296+
2) Integration
297+
298+
You re-implement your code and add it to the SpikeInterface package. Many preprocessing steps, motion
299+
correction algorithms and postprocessing steps are implemented like this. Your method and code become
300+
part of the SpikeInterface package and we take on the maintenance burden (with your help, we hope!).
301+
302+
In this case, we don't expect the re-implementation to be a perfect copy of the code, since we may need
303+
to change the code to work for a more general set of data.
304+
305+
306+
Credit and Citation
307+
^^^^^^^^^^^^^^^^^^^
308+
309+
We want to ensure the tools that SpikeInterface wrap and integrate are properly cited. We'll ensure that
310+
credit is given when the tool is mentioned in the docs, in the docstring of the function, and we will
311+
add it to the :doc:`../references` page. When added, we will include your software on the front-page of
312+
the SpikeInterface GitHub for at least 1 year. If we fail to cite you properly, this is certainly a mistake.
313+
Please `raise an issue <https://github.com/SpikeInterface/spikeinterface/issues>`_.
314+
315+
See all the packages and projects which have been wrapped or integrated into SpikeInterface in our
316+
:doc:`../references` page.
317+
318+
251319
Implement a new extractor
252320
-------------------------
253321

doc/get_started/quickstart.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ object to disk.
247247
248248
249249
To reload a preprocessed recording that was saved to disk, you can use
250-
``load_extractor()`` function from the ``core`` module.
250+
``load()`` function from the ``core`` module.
251251

252252
Now you are ready to spike sort using the ``spikeinterface.sorters``
253253
module! Let’s first check which sorters are implemented and which are

0 commit comments

Comments
 (0)