Skip to content

feat: add bbknn - #4306

Open
Intron7 wants to merge 3 commits into
mainfrom
feat/add-bbknn
Open

feat: add bbknn#4306
Intron7 wants to merge 3 commits into
mainfrom
feat/add-bbknn

Conversation

@Intron7

@Intron7 Intron7 commented Aug 19, 2026

Copy link
Copy Markdown
Member

This PR add a scanpy native bbknn implementation because of the removal of external

fixes #4302

Signed-off-by: Intron7 <sdicks@nvidia.com>
@Intron7 Intron7 added this to the 1.13.0 milestone Aug 19, 2026
Signed-off-by: Intron7 <sdicks@nvidia.com>
@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.11765% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.14%. Comparing base (6b5405d) to head (5fa4dd2).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/scanpy/neighbors/_common.py 79.48% 8 Missing ⚠️
src/scanpy/neighbors/_bbknn.py 98.85% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4306      +/-   ##
==========================================
+ Coverage   80.01%   80.14%   +0.13%     
==========================================
  Files         132      133       +1     
  Lines       13397    13511     +114     
==========================================
+ Hits        10719    10828     +109     
- Misses       2678     2683       +5     
Flag Coverage Δ
hatch-test.low-vers 78.38% <94.11%> (+0.14%) ⬆️
hatch-test.pre 80.01% <94.11%> (+0.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/scanpy/_utils/__init__.py 75.79% <ø> (ø)
src/scanpy/external/pp/_bbknn.py 45.45% <ø> (ø)
src/scanpy/neighbors/__init__.py 81.49% <100.00%> (-0.84%) ⬇️
src/scanpy/neighbors/_types.py 100.00% <100.00%> (ø)
src/scanpy/preprocessing/__init__.py 100.00% <100.00%> (ø)
src/scanpy/neighbors/_bbknn.py 98.85% <98.85%> (ø)
src/scanpy/neighbors/_common.py 70.83% <79.48%> (+5.92%) ⬆️

... and 1 file with indirect coverage changes

@flying-sheep flying-sheep left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

I deduplicated the transformer creation method and adapted the heuristic a bit, and added a benchmark suite to check it. Take a look if that makes sense or if I missed something!

The only piece I think is missing is that we should get rid of legacy cruft, but I can take care of that:

  • no reason for _accepts_legacy_random_state
  • things like batch_key and so on should become something accepting AdRefs or strs in the resolve format ("obs.obs_colname" instead of "obs_colname", and then _key of course makes no sense).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adopt scanpy.pp.bbknn

2 participants