Skip to content

feat: add bbknn - #4306

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

feat: add bbknn#4306
Intron7 wants to merge 4 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

@Intron7 Intron7 added this to the 1.13.0 milestone Aug 19, 2026
@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.50000% with 9 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@e6269f5). Learn more about missing BASE report.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/scanpy/neighbors/_common.py 61.90% 8 Missing ⚠️
src/scanpy/neighbors/_bbknn.py 98.90% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4306   +/-   ##
=======================================
  Coverage        ?   80.12%           
=======================================
  Files           ?      134           
  Lines           ?    13534           
  Branches        ?        0           
=======================================
  Hits            ?    10844           
  Misses          ?     2690           
  Partials        ?        0           
Flag Coverage Δ
hatch-test.pre 80.12% <92.50%> (?)

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 100.00% <100.00%> (ø)
src/scanpy/neighbors/_types.py 100.00% <100.00%> (ø)
src/scanpy/preprocessing/__init__.py 100.00% <100.00%> (ø)
src/scanpy/neighbors/_bbknn.py 98.90% <98.90%> (ø)
src/scanpy/neighbors/_common.py 72.54% <61.90%> (ø)

@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).
  • including use_rep: #4315

@flying-sheep
flying-sheep force-pushed the feat/add-bbknn branch 2 times, most recently from 5b632ce to 6b6d769 Compare August 21, 2026 12:24
@flying-sheep
flying-sheep changed the base branch from main to neighbors-rng August 21, 2026 12:25
Base automatically changed from neighbors-rng to main August 21, 2026 13:37
Intron7 and others added 4 commits August 21, 2026 15:37
Signed-off-by: Intron7 <sdicks@nvidia.com>
Signed-off-by: Intron7 <sdicks@nvidia.com>
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