View Single Post
Old 10-15-2018, 02:33 AM   #5
Cedrik0s
Human being with feelings
 
Join Date: Oct 2014
Posts: 77
Default

Kind of found a solution, but it's not a general solution. It just works for the task I had to perform in my case.

From my python script parsing selected items (on which I want to perform some numpy calculations) I launch an external script that's using numpy with a call to subprocess.Popen(...)
I pass the files to process as a command line argument.

Note that the external script is initializing numpy in its own process each time you call it with Popen(...) so the problem of multiple initialization doesn't occur, and reaper won't crash.

Also, numpy initialization takes much more time (something like 1s here) than the calculation itself (in this case). So I ended up calling the external script once only, to process all N files, rather than calling it N times on a single file each time. On a large number of file this makes a huge difference of performance.

This is a workaround that's OK in my case this time, but not a general solution to the numpy incompatibility with Reaper.

Cheers.

C
Cedrik0s is offline   Reply With Quote