Visitar URL original
Merge branch 'SpikeInterface:main' into main · SpikeInterface/spikeinterface@546b780 · GitHub
Skip to content

Commit 546b780

Browse files
authored
Merge branch 'SpikeInterface:main' into main
2 parents e9b6627 + 12b3470 commit 546b780

338 files changed

Lines changed: 14431 additions & 3626 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/scripts/check_kilosort4_releases.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import os
2-
import re
32
from pathlib import Path
43
import requests
54
import json
65
from packaging.version import parse
7-
import spikeinterface
6+
87

98
def get_pypi_versions(package_name):
109
"""
@@ -16,8 +15,10 @@ def get_pypi_versions(package_name):
1615
response.raise_for_status()
1716
data = response.json()
1817
versions = list(sorted(data["releases"].keys()))
19-
# Filter out versions that are less than 4.0.16
20-
versions = [ver for ver in versions if parse(ver) >= parse("4.0.16")]
18+
# Filter out versions that are less than 4.0.16 and different from 4.0.26 and 4.0.27
19+
# (buggy - https://github.com/MouseLand/Kilosort/releases/tag/v4.0.26)
20+
versions = [ver for ver in versions if parse(ver) >= parse("4.0.16") and
21+
parse(ver) not in [parse("4.0.26"), parse("4.0.27")]]
2122
return versions
2223

2324

‎.github/scripts/determine_testing_environment.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
elif changed_file.name == "nwbextractors.py":
4949
extractors_changed = True # There are NWB tests that are not streaming
5050
stream_extractors_changed = True
51-
elif changed_file.name == "iblextractors.py":
51+
elif changed_file.name == "iblextractors.py" or changed_file.name == "test_iblextractors.py":
5252
stream_extractors_changed = True
5353
elif "core" in changed_file.parts:
5454
core_changed = True

‎.github/scripts/test_kilosort4_ci.py‎

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
import pytest
2222
import copy
23-
from typing import Any
23+
from packaging.version import parse
2424
from inspect import signature
2525

2626
import numpy as np
@@ -84,8 +84,6 @@
8484
"duplicate_spike_ms": 0.3,
8585
}
8686

87-
PARAMS_TO_TEST = list(PARAMS_TO_TEST_DICT.keys())
88-
8987
PARAMETERS_NOT_AFFECTING_RESULTS = [
9088
"artifact_threshold",
9189
"ccg_threshold",
@@ -95,13 +93,24 @@
9593
"duplicate_spike_ms", # this is because ground-truth spikes don't have violations
9694
]
9795

98-
# THIS IS A PLACEHOLDER FOR FUTURE PARAMS TO TEST
99-
# if parse(version("kilosort")) >= parse("4.0.X"):
100-
# PARAMS_TO_TEST_DICT.update(
101-
# [
102-
# {"new_param": new_value},
103-
# ]
104-
# )
96+
97+
# Add/Remove version specific parameters
98+
if parse(kilosort.__version__) >= parse("4.0.22"):
99+
PARAMS_TO_TEST_DICT.update(
100+
{"position_limit": 50}
101+
)
102+
# Position limit only affects computing spike locations after sorting
103+
PARAMETERS_NOT_AFFECTING_RESULTS.append("position_limit")
104+
105+
if parse(kilosort.__version__) >= parse("4.0.24"):
106+
PARAMS_TO_TEST_DICT.update(
107+
{"max_peels": 200},
108+
)
109+
# max_peels is not affecting the results in this short dataset
110+
PARAMETERS_NOT_AFFECTING_RESULTS.append("max_peels")
111+
112+
113+
PARAMS_TO_TEST = list(PARAMS_TO_TEST_DICT.keys())
105114

106115

107116
class TestKilosort4Long:
@@ -249,17 +258,22 @@ def test_compute_preprocessing_arguments(self):
249258
self._check_arguments(compute_preprocessing, ["ops", "device", "tic0", "file_object"])
250259

251260
def test_compute_drift_location_arguments(self):
252-
self._check_arguments(
253-
compute_drift_correction, ["ops", "device", "tic0", "progress_bar", "file_object", "clear_cache"]
254-
)
261+
expected_arguments = ["ops", "device", "tic0", "progress_bar", "file_object", "clear_cache"]
262+
if parse(kilosort.__version__) >= parse("4.0.28"):
263+
expected_arguments += ["verbose"]
264+
self._check_arguments(compute_drift_correction, expected_arguments)
255265

256266
def test_detect_spikes_arguments(self):
257-
self._check_arguments(detect_spikes, ["ops", "device", "bfile", "tic0", "progress_bar", "clear_cache"])
267+
expected_arguments = ["ops", "device", "bfile", "tic0", "progress_bar", "clear_cache"]
268+
if parse(kilosort.__version__) >= parse("4.0.28"):
269+
expected_arguments += ["verbose"]
270+
self._check_arguments(detect_spikes, expected_arguments)
258271

259272
def test_cluster_spikes_arguments(self):
260-
self._check_arguments(
261-
cluster_spikes, ["st", "tF", "ops", "device", "bfile", "tic0", "progress_bar", "clear_cache"]
262-
)
273+
expected_arguments = ["st", "tF", "ops", "device", "bfile", "tic0", "progress_bar", "clear_cache"]
274+
if parse(kilosort.__version__) >= parse("4.0.28"):
275+
expected_arguments += ["verbose"]
276+
self._check_arguments(cluster_spikes, expected_arguments)
263277

264278
def test_save_sorting_arguments(self):
265279
expected_arguments = ["ops", "results_dir", "st", "clu", "tF", "Wall", "imin", "tic0", "save_extra_vars"]

‎.github/workflows/all-tests.yml‎

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ on:
1010
- main
1111

1212
env:
13-
KACHERY_CLOUD_CLIENT_ID: ${{ secrets.KACHERY_CLOUD_CLIENT_ID }}
14-
KACHERY_CLOUD_PRIVATE_KEY: ${{ secrets.KACHERY_CLOUD_PRIVATE_KEY }}
15-
KACHERY_ZONE: ${{ secrets.KACHERY_ZONE }}
13+
KACHERY_API_KEY: ${{ secrets.KACHERY_API_KEY }}
1614

1715
concurrency: # Cancel previous workflows on the same pull request
1816
group: ${{ github.workflow }}-${{ github.ref }}
@@ -25,7 +23,7 @@ jobs:
2523
strategy:
2624
fail-fast: false
2725
matrix:
28-
python-version: ["3.9", "3.12"] # Lower and higher versions we support
26+
python-version: ["3.9", "3.13"] # Lower and higher versions we support
2927
os: [macos-latest, windows-latest, ubuntu-latest]
3028
steps:
3129
- uses: actions/checkout@v4
@@ -36,7 +34,7 @@ jobs:
3634

3735
- name: Get changed files
3836
id: changed-files
39-
uses: tj-actions/changed-files@v41
37+
uses: tj-actions/changed-files@v46.0.1
4038

4139
- name: List all changed files
4240
shell: bash
@@ -76,6 +74,9 @@ jobs:
7674
pip install -e .[test_core]
7775
shell: bash
7876

77+
- name: Pip list
78+
run: pip list
79+
7980
- name: Test core
8081
run: pytest -m "core"
8182
shell: bash
@@ -136,93 +137,109 @@ jobs:
136137
if: env.RUN_EXTRACTORS_TESTS == 'true'
137138
run: |
138139
pip install -e .[extractors,streaming_extractors,test_extractors]
140+
pip list
139141
./.github/run_tests.sh "extractors and not streaming_extractors" --no-virtual-env
140142
141143
- name: Test streaming extractors
142144
shell: bash
143145
if: env.RUN_STREAMING_EXTRACTORS_TESTS == 'true'
144146
run: |
145147
pip install -e .[streaming_extractors,test_extractors]
148+
pip list
146149
./.github/run_tests.sh "streaming_extractors" --no-virtual-env
147150
148151
- name: Test preprocessing
149152
shell: bash
150153
if: env.RUN_PREPROCESSING_TESTS == 'true'
151154
run: |
152155
pip install -e .[preprocessing,test_preprocessing]
156+
pip list
153157
./.github/run_tests.sh "preprocessing and not deepinterpolation" --no-virtual-env
154158
155159
- name: Install remaining testing dependencies # TODO: Remove this step once we have better modularization
156160
shell: bash
157161
run: |
158162
pip install -e .[test]
163+
pip list
159164
160165
- name: Test postprocessing
161166
shell: bash
162167
if: env.RUN_POSTPROCESSING_TESTS == 'true'
163168
run: |
164169
pip install -e .[full]
170+
pip list
165171
./.github/run_tests.sh postprocessing --no-virtual-env
166172
167173
- name: Test quality metrics
168174
shell: bash
169175
if: env.RUN_QUALITYMETRICS_TESTS == 'true'
170176
run: |
171177
pip install -e .[qualitymetrics]
178+
pip list
172179
./.github/run_tests.sh qualitymetrics --no-virtual-env
173180
174181
- name: Test comparison
175182
shell: bash
176183
if: env.RUN_COMPARISON_TESTS == 'true'
177184
run: |
178185
pip install -e .[full]
186+
pip list
179187
./.github/run_tests.sh comparison --no-virtual-env
180188
181189
- name: Test core sorters
182190
shell: bash
183191
if: env.RUN_SORTERS_TESTS == 'true'
184192
run: |
185193
pip install -e .[full]
194+
pip list
186195
./.github/run_tests.sh sorters --no-virtual-env
187196
188197
- name: Test internal sorters
189198
shell: bash
190199
if: env.RUN_INTERNAL_SORTERS_TESTS == 'true'
191200
run: |
192201
pip install -e .[full]
202+
pip list
193203
./.github/run_tests.sh sorters_internal --no-virtual-env
194204
195205
- name: Test curation
196206
shell: bash
197207
if: env.RUN_CURATION_TESTS == 'true'
198208
run: |
199209
pip install -e .[full]
210+
pip list
200211
./.github/run_tests.sh curation --no-virtual-env
201212
202213
- name: Test widgets
203214
shell: bash
204215
if: env.RUN_WIDGETS_TESTS == 'true'
216+
env:
217+
KACHERY_ZONE: "scratch"
205218
run: |
206219
pip install -e .[full,widgets]
220+
pip list
207221
./.github/run_tests.sh widgets --no-virtual-env
208222
209223
- name: Test exporters
210224
shell: bash
211225
if: env.RUN_EXPORTERS_TESTS == 'true'
212226
run: |
213227
pip install -e .[full]
228+
pip list
214229
./.github/run_tests.sh exporters --no-virtual-env
215230
216231
- name: Test sortingcomponents
217232
shell: bash
218233
if: env.RUN_SORTINGCOMPONENTS_TESTS == 'true'
219234
run: |
220235
pip install -e .[full]
236+
pip list
221237
./.github/run_tests.sh sortingcomponents --no-virtual-env
222238
223239
- name: Test generation
224240
shell: bash
225241
if: env.RUN_GENERATION_TESTS == 'true'
226242
run: |
227243
pip install -e .[full]
244+
pip list
228245
./.github/run_tests.sh generation --no-virtual-env

‎.github/workflows/deepinterpolation.yml‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
python-version: '3.9'
2626
- name: Get changed files
2727
id: changed-files
28-
uses: tj-actions/changed-files@v41
28+
uses: tj-actions/changed-files@v46.0.1
2929
- name: Deepinteprolation changes
3030
id: modules-changed
3131
run: |
@@ -43,7 +43,12 @@ jobs:
4343
pip install tensorflow==2.7.0
4444
pip install deepinterpolation@git+https://github.com/AllenInstitute/deepinterpolation.git
4545
pip install protobuf==3.20.*
46+
pip install numpy==1.26.4
4647
pip install -e .[full,test_core]
48+
- name: Pip list
49+
if: ${{ steps.modules-changed.outputs.DEEPINTERPOLATION_CHANGED == 'true' }}
50+
run: |
51+
pip list
4752
- name: Test DeepInterpolation with pytest
4853
if: ${{ steps.modules-changed.outputs.DEEPINTERPOLATION_CHANGED == 'true' }}
4954
run: |

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ on:
66
- cron: "0 12 * * *" # Daily at noon UTC
77

88
env:
9-
KACHERY_CLOUD_CLIENT_ID: ${{ secrets.KACHERY_CLOUD_CLIENT_ID }}
10-
KACHERY_CLOUD_PRIVATE_KEY: ${{ secrets.KACHERY_CLOUD_PRIVATE_KEY }}
11-
KACHERY_ZONE: ${{ secrets.KACHERY_ZONE }}
9+
KACHERY_API_KEY: ${{ secrets.KACHERY_API_KEY }}
1210

1311
jobs:
1412
full-tests-with-codecov:
@@ -23,7 +21,7 @@ jobs:
2321
- uses: actions/checkout@v4
2422
- uses: actions/setup-python@v5
2523
with:
26-
python-version: '3.10'
24+
python-version: '3.12'
2725
- name: Get ephy_testing_data current head hash
2826
# the key depends on the last comit repo https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git
2927
id: vars
@@ -41,6 +39,8 @@ jobs:
4139
restore-keys: ${{ runner.os }}-datasets
4240
- name: Install packages
4341
uses: ./.github/actions/build-test-environment
42+
- name: Pip list
43+
run: pip list
4444
- name: run tests
4545
env:
4646
HDF5_PLUGIN_PATH: ${{ github.workspace }}/hdf5_plugin_path_maxwell

‎.github/workflows/issue-on-change-matlab.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
uses: actions/checkout@v4
1919
- name: Get changed files
2020
id: changed-files
21-
uses: tj-actions/changed-files@v41
21+
uses: tj-actions/changed-files@v46.0.1
2222
with:
2323
files: |
2424
**/*.m

‎.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
9-
rev: 24.10.0
9+
rev: 25.1.0
1010
hooks:
1111
- id: black
1212
files: ^src/

‎doc/api.rst‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ spikeinterface.core
2222
.. autofunction:: estimate_sparsity
2323
.. autoclass:: ChannelSparsity
2424
:members:
25+
.. autoclass:: Motion
26+
:members:
2527
.. autoclass:: BinaryRecordingExtractor
2628
.. autoclass:: ZarrRecordingExtractor
2729
.. autoclass:: BinaryFolderRecording
@@ -141,7 +143,9 @@ Non-NEO-based
141143
.. autofunction:: read_mcsh5
142144
.. autofunction:: read_mda_recording
143145
.. autofunction:: read_mda_sorting
144-
.. autofunction:: read_nwb
146+
.. autofunction:: read_nwb_sorting
147+
.. autofunction:: read_nwb_recording
148+
.. autofunction:: read_nwb_timeseries
145149
.. autofunction:: read_phy
146150
.. autofunction:: read_shybrid_recording
147151
.. autofunction:: read_shybrid_sorting
@@ -166,7 +170,7 @@ spikeinterface.preprocessing
166170
.. autofunction:: astype
167171
.. autofunction:: average_across_direction
168172
.. autofunction:: bandpass_filter
169-
.. autofunction:: blank_staturation
173+
.. autofunction:: blank_saturation
170174
.. autofunction:: center
171175
.. autofunction:: clip
172176
.. autofunction:: common_reference
@@ -277,8 +281,6 @@ spikeinterface.comparison
277281

278282
.. autoclass:: CollisionGTComparison
279283
.. autoclass:: CorrelogramGTComparison
280-
.. autoclass:: CollisionGTStudy
281-
.. autoclass:: CorrelogramGTStudy
282284

283285

284286

@@ -346,6 +348,9 @@ spikeinterface.curation
346348
.. autofunction:: remove_redundant_units
347349
.. autofunction:: remove_duplicated_spikes
348350
.. autofunction:: remove_excess_spikes
351+
.. autofunction:: load_model
352+
.. autofunction:: auto_label_units
353+
.. autofunction:: train_model
349354

350355
Deprecated
351356
~~~~~~~~~~
@@ -446,7 +451,6 @@ Motion Correction
446451
~~~~~~~~~~~~~~~~~
447452
.. automodule:: spikeinterface.sortingcomponents.motion
448453

449-
.. autoclass:: Motion
450454
.. autofunction:: estimate_motion
451455
.. autofunction:: interpolate_motion
452456
.. autofunction:: correct_motion_on_peaks

0 commit comments

Comments
 (0)