Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 14, 2025
1 parent 9a19832 commit 61d3e2f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/spikeinterface/sortingcomponents/clustering/circus.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class CircusClustering:
"sparsity": {"method": "snr", "amplitude_mode": "peak_to_peak", "threshold": 0.25},
"recursive_kwargs": {
"recursive": True,
#"recursive_depth": 3,
# "recursive_depth": 3,
"returns_split_count": True,
},
"radius_um": 100,
Expand Down
17 changes: 8 additions & 9 deletions src/spikeinterface/sortingcomponents/clustering/split.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,16 +184,16 @@ def split_clusters_alternative(
mp_context=get_context(method=mp_context),
initargs=(recording, features_dict_or_folder, original_labels, method, method_kwargs, max_threads_per_process),
) as pool:

has_been_splitted = np.ones(len(peak_labels), dtype=bool)
recursion_level = 1

while np.any(has_been_splitted):
while np.any(has_been_splitted):

labels_set = np.setdiff1d(peak_labels[has_been_splitted], [-1])
if labels_set.size == 0:
break

current_max_label = np.max(labels_set) + 1
jobs = []

Expand Down Expand Up @@ -231,7 +231,6 @@ def split_clusters_alternative(
return peak_labels



global _ctx


Expand Down Expand Up @@ -289,7 +288,7 @@ def split(
min_size_split=25,
n_pca_features=2,
minimum_overlap_ratio=0.25,
debug=False
debug=False,
):
local_labels = np.zeros(peak_indices.size, dtype=np.int64)

Expand Down Expand Up @@ -385,10 +384,10 @@ def split(
ax.set_xlabel("PCA features")

axs[0].set_title(f"{clusterer} {is_split} {peak_indices[0]} {n_pca}, recursion_level={recursion_level}")
#import time
#plt.savefig(f"split_{recursion_level}_{time.time()}.png")
#plt.close()
#plt.show()
# import time
# plt.savefig(f"split_{recursion_level}_{time.time()}.png")
# plt.close()
# plt.show()

if is_split:
break
Expand Down

0 comments on commit 61d3e2f

Please sign in to comment.