Skip to content

Commit 898c2d2

Browse files
authored
Merge branch 'main' into fix_ryan_error_lfp
2 parents 7c6b40d + 46e40a1 commit 898c2d2

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

.github/scripts/test_kilosort4_ci.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@
112112
PARAMS_TO_TEST_DICT.update({"cluster_neighbors": 11})
113113
PARAMETERS_NOT_AFFECTING_RESULTS.append("cluster_neighbors")
114114

115+
if parse(kilosort.__version__) >= parse("4.0.37"):
116+
PARAMS_TO_TEST_DICT.update({"max_cluster_subset": 20})
117+
PARAMETERS_NOT_AFFECTING_RESULTS.append("max_cluster_subset")
118+
115119

116120
PARAMS_TO_TEST = list(PARAMS_TO_TEST_DICT.keys())
117121

@@ -254,6 +258,8 @@ def test_initialize_ops_arguments(self):
254258
"device",
255259
"save_preprocessed_copy",
256260
]
261+
if parse(kilosort.__version__) >= parse("4.0.37"):
262+
expected_arguments += ["gui_mode"]
257263

258264
self._check_arguments(
259265
initialize_ops,

src/spikeinterface/extractors/phykilosortextractors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class BasePhyKilosortSortingExtractor(BaseSorting):
1515
Parameters
1616
----------
1717
folder_path : str or Path
18-
Path to the output Phy folder (containing the params.py)
18+
Path to the output Phy/Kilosort folder (containing the params.py)
1919
exclude_cluster_groups : list or str, default: None
2020
Cluster groups to exclude (e.g. "noise" or ["noise", "mua"]).
2121
keep_good_only : bool, default: True
@@ -248,7 +248,7 @@ class KiloSortSortingExtractor(BasePhyKilosortSortingExtractor):
248248
Parameters
249249
----------
250250
folder_path : str or Path
251-
Path to the output Phy folder (containing the params.py).
251+
Path to the output Kilosort folder (containing the params.py).
252252
keep_good_only : bool, default: True
253253
Whether to only keep good units.
254254
If True, only Kilosort-labeled 'good' units are returned.

src/spikeinterface/sorters/external/kilosort4.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,9 @@ def _setup_json_probe_map(cls, recording, sorter_output_folder):
438438
chanMap = np.arange(n_chan)
439439
xc = positions[:, 0]
440440
yc = positions[:, 1]
441-
kcoords = groups.astype(float)
441+
unique_groups = set(groups)
442+
group_map = {group: idx for idx, group in enumerate(unique_groups)}
443+
kcoords = np.array([group_map[group] for group in groups], dtype=int)
442444

443445
probe = {
444446
"chanMap": chanMap,

0 commit comments

Comments
 (0)