Skip to content

normalize_total with numba #3571

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
May 19, 2025
Merged

normalize_total with numba #3571

merged 21 commits into from
May 19, 2025

Conversation

Intron7
Copy link
Member

@Intron7 Intron7 commented Apr 8, 2025

Fixes #3135

This also removes the deprecated functions out

@Intron7 Intron7 changed the title normalize_total for numba normalize_total with numba Apr 8, 2025
Comment on lines 93 to 97
for i in numba.prange(rows):
count = counts_per_cell[i] / target_sum
for j in range(indptr[i], indptr[i + 1]):
data[j] /= count
return counts_per_cell, target_sum, counts_per_cols
Copy link
Member

Choose a reason for hiding this comment

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

so this part can be in fast-array-utils under the name elem_mult @flying-sheep right? This is what I understood from our discussions. Should we first implement elem_mult then come back to this issue?

Copy link
Member

Choose a reason for hiding this comment

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

Generally I wouldn’t stop scanpy improvements for fast_array_utils.

But if part of this can be replaced with a mult helper, we could do that now!

Copy link

codecov bot commented Apr 15, 2025

Codecov Report

Attention: Patch coverage is 95.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 76.74%. Comparing base (e6e86f2) to head (862f786).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/scanpy/preprocessing/_normalization.py 95.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3571      +/-   ##
==========================================
+ Coverage   76.68%   76.74%   +0.05%     
==========================================
  Files         113      113              
  Lines       12709    12703       -6     
==========================================
+ Hits         9746     9749       +3     
+ Misses       2963     2954       -9     
Files with missing lines Coverage Δ
src/scanpy/preprocessing/_normalization.py 89.41% <95.00%> (+9.19%) ⬆️

Co-authored-by: Philipp A. <flying-sheep@web.de>
@flying-sheep flying-sheep added this to the 1.11.2 milestone Apr 15, 2025
@flying-sheep
Copy link
Member

@Intron7 you have to write Fixes #3135 to link the issue.

@flying-sheep flying-sheep linked an issue Apr 17, 2025 that may be closed by this pull request
@flying-sheep flying-sheep enabled auto-merge (squash) April 17, 2025 12:43
@flying-sheep flying-sheep disabled auto-merge April 17, 2025 12:44
@flying-sheep
Copy link
Member

Also this needs a release note!

@Intron7
Copy link
Member Author

Intron7 commented Apr 17, 2025

@flying-sheep of course

Copy link
Member

@flying-sheep flying-sheep left a comment

Choose a reason for hiding this comment

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

Release note please

@flying-sheep flying-sheep enabled auto-merge (squash) April 29, 2025 13:22
@selmanozleyen selmanozleyen disabled auto-merge May 19, 2025 08:06
flying-sheep and others added 4 commits May 19, 2025 10:32
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Philipp A. <flying-sheep@web.de>
Co-authored-by: Phil Schaf <flying-sheep@web.de>
Co-authored-by: Rodrigo Goya <rgoya@users.noreply.github.com>
@ilan-gold ilan-gold merged commit 55bfe34 into main May 19, 2025
17 of 25 checks passed
@ilan-gold ilan-gold deleted the normalize_total_update branch May 19, 2025 15:12
Copy link

lumberbot-app bot commented May 19, 2025

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout 1.11.x
git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 55bfe348619fec1b800aae9086f6a1edddd5444e
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #3571: `normalize_total` with numba'
  1. Push to a named branch:
git push YOURFORK 1.11.x:auto-backport-of-pr-3571-on-1.11.x
  1. Create a PR against branch 1.11.x, I would have named this PR:

"Backport PR #3571 on branch 1.11.x (normalize_total with numba)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the Still Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free to suggest an improvement.

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

Successfully merging this pull request may close these issues.

normalize_total with numba
6 participants