-
Notifications
You must be signed in to change notification settings - Fork 17
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
Move loading data to separate thread to prevent freezing viewer #283
base: main
Are you sure you want to change the base?
Conversation
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.
Really nice @Czaki, I just had a play with it and for me it works well. @LucaMarconato you want to have a look still before merge?
Thanks for the PR! Which PRs from napari do I need for this? I am trying this out on a stock napari but I can't see any different as opposed to the old behavior (interface stuck, no loading bar). It could also be an os specific behavior? |
Could you record a GIF showing what the interface should look like please? |
If you are using macos ARM machine with numpy<2, there will be no change because of a bug in the build of numpy wheels for this platform and version. napari_spatial-2024-08-09_16.20.07.mp4 |
I am indeed using an ARM machine with numpy<2. I'll try the PR with the latest numpy and let you know. Btw, last time I tried the |
Instead of using numpy>=2 you may install numpy with relevant numpy issue numpy/numpy#21799 |
This should not be merged before final decison about napari/napari#7146. |
Thanks for the info. I have tried using |
did you fetch last changes in this PR? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #283 +/- ##
==========================================
+ Coverage 63.08% 66.50% +3.42%
==========================================
Files 19 19
Lines 2636 2753 +117
==========================================
+ Hits 1663 1831 +168
+ Misses 973 922 -51 ☔ View full report in Codecov by Sentry. |
As long time freezing viewer is something not nice for user. Even with speedup loading of data, it could take multiple seconds for big data.
This PR moves loading data and creating
Layer
to a separate thread, keeping the viewer responsible during load time.It indicates loading using a progress bar above the selection widget.