feat: allow precomputed connectivities in neighbors#4133
Draft
ehsanestaji wants to merge 3 commits into
Draft
Conversation
Author
|
Thanks for maintaining Scanpy. The PR validation asks for either a milestone or the |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4133 +/- ##
==========================================
+ Coverage 79.61% 79.70% +0.09%
==========================================
Files 120 120
Lines 12786 12805 +19
==========================================
+ Hits 10179 10206 +27
+ Misses 2607 2599 -8
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
test_neighbors_connectivities_support_umapSummary
This adds a
connectivitiesargument tosc.pp.neighbors, allowing callers to provide an externally computed neighborhood graph directly. The graph is stored in.obspand can be consumed by downstream graph-based tools such assc.tl.umapwithout requiring Scanpy to recompute neighbors fromadata.When both
distancesandconnectivitiesare provided, Scanpy stores the supplied distances alongside the supplied connectivities. When onlyconnectivitiesis provided, no distances matrix is written.Testing
uv run --group test-min pytest tests/test_neighbors.py tests/test_neighbors_key_added.py -quv run --group test-min ruff check src/scanpy/neighbors/__init__.py tests/test_neighbors.pyuv run --group test-min ruff format --check src/scanpy/neighbors/__init__.py tests/test_neighbors.pygit diff --check