Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4423 +/- ##
=======================================
Coverage ? 84.31%
=======================================
Files ? 134
Lines ? 12701
Branches ? 0
=======================================
Hits ? 10709
Misses ? 1992
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Author
|
The "Check title, milestone, and labels" job needs a milestone, which I can't set as an outside contributor. Could a maintainer add one, or the label you use to skip it? |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LLM usage
LLM or coding agent used: Claude Opus 5.5 via Claude Code
If one was used, I, a human, have reviewed, understood and tested every changed line
Closes
neighbors(method="gauss")returns a non-symmetric connectivity matrix on the sparse (pynndescent / transformer) path #4416Tests included or not required because:
Release notes not necessary because:
The sparse branch of
_connectivity.gaussrelied on_get_indices_distances_from_sparse_matrixreturning neighbours sorted by distance, with the cell itself in column 0. The pynndescent distance matrix does not meet either assumption: every row stores the cell itself as an explicit 0, holds one more neighbour than sklearn, and is ordered by column index._has_self_columnonly requires one row to start with itself. As a result:indices[:, 1:]drops an arbitrary neighbour instead of the cell itself.d_sq, but only the truncatedindiceswere mirrored.The result was one-directional edges (
max|W - W.T| = 0.655in the issue) and self-loops with weight 1 on the diagonal.The sparse branch now takes, for every row, the
n_neighbors - 1closest entries that are not the cell itself. It computes the kernel on exactly those edges and mirrors the missing reverse edges, which matches what the denseknn=Truebranch does. The new code is vectorised and replaces the per-row Python loop and the LIL conversion.On the issue's reproducer (9000 cells):
max|W - W.T|max diag(W)The sklearn path gives the same output as before; the existing gauss tests pass unchanged.