Skip to content
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

Simplify scale #3351

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Simplify scale #3351

wants to merge 15 commits into from

Conversation

flying-sheep
Copy link
Member

@flying-sheep flying-sheep commented Nov 11, 2024

scale_sparse has a lot of code that’s not needed.

This PR also fixes zappy compatibility for scale, not that anyone is using it as far as I know.

Copy link

codecov bot commented Nov 11, 2024

Codecov Report

Attention: Patch coverage is 86.66667% with 6 lines in your changes missing coverage. Please review.

Project coverage is 75.42%. Comparing base (a28fe88) to head (18a58d7).

Files with missing lines Patch % Lines
src/scanpy/preprocessing/_scale.py 86.66% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3351      +/-   ##
==========================================
- Coverage   75.44%   75.42%   -0.03%     
==========================================
  Files         113      113              
  Lines       13250    13233      -17     
==========================================
- Hits         9997     9981      -16     
+ Misses       3253     3252       -1     
Files with missing lines Coverage Δ
src/scanpy/preprocessing/_scale.py 75.63% <86.66%> (-2.32%) ⬇️

Copy link

scverse-benchmark bot commented Nov 11, 2024

Benchmark changes

Change Before [a28fe88] <1.11.0> After [18a58d7] Ratio Benchmark (Parameter)
+ 10.6±0.1ms 13.3±0.1ms 1.26 preprocessing_counts.FastSuite.time_calculate_qc_metrics('bmmc', 'counts-off-axis')
+ 5.58±0.06ms 6.54±0.04ms 1.17 preprocessing_counts.FastSuite.time_calculate_qc_metrics('pbmc68k_reduced', 'counts')
- 60.5±1ms 50.8±8ms 0.84 preprocessing_counts.time_filter_genes('pbmc3k', 'counts-off-axis')
- 615±100μs 532±5μs 0.87 preprocessing_log.FastSuite.time_mean_var('bmmc', 'off-axis')
+ 952M 1.31G 1.38 preprocessing_log.peakmem_scale('pbmc3k', 'off-axis')
+ 1.15G 1.51G 1.32 preprocessing_log.peakmem_scale('pbmc3k', None)
- 753±10ms 481±1ms 0.64 preprocessing_log.time_scale('pbmc3k', 'off-axis')

Comparison: https://github.com/scverse/scanpy/compare/a28fe88ec08cc144189f6cc1497a5f067b96ce7b..18a58d77d59fd3e7912cd89990ffc779f9616d31
Last changed: Mon, 17 Feb 2025 18:50:47 +0000

More details: https://github.com/scverse/scanpy/pull/3351/checks?check_run_id=37353611695

@flying-sheep flying-sheep changed the title Simplify-scale Simplify scale Nov 11, 2024
@flying-sheep flying-sheep modified the milestones: 1.11.0, 1.12.0 Dec 20, 2024
@flying-sheep flying-sheep self-assigned this Feb 17, 2025
@flying-sheep flying-sheep modified the milestones: 1.12.0, 1.11.1 Feb 17, 2025
@flying-sheep flying-sheep marked this pull request as ready for review February 17, 2025 11:57
@flying-sheep flying-sheep requested review from Intron7 and removed request for Intron7 February 17, 2025 16:31
@flying-sheep flying-sheep requested a review from Intron7 February 20, 2025 15:09
@flying-sheep
Copy link
Member Author

@Intron7 any idea what I did wrong? Why do the benchmarks say that it uses more memory?

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.

1 participant