Repository navigation
Conversation
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.
When both velocity graphs are stored in
adata.obsp,transition_matrixinitially selects both graphs there, then replaces the selected negative graph with the.unscopy. AnnData reorders pairwise.obspmatrices when cells are reordered; the.unscopy retains its original ordering. The resulting transition kernel mixes two different cell orders. A missing.unsnegative copy also raisesKeyErrordespite the selected.obspnegative graph being present.Remove that later reassignment so the already selected negative graph is used. The added tests check cell-permutation equivariance with and without self transitions, missing
.unsnegative copies,.uns-only inputs, and explicitvgraphinputs, in both negative-cosine modes.Related to #1330, which already identifies the overwrite in the basis-constraint path. This PR demonstrates and fixes its graph-storage consequence; it does not add the negative-graph basis mask proposed there and does not claim to fully resolve that issue.
Validation against main
f63c0e70596ced2f1bee8cf07e8ab66037cf86b2:PYTHONPATH=. .venv/bin/python -m pytest tests/tools/test_transition_matrix.py -q— 6 failed, 4 passed.F,E,W,B,C4,UP,RUF100), andgit diff --checkpass. Full suite was not run. Existing public-docstring D413 warnings in the production file remain outside this change..uns-only and explicit-vgraphcontrols are numerically identical across release, main and patch in both modes. This selected fixture is not a prevalence estimate or a mathematical worst-case bound; no real-study impact has been assessed. Withuse_negative_cosines=True, outputs are signed kernel values rather than nonnegative probabilities.The existing positive-graph
.unsvalidation requirement is unchanged; this is not a general.obsp-only API expansion. AI-assisted implementation and verification.