Skip to content

feat: presets#3653

Open
flying-sheep wants to merge 66 commits intomainfrom
pa/presets
Open

feat: presets#3653
flying-sheep wants to merge 66 commits intomainfrom
pa/presets

Conversation

@flying-sheep
Copy link
Member

@flying-sheep flying-sheep commented May 28, 2025

  • Release notes not necessary because:

Self-documenting presets work!

E.g.:

@codecov
Copy link

codecov bot commented May 28, 2025

Codecov Report

❌ Patch coverage is 93.95973% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.36%. Comparing base (b5efe54) to head (4f5ea8d).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/scanpy/_settings/presets.py 94.73% 5 Missing ⚠️
src/scanpy/preprocessing/_scale.py 66.66% 2 Missing ⚠️
src/scanpy/tools/_leiden.py 75.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3653      +/-   ##
==========================================
+ Coverage   78.23%   78.36%   +0.13%     
==========================================
  Files         117      117              
  Lines       12661    12782     +121     
==========================================
+ Hits         9905    10017     +112     
- Misses       2756     2765       +9     
Flag Coverage Δ
hatch-test.low-vers 77.66% <93.95%> (+0.14%) ⬆️
hatch-test.pre 77.32% <93.95%> (+0.14%) ⬆️

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

Files with missing lines Coverage Δ
src/scanpy/__init__.py 100.00% <100.00%> (ø)
src/scanpy/_settings/__init__.py 86.54% <100.00%> (+0.50%) ⬆️
src/scanpy/preprocessing/_highly_variable_genes.py 95.07% <100.00%> (+0.05%) ⬆️
src/scanpy/preprocessing/_pca/__init__.py 91.62% <100.00%> (+0.09%) ⬆️
src/scanpy/preprocessing/_recipes/__init__.py 91.93% <100.00%> (-0.13%) ⬇️
src/scanpy/preprocessing/_simple.py 90.96% <100.00%> (ø)
src/scanpy/tools/_rank_genes_groups.py 92.81% <100.00%> (+0.08%) ⬆️
src/scanpy/tools/_score_genes.py 87.50% <100.00%> (+0.34%) ⬆️
src/scanpy/tools/_umap.py 72.30% <ø> (ø)
src/scanpy/preprocessing/_scale.py 89.47% <66.66%> (-1.54%) ⬇️
... and 2 more

@flying-sheep flying-sheep added this to the 1.12.0 milestone Jun 3, 2025
@flying-sheep flying-sheep changed the base branch from main to pa/settings-overhaul June 6, 2025 10:07
@flying-sheep flying-sheep modified the milestones: 1.12.0, 1.13.0 Nov 3, 2025
@flying-sheep
Copy link
Member Author

flying-sheep commented Nov 10, 2025

TODO: add jaccard to seurat preset #3828

@flying-sheep flying-sheep changed the title (feat): presets feat: presets Feb 23, 2026
@flying-sheep flying-sheep marked this pull request as ready for review March 23, 2026 16:43
return {
Preset.ScanpyV1: RankGenesGroupsPreset(method="t-test", mask_var=None),
Preset.ScanpyV2Preview: RankGenesGroupsPreset(
method="wilcoxon", mask_var=None
Copy link
Member Author

Choose a reason for hiding this comment

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

mask_var="highly_variable" here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe collect these sorts of questions and make a zulip/slack poll?

Copy link
Member Author

Choose a reason for hiding this comment

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

Definitely. The issue is that they’re hard to collect, I keep stumbling upon more.

@flying-sheep flying-sheep requested a review from ilan-gold March 23, 2026 16:47
@flying-sheep
Copy link
Member Author

flying-sheep commented Mar 23, 2026

@ilan-gold I asked your review because of scope:

Copy link
Contributor

@ilan-gold ilan-gold left a comment

Choose a reason for hiding this comment

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

This is a pretty harmless PR so nothing comes to mind as absolutely pressing. The architecture overall makes sense.

I would beef up the docs a bit to make it clear how to use this.

Why use ScanpyV2Preview instead of just ScanpyV2?

return {
Preset.ScanpyV1: RankGenesGroupsPreset(method="t-test", mask_var=None),
Preset.ScanpyV2Preview: RankGenesGroupsPreset(
method="wilcoxon", mask_var=None
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe collect these sorts of questions and make a zulip/slack poll?

@flying-sheep
Copy link
Member Author

Why use ScanpyV2Preview instead of just ScanpyV2?

Because when we release a new feature release before 2.0, I don’t want people to start relying on it keeping its behavior. I thought “preview” makes it clear that it’s not stable, but I’m open to suggestions.

Copy link
Contributor

@ilan-gold ilan-gold left a comment

Choose a reason for hiding this comment

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

Modulo the repr (whcih I do think is worth discussion at the minmum if not a tweak), looks great!!!

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.

Scanpy 2.0 preview Remove default from sc.pp.scale’s zero_center (so it never accidentally densifies)

2 participants