labsyspharm / minerva-author

Tool to create images and configuration files for Minerva-Story
MIT License
15 stars 14 forks source link

Fix threading issues in auto-threshold code #73

Closed jmuhlich closed 9 months ago

jmuhlich commented 9 months ago

Previous implementation deadlocked on Windows. This change fixes that and cleans up the code in general. Now uses ThreadPoolExecutor instead of explicitly launching Threads. Even after the general cleanups I was encountering deadlocks in np.dot on normal numpy arrays in a threaded context -- switching to the "blis" BLAS implementation fixed that (requirements.yml now contains an entry for this).

jmuhlich commented 9 months ago

This also fixes the bug where not selecting a channel names csv file in the front end caused an unexpected exception on windows. Now the code explicitly checks that the csv path exists and is not a directory rather than relying on exceptions (as the particular IO exceptions raised in some circumstances do vary by platform).