pyxem / kikuchipy

Toolbox for analysis of electron backscatter diffraction (EBSD) patterns
https://kikuchipy.org
GNU General Public License v3.0
79 stars 30 forks source link

Errors when plotting interactively in notebooks via nbsphinx with PyVista/pythreejs #583

Closed hakonanes closed 10 months ago

hakonanes commented 1 year ago

Interactive plots of EBSD master patterns and Kikuchi simulators using PyVista and pythreejs errors and warns both locally in Jupyterlab and using nbsphinx on Readthedocs (https://readthedocs.org/projects/kikuchipy/builds/18870880/).

After disabling lighting (initial cause of errors, see identical errors reported in https://github.com/jupyter-widgets/pythreejs/issues/388), many warnings WARNING:traitlets:No handler found for comm target 'comm' are still emitted. I don't know where these come from. The plots display as expected locally when run manually, but nbsphinx is not able to run the notebook correctly (produces error reported in https://github.com/spatialaudio/nbsphinx/issues/549). This is the case both locally and on Readthedocs' servers.

Switching PyVista/Jupyter backend to panel (https://docs.pyvista.org/user-guide/jupyter/index.html#demo-using-panel) solves this issue. Will try out new backend reported in https://github.com/pyvista/pyvista/issues/3690 once it's available.

hakonanes commented 1 year ago

PyVista supports the Trame backend in v0.38 just released. We should look into using this backend for all docs: https://docs.pyvista.org/user-guide/jupyter/trame.html#trame-jupyter.

hakonanes commented 10 months ago

652 makes the currently interactive plots in the docs static. We can hopefully reintroduce interactive plots in the docs once https://github.com/pyvista/pyvista/pull/5168 is ready!