Skip to content

Commit

Permalink
Update utils.py (#410)
Browse files Browse the repository at this point in the history
In some versions of scipy(e.g. 1.14), M.A might not be available. In such cases, you should use M.toarray() to convert the sparse matrix to a dense one.

Co-authored-by: Michaela Müller <51025211+mumichae@users.noreply.github.com>
  • Loading branch information
Zhongzheng99 and mumichae authored Aug 7, 2024
1 parent a515946 commit 9271d92
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scib/metrics/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def diffusion_nn(adata, k, max_iterations=26):
)

M.setdiag(0)
k_indices = np.argpartition(M.A, -k, axis=1)[:, -k:]
k_indices = np.argpartition(M.toarray(), -k, axis=1)[:, -k:]

return k_indices

Expand Down

0 comments on commit 9271d92

Please sign in to comment.