Skip to content

Commit 31e472e

Browse files
committed
WNN: fix segfault if multiple cells have identical coordinates
closes #158
1 parent c0425a4 commit 31e472e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

muon/_core/preproc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ def neighbors(
524524
(
525525
distances[:, 1:].reshape(-1),
526526
nn_indices[:, 1:].reshape(-1),
527-
np.concatenate((nn_indices[:, 0] * n_multineighbors, (nn_indices[:, 1:].size,))),
527+
np.arange((nn_indices.shape[0] + 1) * n_multineighbors, step=n_multineighbors),
528528
),
529529
shape=(rep.shape[0], rep.shape[0]),
530530
)

0 commit comments

Comments
 (0)