-
|
Hi, I am new to Bonsai. I wanted to replicate one of my python analysis pipelines in Bonsai. The final step in this pipeline involves the scipy.signal.find_peaks() function. But, the workflow always crashes with this error trace
I am also attaching the workflow and .py files. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
@rsatapat it looks like you might have forgotten to capture the GIL with the ObserveOnGIL operator. Whenever you have an observable sequence running asynchronously to Python you will need to use it (just once at the point you want to switch contexts, just before the Python call). Be aware acquiring the GIL is a mutually exclusive region: it will likely affect performance if your camera is running too fast, and will also bottleneck if you are running multiple cameras at the same time. In upcoming versions we will likely be able to configure Python contexts to run without the GIL, but this is not working yet. |
Beta Was this translation helpful? Give feedback.


@rsatapat it looks like you might have forgotten to capture the GIL with the ObserveOnGIL operator.
Whenever you have an observable sequence running asynchronously to Python you will need to use it (just once at the point you want to switch contexts, just before the Python call).
Be aware acquiring the GIL is a mutually exclusive region: it will likely affect performance if your camera is running too fast, and will also bottleneck if you are running multiple cameras at the same time.
In upcoming versions we will likely be able to configure Python contexts to run without the GIL, but this is not working yet.