Open roflmaostc opened 3 years ago
The problem is upstream and probably in VisPy https://github.com/napari/napari/issues/1310
Yeah, but in the meantime we could catch such errors, couldn't we?
If we don't catch this Python error it kills completely my Pluto/Jupyter frequently which is quite annoying (especially in Julia loading CUDA, Zyogte, Flux, ...)
You wouldn't be able to intercept the error via napari.view_image
. That's purely PyCall
.
You could try to intercept the error via Napari.view_image
:
https://github.com/mkitti/Napari.jl/blob/main/src/layers.jl#L10-L11
You could also intercept the error via the macro interface. For example, call_with_name_keyword
or call_viewer_with_name_keyword
https://github.com/mkitti/Napari.jl/blob/ba7a837aa206c372492d93bc4e268440ab1cf8b8/src/layer_name_macros.jl#L23
https://github.com/mkitti/Napari.jl/blob/ba7a837aa206c372492d93bc4e268440ab1cf8b8/src/layer_name_macros.jl#L37
Yes, I was referring to intercept the error at a Julia level checking like this
julia> valid_data(x) = all(isfinite.(x))
valid_data (generic function with 1 method)
julia> valid_data([1, 2])
true
julia> valid_data([1, Inf])
false
julia> valid_data([1, NaN])
false
Is data
always a pure array which could be checked with valid_data
?
What happens if you throw a try
catch
around the call? Does IJulia still crash?
Right now the Jupyter doesn't die with the minimal example posted above despite the error is the same :( Maybe it was due some CUDA interaction where the NaN originated from. But I can remember that I had these issues already a few month ago without CUDA.
Hey,
having
NaN
s in an image, crashes my IJulia Kernel. Below a REPL example showing the same errors:I was wondering at which part in the code it would be the best to throw a Julia error instead.
Thanks,
Felix