Skip to content

Commit

Permalink
Fixing bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yger committed Jun 27, 2024
1 parent b9c2638 commit 34a1bc2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/spikeinterface/core/analyzer_extension_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,9 +597,10 @@ def _merge_extension_data(
weights[count] = counts[id]
weights /= weights.sum()
new_data[key][unit_ind] = (arr[keep_unit_indices, :, :] * weights[:, np.newaxis, np.newaxis]).sum(0)
chan_ids = new_sorting_analyzer.sparsity.unit_id_to_channel_indices[unit_id]
mask = ~np.isin(np.arange(arr.shape[2]), chan_ids)
new_data[key][unit_ind][:, mask] = 0
if new_sorting_analyzer.sparsity is not None:
chan_ids = new_sorting_analyzer.sparsity.unit_id_to_channel_indices[unit_id]
mask = ~np.isin(np.arange(arr.shape[2]), chan_ids)
new_data[key][unit_ind][:, mask] = 0

return new_data

Expand Down

0 comments on commit 34a1bc2

Please sign in to comment.