Skip to content

Commit d599b0b

Browse files
committed
Merge branch 'main' of github.com:SpikeInterface/spikeinterface into refactor_GTStudy
2 parents d8229db + 4ab6223 commit d599b0b

38 files changed

Lines changed: 1368 additions & 327 deletions

doc/development/development.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,17 @@ so that the user knows what the options are.
189189
Miscelleaneous Stylistic Conventions
190190
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
191191

192-
#. Avoid using abreviations in variable names (e.g., use :code:`recording` instead of :code:`rec`). It is especially important to avoid single letter variables.
192+
#. Avoid using abbreviations in variable names (e.g. use :code:`recording` instead of :code:`rec`). It is especially important to avoid single letter variables.
193193
#. Use index as singular and indices for plural following the NumPy convention. Avoid idx or indexes. Plus, id and ids are reserved for identifiers (i.e. channel_ids)
194194
#. We use file_path and folder_path (instead of file_name and folder_name) for clarity.
195+
#. For creating headers to divide sections of code we use the following convention (see issue `#3019 <https://github.com/SpikeInterface/spikeinterface/issues/3019>`_):
196+
197+
198+
.. code:: python
199+
200+
#########################################
201+
# A header
202+
#########################################
195203
196204
197205
How to build the documentation

doc/releases/0.101.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
SpikeInterface 0.101.0 release notes
44
------------------------------------
55

6-
Estimated: 19th July 2024
6+
19th July 2024
77

88
Main changes:
99

doc/releases/0.101.1.rst

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
.. _release0.101.1:
2+
3+
SpikeInterface 0.101.1 release notes
4+
------------------------------------
5+
6+
16th September 2024
7+
8+
Main changes:
9+
10+
* Enabled support for consolidated Zarr-backend for `SortingAnalyzer`, including cloud support (#3314, #3318, #3349, #3351)
11+
* Improved support for Kilosort4 **ONLY VERSIONS >= 4.0.16** (#3339, #3276)
12+
* Skip recomputation of quality and template metrics if already computed (#3292)
13+
* Improved `estimate_sparsity` with new `amplitude` method and deprecated `from_ptp` option (#3369)
14+
* Dropped support for Python<3.9 (#3267)
15+
16+
core:
17+
18+
* Update the method of creating an empty file with right size when saving binary files (#3408)
19+
* Refactor pandas save load and convert dtypes (#3412)
20+
* Check run info completed only if it exists (back-compatibility) (#3407)
21+
* Fix argument spelling in check for binary compatibility (#3409)
22+
* Fix proposal for channel location when probegroup (#3392)
23+
* Fix time handling test memory (#3379)
24+
* Add `BaseRecording.reset_times()` function (#3363, #3380, #3391)
25+
* Extend `estimate_sparsity` methods and update `from_ptp`` (#3369)
26+
* Add `load_sorting_analyzer_or_waveforms` function (#3352)
27+
* Fix zarr folder suffix handling (#3349)
28+
* Analyzer extension exit status (#3347)
29+
* Lazy loading of zarr timestamps (#3318)
30+
* Enable cloud-loading for analyzer Zarr (#3314, #3351, #3378)
31+
* Refactor `set_property` in base (#3287)
32+
* Job kwargs fix (#3259)
33+
* Add `is_filtered` to annotations in `binary.json` (#3245)
34+
* Add check for None in `NoiseGeneratorRecordingSegment`` get_traces() (#3230)
35+
36+
extractors:
37+
38+
* Load phy channel_group as group (#3368)
39+
* "quality" property to be read as string instead of object in `BasePhyKilosortSortingExtractor` (#3365)
40+
41+
preprocessing:
42+
43+
* Auto-cast recording to float prior to interpolation (#3415)
44+
* Update doc handle drift + better preset (#3232)
45+
* Add causal filtering to filter.py (#3172)
46+
47+
sorters:
48+
49+
* Updates to kilosort 4: version >= 4.0.16, `bad_channels`, `clear_cache`, `use_binary_file` (#3339)
50+
* Download apptainer images without docker client (#3335)
51+
* Expose save preprocessing in ks4 (#3276)
52+
* Fix KS2/2.5/3 skip_kilosort_preprocessing (#3265)
53+
* HS: Added lowpass parameter, fixed verbose option (#3262)
54+
* Now exclusive support for HS v0.4 (Lightning) (#3210)
55+
56+
postprocessing:
57+
58+
* Add extra protection for template metrics (#3364)
59+
* Protect median against nans in get_prototype_spike (#3270)
60+
* Fix docstring and error for spike_amplitudes (#3269)
61+
62+
qualitymetrics:
63+
64+
* Do not delete quality and template metrics on recompute (#3292)
65+
* Refactor quality metrics tests to use fixture (#3249)
66+
67+
68+
curation:
69+
70+
* Clean-up identity merges in `get_potential_auto_merges` (#3346)
71+
* Fix sortingview curation no merge case (#3309)
72+
* Start apply_curation() (#3208)
73+
74+
widgets:
75+
76+
* Fix metrics widgets for convert_dtypes (#3417)
77+
* Fix plot motion for multi-segment (#3414)
78+
* Sortingview: only round float properties (#3406)
79+
* Fix widgets tests and add test on unit_table_properties (#3354)
80+
* Allow quality and template metrics in sortingview's unit table (#3299)
81+
* Add subwidget parameters for UnitSummaryWidget (#3242)
82+
* Fix `ipympl`/`widget` backend check (#3238)
83+
84+
generators:
85+
86+
* Handle case where channel count changes from probeA to probeB (#3237)
87+
88+
sortingcomponents:
89+
90+
* Update doc handle drift + better preset (#3232)
91+
* Make `InterpolateMotionRecording`` not JSON-serializable (#3341)
92+
93+
documentation:
94+
95+
* Clarify meaning of `delta_time` in `compare_sorter_to_ground_truth` (#3360)
96+
* Added sphinxcontrib-jquery (#3307)
97+
* Adding return type annotations (#3304)
98+
* More docstring updates for multiple modules (#3298)
99+
* Fix sampling frequency repr (#3294)
100+
* Proposal for adding Examples to docstrings (#3279)
101+
* More numpydoc fixes (#3275)
102+
* Fix docstring and error for spike_amplitudes (#3269)
103+
* Fix postprocessing docs (#3268)
104+
* Fix name of principal_components ext in qm docs (take 2) (#3261)
105+
* Update doc handle drift + better preset (#3232)
106+
* Add `int` type to `num_samples` on `InjectTemplatesRecording`. (#3229)
107+
108+
continuous integration:
109+
110+
* Fix streaming extractor condition in the CI (#3362)
111+
112+
packaging:
113+
114+
* Minor typing fixes (#3374)
115+
* Drop python 3.8 in pyproject.toml (#3267)
116+
117+
testing:
118+
119+
* Fix time handling test memory (#3379)
120+
* Fix streaming extractor condition in the CI (#3362)
121+
* Test IBL skip when the setting up the one client fails (#3289)
122+
* Refactor `set_property` in base (#3287)
123+
* Refactor quality metrics tests to use fixture (#3249)
124+
* Add kilosort4 wrapper tests (#3085)
125+
* Test IBL skip when the setting up the one client fails (#3289)
126+
* Add kilosort4 wrapper tests (#3085)
127+
128+
Contributors:
129+
130+
* @Djoels
131+
* @JoeZiminski
132+
* @JuanPimientoCaicedo
133+
* @alejoe91
134+
* @chrishalcrow
135+
* @cwindolf
136+
* @florian6973
137+
* @h-mayorquin
138+
* @jiumao2
139+
* @jonahpearl
140+
* @mhhennig
141+
* @rkim48
142+
* @samuelgarcia
143+
* @tabedzki
144+
* @zm711

doc/scripts/auto-release-notes.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
if [ $# -eq 0 ]; then
3-
echo "Usage: $0 START_DATE END_DATE [LABEL] [BRANCH1,BRANCH2] [LIMIT]"
3+
echo "Usage: $0 START_DATE (format: YEAR-MM-DD) END_DATE [LABEL] [BRANCH1,BRANCH2] [LIMIT]"
44
exit 1
55
fi
66

doc/whatisnew.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Release notes
88
.. toctree::
99
:maxdepth: 1
1010

11+
releases/0.101.1.rst
1112
releases/0.101.0.rst
1213
releases/0.100.8.rst
1314
releases/0.100.7.rst
@@ -43,6 +44,16 @@ Release notes
4344
releases/0.9.1.rst
4445

4546

47+
Version 0.101.1
48+
===============
49+
50+
* Enabled support for consolidated Zarr-backend for `SortingAnalyzer`, including cloud support (#3314, #3318, #3349, #3351)
51+
* Improved support for Kilosort4 **ONLY VERSIONS >= 4.0.16** (#3339, #3276)
52+
* Skip recomputation of quality and template metrics if already computed (#3292)
53+
* Improved `estimate_sparsity` with new `amplitude` method and deprecated `from_ptp` option (#3369)
54+
* Dropped support for Python<3.9 (#3267)
55+
56+
4657
Version 0.101.0
4758
===============
4859

pyproject.toml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ preprocessing = [
9494
full = [
9595
"h5py",
9696
"pandas",
97-
"xarray",
9897
"scipy",
9998
"scikit-learn",
10099
"networkx",
@@ -125,16 +124,16 @@ test_core = [
125124

126125
# for github test : probeinterface and neo from master
127126
# for release we need pypi, so this need to be commented
128-
"probeinterface @ git+https://github.com/SpikeInterface/probeinterface.git",
129-
"neo @ git+https://github.com/NeuralEnsemble/python-neo.git",
127+
# "probeinterface @ git+https://github.com/SpikeInterface/probeinterface.git",
128+
# "neo @ git+https://github.com/NeuralEnsemble/python-neo.git",
130129
]
131130

132131
test_extractors = [
133132
# Functions to download data in neo test suite
134133
"pooch>=1.8.2",
135134
"datalad>=1.0.2",
136-
"probeinterface @ git+https://github.com/SpikeInterface/probeinterface.git",
137-
"neo @ git+https://github.com/NeuralEnsemble/python-neo.git",
135+
# "probeinterface @ git+https://github.com/SpikeInterface/probeinterface.git",
136+
# "neo @ git+https://github.com/NeuralEnsemble/python-neo.git",
138137
]
139138

140139
test_preprocessing = [
@@ -148,7 +147,6 @@ test = [
148147
"pytest-dependency",
149148
"pytest-cov",
150149

151-
"xarray",
152150
"huggingface_hub",
153151

154152
# preprocessing
@@ -175,8 +173,8 @@ test = [
175173

176174
# for github test : probeinterface and neo from master
177175
# for release we need pypi, so this need to be commented
178-
"probeinterface @ git+https://github.com/SpikeInterface/probeinterface.git",
179-
"neo @ git+https://github.com/NeuralEnsemble/python-neo.git",
176+
# "probeinterface @ git+https://github.com/SpikeInterface/probeinterface.git",
177+
# "neo @ git+https://github.com/NeuralEnsemble/python-neo.git",
180178
]
181179

182180
docs = [
@@ -193,15 +191,14 @@ docs = [
193191
"pandas", # in the modules gallery comparison tutorial
194192
"hdbscan>=0.8.33", # For sorters spykingcircus2 + tridesclous
195193
"numba", # For many postprocessing functions
196-
"xarray", # For use of SortingAnalyzer zarr format
197194
"networkx",
198195
# Download data
199196
"pooch>=1.8.2",
200197
"datalad>=1.0.2",
201198

202199
# for release we need pypi, so this needs to be commented
203-
"probeinterface @ git+https://github.com/SpikeInterface/probeinterface.git", # We always build from the latest version
204-
"neo @ git+https://github.com/NeuralEnsemble/python-neo.git", # We always build from the latest version
200+
# "probeinterface @ git+https://github.com/SpikeInterface/probeinterface.git", # We always build from the latest version
201+
# "neo @ git+https://github.com/NeuralEnsemble/python-neo.git", # We always build from the latest version
205202

206203
]
207204

src/spikeinterface/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@
3030
# This flag must be set to False for release
3131
# This avoids using versioning that contains ".dev0" (and this is a better choice)
3232
# This is mainly useful when using run_sorter in a container and spikeinterface install
33-
DEV_MODE = True
34-
# DEV_MODE = False
33+
# DEV_MODE = True
34+
DEV_MODE = False

src/spikeinterface/benchmark/tests/test_benchmark_matching.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def test_benchmark_matching(create_cache_folder):
2828
recording, gt_sorting, ms_before=2.0, ms_after=3.0, return_scaled=False, **job_kwargs
2929
)
3030
noise_levels = get_noise_levels(recording)
31-
sparsity = compute_sparsity(gt_templates, noise_levels, method="ptp", threshold=0.25)
31+
sparsity = compute_sparsity(gt_templates, noise_levels, method="snr", amplitude_mode="peak_to_peak", threshold=0.25)
3232
gt_templates = gt_templates.to_sparse(sparsity)
3333

3434
# create study

src/spikeinterface/core/baserecording.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,13 @@ def get_binary_description(self):
768768
raise NotImplementedError
769769

770770
def binary_compatible_with(
771-
self, dtype=None, time_axis=None, file_paths_lenght=None, file_offset=None, file_suffix=None
771+
self,
772+
dtype=None,
773+
time_axis=None,
774+
file_paths_length=None,
775+
file_offset=None,
776+
file_suffix=None,
777+
file_paths_lenght=None,
772778
):
773779
"""
774780
Check is the recording is binary compatible with some constrain on
@@ -779,6 +785,15 @@ def binary_compatible_with(
779785
* file_offset
780786
* file_suffix
781787
"""
788+
789+
# spelling typo need to fix
790+
if file_paths_lenght is not None:
791+
warnings.warn(
792+
"`file_paths_lenght` is deprecated and will be removed in 0.103.0 please use `file_paths_length`"
793+
)
794+
if file_paths_length is None:
795+
file_paths_length = file_paths_lenght
796+
782797
if not self.is_binary_compatible():
783798
return False
784799

@@ -790,7 +805,7 @@ def binary_compatible_with(
790805
if time_axis is not None and time_axis != d["time_axis"]:
791806
return False
792807

793-
if file_paths_lenght is not None and file_paths_lenght != len(d["file_paths"]):
808+
if file_paths_length is not None and file_paths_length != len(d["file_paths"]):
794809
return False
795810

796811
if file_offset is not None and file_offset != d["file_offset"]:

src/spikeinterface/core/baserecordingsnippets.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@ def _set_probes(self, probe_or_probegroup, group_mode="by_probe", in_place=False
145145
else:
146146
raise ValueError("must give Probe or ProbeGroup or list of Probe")
147147

148+
# check that the probe do not overlap
149+
num_probes = len(probegroup.probes)
150+
if num_probes > 1:
151+
check_probe_do_not_overlap(probegroup.probes)
152+
148153
# handle not connected channels
149154
assert all(
150155
probe.device_channel_indices is not None for probe in probegroup.probes
@@ -234,7 +239,7 @@ def set_probes(self, probe_or_probegroup, group_mode="by_probe", in_place=False)
234239

235240
warning_msg = (
236241
"`set_probes` is now a private function and the public function will be "
237-
"removed in 0.103.0. Please use `set_probe` or `set_probegroups` instead"
242+
"removed in 0.103.0. Please use `set_probe` or `set_probegroup` instead"
238243
)
239244

240245
warn(warning_msg, category=DeprecationWarning, stacklevel=2)
@@ -348,17 +353,15 @@ def get_channel_locations(self, channel_ids=None, axes: str = "xy"):
348353
if channel_ids is None:
349354
channel_ids = self.get_channel_ids()
350355
channel_indices = self.ids_to_indices(channel_ids)
351-
if self.get_property("contact_vector") is not None:
352-
if len(self.get_probes()) == 1:
353-
probe = self.get_probe()
354-
positions = probe.contact_positions[channel_indices]
355-
else:
356-
all_probes = self.get_probes()
357-
# check that multiple probes are non-overlapping
358-
check_probe_do_not_overlap(all_probes)
359-
all_positions = np.vstack([probe.contact_positions for probe in all_probes])
360-
positions = all_positions[channel_indices]
361-
return select_axes(positions, axes)
356+
contact_vector = self.get_property("contact_vector")
357+
if contact_vector is not None:
358+
# here we bypass the probe reconstruction so this works both for probe and probegroup
359+
ndim = len(axes)
360+
all_positions = np.zeros((contact_vector.size, ndim), dtype="float64")
361+
for i, dim in enumerate(axes):
362+
all_positions[:, i] = contact_vector[dim]
363+
positions = all_positions[channel_indices]
364+
return positions
362365
else:
363366
locations = self.get_property("location")
364367
if locations is None:

0 commit comments

Comments
 (0)