Skip to content

Commit

Permalink
Solve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
alejoe91 committed Nov 27, 2023
2 parents 65cd12e + 1ee7053 commit 273766b
Show file tree
Hide file tree
Showing 97 changed files with 1,916 additions and 1,098 deletions.
43 changes: 18 additions & 25 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ spikeinterface.comparison
.. autofunction:: compare_sorter_to_ground_truth
.. autofunction:: compare_templates
.. autofunction:: compare_multiple_templates
.. autofunction:: aggregate_performances_table
.. autofunction:: create_hybrid_units_recording
.. autofunction:: create_hybrid_spikes_recording

Expand Down Expand Up @@ -272,12 +271,22 @@ spikeinterface.widgets
.. autofunction:: set_default_plotter_backend
.. autofunction:: get_default_plotter_backend

.. autofunction:: plot_agreement_matrix
.. autofunction:: plot_all_amplitudes_distributions
.. autofunction:: plot_amplitudes
.. autofunction:: plot_autocorrelograms
.. autofunction:: plot_confusion_matrix
.. autofunction:: plot_comparison_collision_by_similarity
.. autofunction:: plot_crosscorrelograms
.. autofunction:: plot_isi_distribution
.. autofunction:: plot_motion
.. autofunction:: plot_multicomparison_agreement
.. autofunction:: plot_multicomparison_agreement_by_sorter
.. autofunction:: plot_multicomparison_graph
.. autofunction:: plot_peak_activity
.. autofunction:: plot_probe_map
.. autofunction:: plot_quality_metrics
.. autofunction:: plot_rasters
.. autofunction:: plot_sorting_summary
.. autofunction:: plot_spike_locations
.. autofunction:: plot_spikes_on_traces
Expand All @@ -286,34 +295,18 @@ spikeinterface.widgets
.. autofunction:: plot_traces
.. autofunction:: plot_unit_depths
.. autofunction:: plot_unit_locations
.. autofunction:: plot_unit_presence
.. autofunction:: plot_unit_probe_map
.. autofunction:: plot_unit_summary
.. autofunction:: plot_unit_templates
.. autofunction:: plot_unit_waveforms_density_map
.. autofunction:: plot_unit_waveforms


Legacy widgets
~~~~~~~~~~~~~~

These widgets are only available with the "matplotlib" backend

.. automodule:: spikeinterface.widgets
:noindex:

.. autofunction:: plot_rasters
.. autofunction:: plot_probe_map
.. autofunction:: plot_isi_distribution
.. autofunction:: plot_peak_activity_map
.. autofunction:: plot_principal_component
.. autofunction:: plot_unit_probe_map
.. autofunction:: plot_confusion_matrix
.. autofunction:: plot_agreement_matrix
.. autofunction:: plot_multicomp_graph
.. autofunction:: plot_multicomp_agreement
.. autofunction:: plot_multicomp_agreement_by_sorter
.. autofunction:: plot_comparison_collision_pair_by_pair
.. autofunction:: plot_comparison_collision_by_similarity
.. autofunction:: plot_sorting_performance
.. autofunction:: plot_study_run_times
.. autofunction:: plot_study_unit_counts
.. autofunction:: plot_study_performances
.. autofunction:: plot_study_agreement_matrix
.. autofunction:: plot_study_summary
.. autofunction:: plot_study_comparison_collision_by_similarity


spikeinterface.exporters
Expand Down
81 changes: 81 additions & 0 deletions doc/import.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
Importing SpikeInterface
========================

SpikeInterface allows for the generation of powerful and reproducible spike sorting pipelines.
Flexibility is built into the package starting from import to maximize the productivity of
the developer and the scientist. Thus there are three ways that SpikeInterface and its components
can be imported:


Importing by Module
-------------------

Since each spike sorting pipeline involves a series of often repeated steps, many of the developers
working on SpikeInterface recommend importing in a module by module fashion. This will allow you to
keep track of your processing steps (preprocessing, postprocessing, quality metrics, etc.). This can
be accomplished by:

.. code-block:: python
import spikeinterface.core as si
to import the :code:`core` module followed by:

.. code-block:: python
import spikeinterface.extractors as se
import spikeinterface.preprocessing as spre
import spikeinterface.sorters as ss
import spikinterface.postprocessing as spost
import spikeinterface.qualitymetrics as sqm
import spikeinterface.exporters as sexp
import spikeinterface.comparsion as scmp
import spikeinterface.curation as scur
import spikeinterface.sortingcomponents as sc
import spikeinterface.widgets as sw
to import any of the other modules you wish to use.

The benefit of this approach is that it is lighter than importing the whole library as a flat module and allows
you to choose which of the modules you actually want to use. It also reminds you what step of the pipeline each
submodule is meant to be used for. If you don't plan to export the results out of SpikeInterface then you
don't have to :code:`import spikeinterface.exporters`. Additionally the documentation of SpikeInterface is set-up
in a modular fashion, so if you have a problem with the submodule :code:`spikeinterface.curation`,you will know
to go to the :code:`curation` section of this documention. The disadvantage of this approach is that you have
more aliases to keep track of.


Flat Import
-----------

A second option is to import the SpikeInterface package in :code:`full` mode.
To accomplish this one does:


.. code-block:: python
import spikeinterface.full as si
This import statement will import all of the SpikeInterface modules as one flattened module.
We recommend this approach for advanced (or lazy) users, since it requires a deeper knowledge of the API. The advantage
being that users can access all functions using one alias without the need of memorizing all aliases.


Importing Individual Functions
------------------------------

Finally, some users may find it useful to have extremely light imports and only import the exact functions
they plan to use. This can easily be accomplished by importing functions directly into the name space.

For example:

.. code-block:: python
from spikeinterface.preprocessing import bandpass_filter, common_reference
from spikeinterface.core import extract_waveforms
from spikeinterface.extractors import read_binary
As mentioned this approach only imports exactly what you plan on using so it is the most minimalist. It does require
knowledge of the API to know which module to pull a function from. It could also lead to naming clashes if pulling
functions directly from other scientific libraries. Type :code:`import this` for more information.
1 change: 1 addition & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ SpikeInterface is made of several modules to deal with different aspects of the

overview
installation
import
modules/index
how_to/index
modules_gallery/index
Expand Down
76 changes: 49 additions & 27 deletions doc/install_sorters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ Some novel spike sorting algorithms are implemented directly in SpikeInterface u
:py:mod:`spikeinterface.sortingcomponents` module. Checkout the :ref:`si_based` section of this page
for more information!

If you experience installation problems please directly contact the authors of theses tools or write on the
related mailing list, google group, etc.
If you experience installation problems please directly contact the authors of these tools or write on the
related mailing list, google group, GitHub issue page, etc.

Please feel free to enhance this document with more installation tips.

Expand Down Expand Up @@ -251,31 +251,6 @@ Combinato
# or using CombinatoSorter.set_combinato_path()


Klusta (LEGACY)
^^^^^^^^^^^^^^^

* Python
* Requires SpikeInterface<0.96.0 (and Python 3.7)
* Url: https://github.com/kwikteam/klusta
* Authors: Cyrille Rossant, Shabnam Kadir, Dan Goodman, Max Hunter, Kenneth Harris
* Installation::

pip install Cython h5py tqdm
pip install click klusta klustakwik2

* See also: https://github.com/kwikteam/phy


Yass (LEGACY)
^^^^^^^^^^^^^

* Python, CUDA, torch
* Requires SpikeInterface<0.96.0 (and Python 3.7)
* Url: https://github.com/paninski-lab/yass
* Authors: JinHyung Lee, Catalin Mitelut, Liam Paninski
* Installation::

https://github.com/paninski-lab/yass/wiki/Installation-Local


.. _si_based:
Expand All @@ -302,3 +277,50 @@ working not only at peak times but at all times, recovering more spikes close to
pip install hdbscan
pip install spikeinterface
pip install numba (or conda install numba as recommended by conda authors)


Tridesclous2
^^^^^^^^^^^^

This is an upgraded version of Tridesclous, natively written in SpikeInterface.
#Same add his notes.

* Python
* Requires: HDBSCAN and Numba
* Authors: Samuel Garcia
* Installation::

pip install hdbscan
pip install spikeinterface
pip install numba



Legacy Sorters
--------------

Klusta (LEGACY)
^^^^^^^^^^^^^^^

* Python
* Requires SpikeInterface<0.96.0 (and Python 3.7)
* Url: https://github.com/kwikteam/klusta
* Authors: Cyrille Rossant, Shabnam Kadir, Dan Goodman, Max Hunter, Kenneth Harris
* Installation::

pip install Cython h5py tqdm
pip install click klusta klustakwik2

* See also: https://github.com/kwikteam/phy


Yass (LEGACY)
^^^^^^^^^^^^^

* Python, CUDA, torch
* Requires SpikeInterface<0.96.0 (and Python 3.7)
* Url: https://github.com/paninski-lab/yass
* Authors: JinHyung Lee, Catalin Mitelut, Liam Paninski
* Installation::

https://github.com/paninski-lab/yass/wiki/Installation-Local
12 changes: 8 additions & 4 deletions doc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ To install the current release version, you can use:
The :code:`[full]` option installs all the extra dependencies for all the different sub-modules.

Note that if using Z shell (:code:`zsh` - the default shell on mac), you will need to use quotes (:code:`pip install "spikeinterface[full]"`).
Note that if using Z shell (:code:`zsh` - the default shell on macOS), you will need to use quotes (:code:`pip install "spikeinterface[full]"`).


To install all interactive widget backends, you can use:
Expand Down Expand Up @@ -63,14 +63,14 @@ as :code:`spikeinterface` strongly relies on these packages to interface with va
It is also sometimes useful to have local copies of :code:`neo` and :code:`probeinterface` to make changes to the code. To achieve this, repeat the first set of commands,
replacing `https://github.com/SpikeInterface/spikeinterface.git` with the appropriate repository in the first code block of this section.
replacing :code:`https://github.com/SpikeInterface/spikeinterface.git` with the appropriate repository in the first code block of this section.

For beginners
-------------

We provide some installation tips for beginners in Python here:

https://github.com/SpikeInterface/spikeinterface/tree/master/installation_tips
https://github.com/SpikeInterface/spikeinterface/tree/main/installation_tips



Expand All @@ -89,12 +89,16 @@ Requirements
Sub-modules have more dependencies, so you should also install:

* zarr
* h5py
* scipy
* pandas
* xarray
* sklearn
* scikit-learn
* networkx
* matplotlib
* numba
* distinctipy
* cuda-python (for non-macOS users)


All external spike sorters can be either run inside containers (Docker or Singularity - see :ref:`containerizedsorters`)
Expand Down
Loading

0 comments on commit 273766b

Please sign in to comment.