Skip to content

Commit 1f9fb98

Browse files
authored
Merge branch 'main' into support_python_3.13
2 parents 45d7c75 + 665adf8 commit 1f9fb98

53 files changed

Lines changed: 1728 additions & 684 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,20 @@
11
name: Install packages
22
description: This action installs the package and its dependencies for testing
33

4-
inputs:
5-
python-version:
6-
description: 'Python version to set up'
7-
required: false
8-
os:
9-
description: 'Operating system to set up'
10-
required: false
11-
124
runs:
135
using: "composite"
146
steps:
157
- name: Install dependencies
168
run: |
17-
sudo apt install git
189
git config --global user.email "CI@example.com"
1910
git config --global user.name "CI Almighty"
20-
python -m venv ${{ github.workspace }}/test_env # Environment used in the caching step
21-
python -m pip install -U pip # Official recommended way
22-
source ${{ github.workspace }}/test_env/bin/activate
2311
pip install tabulate # This produces summaries at the end
2412
pip install -e .[test,extractors,streaming_extractors,test_extractors,full]
2513
shell: bash
26-
- name: Force installation of latest dev from key-packages when running dev (not release)
27-
run: |
28-
source ${{ github.workspace }}/test_env/bin/activate
29-
spikeinterface_is_dev_version=$(python -c "import spikeinterface; print(spikeinterface.DEV_MODE)")
30-
if [ $spikeinterface_is_dev_version = "True" ]; then
31-
echo "Running spikeinterface dev version"
32-
pip install --no-cache-dir git+https://github.com/NeuralEnsemble/python-neo
33-
pip install --no-cache-dir git+https://github.com/SpikeInterface/probeinterface
34-
fi
35-
echo "Running tests for release, using pyproject.toml versions of neo and probeinterface"
14+
- name: Install git-annex
3615
shell: bash
37-
- name: git-annex install
3816
run: |
17+
pip install datalad-installer
3918
wget https://downloads.kitenet.net/git-annex/linux/current/git-annex-standalone-amd64.tar.gz
4019
mkdir /home/runner/work/installation
4120
mv git-annex-standalone-amd64.tar.gz /home/runner/work/installation/
@@ -44,4 +23,14 @@ runs:
4423
tar xvzf git-annex-standalone-amd64.tar.gz
4524
echo "$(pwd)/git-annex.linux" >> $GITHUB_PATH
4625
cd $workdir
26+
git config --global filter.annex.process "git-annex filter-process" # recommended for efficiency
27+
- name: Force installation of latest dev from key-packages when running dev (not release)
28+
run: |
29+
spikeinterface_is_dev_version=$(python -c "import spikeinterface; print(spikeinterface.DEV_MODE)")
30+
if [ $spikeinterface_is_dev_version = "True" ]; then
31+
echo "Running spikeinterface dev version"
32+
pip install --no-cache-dir git+https://github.com/NeuralEnsemble/python-neo
33+
pip install --no-cache-dir git+https://github.com/SpikeInterface/probeinterface
34+
fi
35+
echo "Running tests for release, using pyproject.toml versions of neo and probeinterface"
4736
shell: bash

.github/workflows/all-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
echo "$file was changed"
4848
done
4949
50-
- name: Set testing environment # This decides which tests are run and whether to install especial dependencies
50+
- name: Set testing environment # This decides which tests are run and whether to install special dependencies
5151
shell: bash
5252
run: |
5353
changed_files="${{ steps.changed-files.outputs.all_changed_files }}"

.github/workflows/full-test-with-codecov.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ jobs:
4545
env:
4646
HDF5_PLUGIN_PATH: ${{ github.workspace }}/hdf5_plugin_path_maxwell
4747
run: |
48-
source ${{ github.workspace }}/test_env/bin/activate
4948
pytest -m "not sorters_external" --cov=./ --cov-report xml:./coverage.xml -vv -ra --durations=0 | tee report_full.txt; test ${PIPESTATUS[0]} -eq 0 || exit 1
5049
echo "# Timing profile of full tests" >> $GITHUB_STEP_SUMMARY
5150
python ./.github/scripts/build_job_summary.py report_full.txt >> $GITHUB_STEP_SUMMARY

doc/development/development.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,25 @@ We use Sphinx to build the documentation. To build the documentation locally, yo
213213
214214
This will build the documentation in the :code:`doc/_build/html` folder. You can open the :code:`index.html` file in your browser to see the documentation.
215215

216+
Adding new documentation
217+
------------------------
218+
219+
Documentation can be added as a
220+
`sphinx-gallery <https://sphinx-gallery.github.io/stable/index.html>`_
221+
python file ('tutorials')
222+
or a
223+
`sphinx rst <https://sphinx-tutorial.readthedocs.io/step-1/>`_
224+
file (all other sections).
225+
226+
To add a new tutorial, add your ``.py`` file to ``spikeinterface/examples``.
227+
Then, update the ``spikeinterface/doc/tutorials_custom_index.rst`` file
228+
to make a new card linking to the page and an optional image. See
229+
``tutorials_custom_index.rst`` header for more information.
230+
231+
For other sections, write your documentation in ``.rst`` format and add
232+
the page to the appropriate ``index.rst`` file found in the relevant
233+
folder (e.g. ``how_to/index.rst``).
234+
216235
How to run code coverage locally
217236
--------------------------------
218237
To run code coverage locally, you can use the following command:

doc/get_started/quickstart.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ compute quality metrics (some quality metrics require certain extensions
673673
'min_spikes': 0,
674674
'window_size_s': 1},
675675
'snr': {'peak_mode': 'extremum', 'peak_sign': 'neg'},
676-
'synchrony': {'synchrony_sizes': (2, 4, 8)}}
676+
'synchrony': {}
677677
678678
679679
Since the recording is very short, let’s change some parameters to

doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ SpikeInterface is made of several modules to deal with different aspects of the
5151

5252
overview
5353
get_started/index
54-
tutorials/index
54+
tutorials_custom_index
5555
how_to/index
5656
modules/index
5757
api

doc/modules/qualitymetrics/synchrony.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ trains. This way synchronous events can be found both in multi-unit and single-u
1212
Complexity is calculated by counting the number of spikes (i.e. non-empty bins) that occur at the same sample index,
1313
within and across spike trains.
1414

15-
Synchrony metrics can be computed for different synchrony sizes (>1), defining the number of simultaneous spikes to count.
15+
Synchrony metrics are computed for 2, 4 and 8 synchronous spikes.
1616

1717

1818

@@ -29,7 +29,7 @@ Example code
2929
3030
import spikeinterface.qualitymetrics as sqm
3131
# Combine a sorting and recording into a sorting_analyzer
32-
synchrony = sqm.compute_synchrony_metrics(sorting_analyzer=sorting_analyzer synchrony_sizes=(2, 4, 8))
32+
synchrony = sqm.compute_synchrony_metrics(sorting_analyzer=sorting_analyzer)
3333
# synchrony is a tuple of dicts with the synchrony metrics for each unit
3434
3535

doc/tutorials_custom_index.rst

Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
.. This page provides a custom index to the 'Tutorials' page, rather than the default sphinx-gallery
2+
.. generated page. The benefits of this are flexibility in design and inclusion of non-sphinx files in the index.
3+
..
4+
.. To update this index with a new documentation page
5+
.. 1) Copy the grid-item-card and associated ".. raw:: html" section.
6+
.. 2) change :link: to a link to your page. If this is an `.rst` file, point to the rst file directly.
7+
.. If it is a sphinx-gallery generated file, format the path as separated by underscore and prefix `sphx_glr`,
8+
.. pointing to the .py file. e.g. `tutorials/my/page.py` -> `sphx_glr_tutorials_my_page.py
9+
.. 3) Change :img-top: to point to the thumbnail image of your choosing. You can point to images generated
10+
.. in the sphinx gallery page if you wish.
11+
.. 4) In the `html` section, change the `default-title` to your pages title and `hover-content` to the subtitle.
12+
13+
:orphan:
14+
15+
Tutorials
16+
============
17+
18+
Longer form tutorials about using SpikeInterface. Many of these are downloadable
19+
as notebooks or Python scripts so that you can "code along" with the tutorials.
20+
21+
If you're new to SpikeInterface, we recommend trying out the
22+
:ref:`get_started/quickstart:Quickstart tutorial` first.
23+
24+
Updating from legacy
25+
--------------------
26+
27+
.. toctree::
28+
:maxdepth: 1
29+
30+
tutorials/waveform_extractor_to_sorting_analyzer
31+
32+
Core tutorials
33+
--------------
34+
35+
These tutorials focus on the :py:mod:`spikeinterface.core` module.
36+
37+
.. grid:: 1 2 2 3
38+
:gutter: 2
39+
40+
.. grid-item-card:: Recording objects
41+
:link-type: ref
42+
:link: sphx_glr_tutorials_core_plot_1_recording_extractor.py
43+
:img-top: /tutorials/core/images/thumb/sphx_glr_plot_1_recording_extractor_thumb.png
44+
:img-alt: Recording objects
45+
:class-card: gallery-card
46+
:text-align: center
47+
48+
.. grid-item-card:: Sorting objects
49+
:link-type: ref
50+
:link: sphx_glr_tutorials_core_plot_2_sorting_extractor.py
51+
:img-top: /tutorials/core/images/thumb/sphx_glr_plot_2_sorting_extractor_thumb.png
52+
:img-alt: Sorting objects
53+
:class-card: gallery-card
54+
:text-align: center
55+
56+
.. grid-item-card:: Handling probe information
57+
:link-type: ref
58+
:link: sphx_glr_tutorials_core_plot_3_handle_probe_info.py
59+
:img-top: /tutorials/core/images/thumb/sphx_glr_plot_3_handle_probe_info_thumb.png
60+
:img-alt: Handling probe information
61+
:class-card: gallery-card
62+
:text-align: center
63+
64+
.. grid-item-card:: SortingAnalyzer
65+
:link-type: ref
66+
:link: sphx_glr_tutorials_core_plot_4_sorting_analyzer.py
67+
:img-top: /tutorials/core/images/thumb/sphx_glr_plot_4_sorting_analyzer_thumb.png
68+
:img-alt: SortingAnalyzer
69+
:class-card: gallery-card
70+
:text-align: center
71+
72+
.. grid-item-card:: Append and/or concatenate segments
73+
:link-type: ref
74+
:link: sphx_glr_tutorials_core_plot_5_append_concatenate_segments.py
75+
:img-top: /tutorials/core/images/thumb/sphx_glr_plot_5_append_concatenate_segments_thumb.png
76+
:img-alt: Append/Concatenate segments
77+
:class-card: gallery-card
78+
:text-align: center
79+
80+
.. grid-item-card:: Handle time information
81+
:link-type: ref
82+
:link: sphx_glr_tutorials_core_plot_6_handle_times.py
83+
:img-top: /tutorials/core/images/thumb/sphx_glr_plot_6_handle_times_thumb.png
84+
:img-alt: Handle time information
85+
:class-card: gallery-card
86+
:text-align: center
87+
88+
Extractors tutorials
89+
--------------------
90+
91+
The :py:mod:`spikeinterface.extractors` module is designed to load and save recorded and sorted data, and to handle probe information.
92+
93+
.. grid:: 1 2 2 3
94+
:gutter: 2
95+
96+
.. grid-item-card:: Read various formats
97+
:link-type: ref
98+
:link: sphx_glr_tutorials_extractors_plot_1_read_various_formats.py
99+
:img-top: /tutorials/extractors/images/thumb/sphx_glr_plot_1_read_various_formats_thumb.png
100+
:img-alt: Read various formats
101+
:class-card: gallery-card
102+
:text-align: center
103+
104+
.. grid-item-card:: Working with unscaled traces
105+
:link-type: ref
106+
:link: sphx_glr_tutorials_extractors_plot_2_working_with_unscaled_traces.py
107+
:img-top: /tutorials/extractors/images/thumb/sphx_glr_plot_2_working_with_unscaled_traces_thumb.png
108+
:img-alt: Unscaled traces
109+
:class-card: gallery-card
110+
:text-align: center
111+
112+
Quality metrics tutorial
113+
------------------------
114+
115+
The :code:`spikeinterface.qualitymetrics` module allows users to compute various quality metrics to assess the goodness of a spike sorting output.
116+
117+
.. grid:: 1 2 2 3
118+
:gutter: 2
119+
120+
.. grid-item-card:: Quality Metrics
121+
:link-type: ref
122+
:link: sphx_glr_tutorials_qualitymetrics_plot_3_quality_mertics.py
123+
:img-top: /tutorials/qualitymetrics/images/thumb/sphx_glr_plot_3_quality_mertics_thumb.png
124+
:img-alt: Quality Metrics
125+
:class-card: gallery-card
126+
:text-align: center
127+
128+
.. grid-item-card:: Curation Tutorial
129+
:link-type: ref
130+
:link: sphx_glr_tutorials_qualitymetrics_plot_4_curation.py
131+
:img-top: /tutorials/qualitymetrics/images/thumb/sphx_glr_plot_4_curation_thumb.png
132+
:img-alt: Curation Tutorial
133+
:class-card: gallery-card
134+
:text-align: center
135+
136+
Comparison tutorial
137+
-------------------
138+
139+
The :code:`spikeinterface.comparison` module allows you to compare sorter outputs or benchmark against ground truth.
140+
141+
.. grid:: 1 2 2 3
142+
:gutter: 2
143+
144+
.. grid-item-card:: Sorter Comparison
145+
:link-type: ref
146+
:link: sphx_glr_tutorials_comparison_plot_5_comparison_sorter_weaknesses.py
147+
:img-top: /tutorials/comparison/images/thumb/sphx_glr_plot_5_comparison_sorter_weaknesses_thumb.png
148+
:img-alt: Sorter Comparison
149+
:class-card: gallery-card
150+
:text-align: center
151+
152+
Widgets tutorials
153+
-----------------
154+
155+
The :code:`widgets` module contains several plotting routines (widgets) for visualizing recordings, sorting data, probe layout, and more.
156+
157+
.. grid:: 1 2 2 3
158+
:gutter: 2
159+
160+
.. grid-item-card:: RecordingExtractor Widgets
161+
:link-type: ref
162+
:link: sphx_glr_tutorials_widgets_plot_1_rec_gallery.py
163+
:img-top: /tutorials/widgets/images/thumb/sphx_glr_plot_1_rec_gallery_thumb.png
164+
:img-alt: Recording Widgets
165+
:class-card: gallery-card
166+
:text-align: center
167+
168+
.. grid-item-card:: SortingExtractor Widgets
169+
:link-type: ref
170+
:link: sphx_glr_tutorials_widgets_plot_2_sort_gallery.py
171+
:img-top: /tutorials/widgets/images/thumb/sphx_glr_plot_2_sort_gallery_thumb.png
172+
:img-alt: Sorting Widgets
173+
:class-card: gallery-card
174+
:text-align: center
175+
176+
.. grid-item-card:: Waveforms Widgets
177+
:link-type: ref
178+
:link: sphx_glr_tutorials_widgets_plot_3_waveforms_gallery.py
179+
:img-top: /tutorials/widgets/images/thumb/sphx_glr_plot_3_waveforms_gallery_thumb.png
180+
:img-alt: Waveforms Widgets
181+
:class-card: gallery-card
182+
:text-align: center
183+
184+
.. grid-item-card:: Peaks Widgets
185+
:link-type: ref
186+
:link: sphx_glr_tutorials_widgets_plot_4_peaks_gallery.py
187+
:img-top: /tutorials/widgets/images/thumb/sphx_glr_plot_4_peaks_gallery_thumb.png
188+
:img-alt: Peaks Widgets
189+
:class-card: gallery-card
190+
:text-align: center
191+
192+
Download All Examples
193+
---------------------
194+
195+
- :download:`Download all examples in Python source code </tutorials/tutorials_python.zip>`
196+
- :download:`Download all examples in Jupyter notebooks </tutorials/tutorials_jupyter.zip>`

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ authors = [
77
]
88
description = "Python toolkit for analysis, visualization, and comparison of spike sorting output"
99
readme = "README.md"
10-
requires-python = ">=3.9,<4.0"
10+
requires-python = ">=3.9,<3.13" # Only numpy 2.1 supported on python 3.13 for windows. We need to wait for fix on neo
1111
classifiers = [
1212
"Programming Language :: Python :: 3 :: Only",
1313
"License :: OSI Approved :: MIT License",
@@ -73,7 +73,7 @@ extractors = [
7373
]
7474

7575
streaming_extractors = [
76-
"ONE-api>=2.7.0", # alf sorter and streaming IBL
76+
"ONE-api>=2.7.0,<2.10.0", # alf sorter and streaming IBL
7777
"ibllib>=2.36.0", # streaming IBL
7878
# Following dependencies are for streaming with nwb files
7979
"pynwb>=2.6.0",

0 commit comments

Comments
 (0)