Describe the bug
Passing backend='pyvista' to plot_source_estimates() currently is not supported, although we do support PyVista:
|
_check_option('backend', backend, ['auto', 'matplotlib', 'mayavi']) |
Also, the backend parameter is not used for anything except for checking whether we should use Matplotlib or not; if backend != 'matplotlib', we simply use _get_3d_backend() to retrieve the backend to use. This means that e.g.if you have PyVista installed, passing backend='mayavi' will still use the pyvista backend.
|
plot_mpl = backend == 'matplotlib' |
|
if not plot_mpl: |
|
try: |
|
set_3d_backend(_get_3d_backend()) |
|
except (ImportError, ModuleNotFoundError): |
|
if backend == 'auto': |
|
warn('No 3D backend found. Resorting to matplotlib 3d.') |
|
plot_mpl = True |
|
else: # 'mayavi' |
|
raise |
|
else: |
|
backend = _get_3d_backend() |
Expected results
backend should be allowed to be 'pyvista' as well
- the value of
backend should be honored
Additional information
Also wondering if the backend param should be deprecated or changed. Maybe it could only support matplotlib and 3d or so, and 3d would select the default 3D backend?
Or we deprecate it and if we cannot detect a valid 3D backend, we fall back to Matplotlib. (We already kind of do that, if I'm reading the code correctly)
cc @GuillaumeFavelier
Describe the bug
Passing
backend='pyvista'toplot_source_estimates()currently is not supported, although we do support PyVista:mne-python/mne/viz/_3d.py
Line 1750 in 6f16c37
Also, the
backendparameter is not used for anything except for checking whether we should use Matplotlib or not; ifbackend != 'matplotlib', we simply use_get_3d_backend()to retrieve the backend to use. This means that e.g.if you have PyVista installed, passingbackend='mayavi'will still use thepyvistabackend.mne-python/mne/viz/_3d.py
Lines 1751 to 1762 in 6f16c37
Expected results
backendshould be allowed to be'pyvista'as wellbackendshould be honoredAdditional information
Also wondering if the
backendparam should be deprecated or changed. Maybe it could only supportmatplotliband3dor so, and3dwould select the default 3D backend?Or we deprecate it and if we cannot detect a valid 3D backend, we fall back to Matplotlib. (We already kind of do that, if I'm reading the code correctly)
cc @GuillaumeFavelier