Open IlariaFichera opened 10 months ago
Hi @IlariaFichera thank you for the feedback and sorry for such a late response! I was able to reproduce this :+1::
Seems like the error dialog is shown due to an error triggered from vtk:
2024-07-23 16:27:05.819 ( 1.395s) [7CF0B703D051AD1E] vtkMath.cxx:778 WARN| vtkMath::Jacobi: Error extracting eigenfunctions
2024-07-23 16:27:05.821 ( 1.396s) [7CF0B703D051AD1E] vtkMassProperties.cxx:60 ERR| vtkMassProperties (000001AA87B82370): No data to measure...!
Just in case, as a per session a workaround, you could prevent the error dialog from appearing by checking the Hide all future errors during this session
checkbox. Also, I think those kind of variables are currently unsupported over Spyder so clicking the Exclude unsupported data types
(over the Variable Explorer options menu) should hide them (to prevent trying to interact with them).
Pinging @larsoner since I saw he works in PyVista. Do you have any advice for us on how we could handle this error?
For me locally running the top-comment code in regular Python things are fine -- the plot renders in a window, etc. I can at least get the __repr__
s of the objects:
$ python -ui ~/Desktop/rep_pv.py
>>> ray
PolyData (0x732f15706b00)
N Cells: 1
N Points: 2
N Strips: 0
X Bounds: -5.000e-01, 5.000e-01
Y Bounds: -5.000e-01, 3.000e+00
Z Bounds: -5.000e-01, 5.000e-01
N Arrays: 2
>>> intersection
PolyData (0x732f22f9c400)
N Cells: 2
N Points: 2
N Strips: 0
X Bounds: -4.938e-01, -1.202e-01
Y Bounds: -4.783e-01, 8.292e-01
Z Bounds: -4.938e-01, -1.202e-01
N Arrays: 0
Then doing
$ conda create -n spyder spyder pyvista
$ conda deactivate && conda activate spyder
$ spyder
I can reproduce the ERROR:root:No data to measure...!
error as well as this in the console I used to launch Spyder:
2024-07-24 11:57:20.133 ( 0.587s) [ 7CB6B25EF740] vtkMath.cxx:778 WARN| vtkMath::Jacobi: Error extracting eigenfunctions
2024-07-24 11:57:20.134 ( 0.588s) [ 7CB6B25EF740] vtkMassProperties.cxx:60 ERR| vtkMassProperties (0x572dc14a8c20): No data to measure...!
So it's something about how Spyder inspects the objects I think. One potential hint/idea comes from when I try to inspect the Plotter
by double-clicking on it:
If there is some pickling step involved in the inspection (?), then I'm not too surprised it fails. I'm not sure which if any vtk
objects (which wrap underlying C++ objects) can be safely pickled and unpickled.
If there is some pickling step involved in the inspection (?), then I'm not too surprised it fails. I'm not sure which if any vtk objects (which wrap underlying C++ objects) can be safely pickled and unpickled.
Yep, that's exactly what we do: we pickle objects in the kernel and then unpickled them in Spyder so that users can inspect them through the Variable Explorer.
So, I guess we need to catch this error and show an appropriate message to fix it.
Description
What steps will reproduce the problem?
Using the following code:
Everytime that I then open one of the variables such as "ray" or "intersection", I get a error from Spyder. The error says "Spyder has encountered an internal problem". Eventhough the problem is there, the ojects open and I can still work with it.
Traceback
Versions
Dependencies