-
Notifications
You must be signed in to change notification settings - Fork 0
Fix pickling issue with multiprocessing.Process to (down)load volumes and re-enable (down)load cancelling
#7
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
base: dev
Are you sure you want to change the base?
Conversation
The comment explains it all, To avoid `zlib` blowing up the memory usage, we need to reduce the chunk size a lot.
The downloads are now done in chunks, allowing an optional callback to be provided which is checked between every chunk. The callback is expected to return a boolean dictating whether to cancel the download or not.
|
Actually, never mind. It's still not working to cancel a load. |
fa8fc22 to
069af6d
Compare
|
I'm giving up for now, pickling should be fixed but allowing cancellation is not and remains disabled. |
|
Sorry, not for review, but for testing on macOS... |
This drops the use of `multiprocessing.Process` objects to (down)load volumes, which should fix the pickling troubles on macOS. Additionally, the thread can now react to interruption requests and gracefully cancels downloads or abruptly terminates loads.
This allows calling code to handle cases where the user cancelled the (down)load.
069af6d to
6d81467
Compare
This makes use of processes to load NumPy arrays of the volumes in a separate environment, allowing it to be cancelled without freezing the main GUI. Additionally, the normalisation can now be done "fast", meaning that now floating, intermediary arrays are used, saving a bit of speed and a lot of memory.
multiprocessing.Process to (down)load volumes and re-enable (down)load cancellingmultiprocessing.Process to (down)load volumes and re-enable (down)load cancelling
|
There you go. Now mostly works, although the GUI still freezes a bit towards the end of the loading, when merging with the main thread. |
|
Is this still being drafted atm? Still seeing the same issue on MacOS |
|
Well I'm seeing the following |
|
Should have be fixed by ab00 on |
|
But the PR is mostly dead. I might revisit it later but will need to have a better look at completely changing the way volumes are loaded to ensure no pickling is necessary. |
|
Ah right yes I was running the released version instead of the one currently on main, works fine now |
Closes #6.
This was tested on Linux and Windows, and will be merged once it is tested on macOS.
@celefthe Could you check if you can create projects fine on macOS with this branch?