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

Don't recalcuate histogram if not necessary #282

Merged
merged 3 commits into from
Dec 7, 2023
Merged

Conversation

thorstenwagner
Copy link
Collaborator

Hi,

I'm making great use of this plugin, but if data gets huge (like 32 million datapoints) it becomes much slower.

For example, after the umap is loaded and I circle a cluster it takes like 17 seconds to highlight the clusters.

This is the first PR to improve this. With the proposed changes, the 2dhistogram is not recalculated if the data hasn't changed.

It already reduces the computational time from 17 seconds to like 12 seconds.

Seconds PR follows :-)

Best,
Thorsten

Copy link

codecov bot commented Dec 7, 2023

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (2b47b7f) 76.52% compared to head (36f9a8c) 76.38%.

Files Patch % Lines
napari_clusters_plotter/_Qt_code.py 28.57% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #282      +/-   ##
==========================================
- Coverage   76.52%   76.38%   -0.14%     
==========================================
  Files          16       16              
  Lines        1853     1859       +6     
==========================================
+ Hits         1418     1420       +2     
- Misses        435      439       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Cryaaa
Copy link
Collaborator

Cryaaa commented Dec 7, 2023

This looks good to me! Will
Merge once tests pass. By the way, we are restructuring the plotter code to tidy it up and improve it currently. If you have some suggestions for larger changes or more efficient approaches we should make please let us know and we can try to implement them in the next big release! Thanks for taking care of this improvement 😊

@thorstenwagner
Copy link
Collaborator Author

Fantastic! Thanks for reacting so quick!

@Cryaaa Cryaaa merged commit 9398680 into main Dec 7, 2023
8 checks passed
@thorstenwagner thorstenwagner mentioned this pull request Dec 13, 2023
@Cryaaa Cryaaa deleted the dont-reload-histo branch January 23, 2024 14:03
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.

2 participants