-
Notifications
You must be signed in to change notification settings - Fork 635
refactor: normalize_total
with Numba
#3593
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
refactor: normalize_total
with Numba
#3593
Conversation
@flying-sheep ok I see what you wanted but I thought you wanted to squash my merge into Severin's branch then review on that branch. I am on it |
well, then do the same with severin’s branch instead of |
cd7ab7d
to
a3e5cf0
Compare
ok I did change the base to main in the PR so that there is only two files to review. |
a3e5cf0
to
ce6cf62
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I fixed an issue with the logging (time measuring was broken), otherwise this looks good as-is!
Nice deduplication also of the not immediately obvious parts x.copy()
and x.astype(np.float32)
if not inplace: | ||
x = x.copy() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
converting a csc to a csr matrix will copy already, but I guess an extra copy in that case isn’t too bad.
(I get that we also need to enter this path for non-csparse x)
|
||
It returns the normalized data, the counts per cell, and the gene subset. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It returns the normalized data, the counts per cell, and the gene subset. |
No need to say that twice
b27d218
into
scverse:normalize_total_update
* update normalize_total & remove dep * refactor: `normalize_total` with Numba (#3593) Co-authored-by: Philipp A. <flying-sheep@web.de> * fix doctest * add release note * Switch from profimp to tuna for parsing import profiles (#3620) * [pre-commit.ci] pre-commit autoupdate (#3622) 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> * Fix typo (#3555) Co-authored-by: Phil Schaf <flying-sheep@web.de> * Switch to fast-array-utils (#3598) Co-authored-by: Rodrigo Goya <rgoya@users.noreply.github.com> * tSNE components parameter (#2803) Co-authored-by: Phil Schaf <flying-sheep@web.de> * Simplify scale (#3351) Co-authored-by: Intron7 <severin.dicks@icloud.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * remove layers test * explicit return and fix the info message * remove unnecessary ravel's * precision fix * (fix): maintain data type properly. * (fix): remove artifact storage * (refactor): use nice f-a-u typing --------- Co-authored-by: Philipp A. <flying-sheep@web.de> Co-authored-by: Selman Özleyen <32667648+selmanozleyen@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Swastik Mishra <4453983+swstkm@users.noreply.github.com> Co-authored-by: Rodrigo Goya <rgoya@users.noreply.github.com> Co-authored-by: Kitsune <48340051+ch1ru@users.noreply.github.com> Co-authored-by: selmanozleyen <syozleyen@gmail.com> Co-authored-by: ilan-gold <ilanbassgold@gmail.com>
Hi this PR integrates the recent commits and refactors on #3571.
Here I removed the division part from the numba code so that it is unified in the future with fast-array-utils elem_mult.
pinging bc I can't ask for reviews for some reason: @flying-sheep