Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelgarcia committed Sep 19, 2023
1 parent 8349b90 commit 9c4bba3
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/spikeinterface/sortingcomponents/clustering/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def agglomerate_pairs(labels_set, pair_mask, pair_values, connection_mode="full"

merges = []

graph = nx.from_numpy_matrix(pair_mask | pair_mask.T)
graph = nx.from_numpy_array(pair_mask | pair_mask.T)
# put real nodes names for debugging
maps = dict(zip(np.arange(labels_set.size), labels_set))
graph = nx.relabel_nodes(graph, maps)
Expand Down Expand Up @@ -196,8 +196,8 @@ def agglomerate_pairs(labels_set, pair_mask, pair_values, connection_mode="full"
nx.draw_networkx(sub_graph)
plt.show()

DEBUG = True
# DEBUG = False
# DEBUG = True
DEBUG = False
if DEBUG:
import matplotlib.pyplot as plt

Expand Down Expand Up @@ -457,8 +457,8 @@ def merge(
else:
final_shift = 0

DEBUG = True
# DEBUG = False
# DEBUG = True
DEBUG = False

if DEBUG and is_merge:
# if DEBUG:
Expand Down Expand Up @@ -487,7 +487,15 @@ def merge(
ax.plot(bins[:-1], count0, color="C0")
ax.plot(bins[:-1], count1, color="C1")

ax.set_title(f"{dipscore:.4f} {is_merge}")
if criteria == "diptest":
ax.set_title(f"{dipscore:.4f} {is_merge}")
elif criteria == "percentile":
ax.set_title(f"{l0:.4f} {l1:.4f} {is_merge}")
ax.axvline(l0, color="C0")
ax.axvline(l1, color="C1")



plt.show()


Expand Down

0 comments on commit 9c4bba3

Please sign in to comment.