Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyVista is currently incompatible with ParaView #3224

Open
banesullivan opened this issue Aug 29, 2022 · 3 comments
Open

PyVista is currently incompatible with ParaView #3224

banesullivan opened this issue Aug 29, 2022 · 3 comments
Labels
bug Uh-oh! Something isn't working as expected.

Comments

@banesullivan
Copy link
Member

Describe the bug, what's wrong, and what you expected.

The following imports do not work when trying to import PyVista within ParaView's Python shell (using the VTK python bindings bundled with ParaView):

from vtkmodules.vtkImagingMorphological import vtkImageDilateErode3D

from vtkmodules.vtkPythonContext2D import vtkPythonItem

Since both of these classes are used in PyVista, this poses a bit of an issue. vtkImageDilateErode3D is an easy to deal with as it is used within the image_dilate_erode() filter -- this means it can be ignored. Unfortunately, since vtkPythonItem is directly used for a subclass wrapping, we have to disable quite a bit of code to get PyVista working:

class _CustomContextItem(_vtk.vtkPythonItem):

Additionally, there are some issue with scooby as well which I need to resolve.

Steps to reproduce the bug.

From the ParaView Python shell (embedded in the GUI):

import sys
sys.path.append('path/to/pyvista/')
import pyvista

System Information

Not including here as this is specific to ParaView's VTK bindings and PyVista's `_vtk` module.

Screenshots

No response

@banesullivan
Copy link
Member Author

I think if vtkImagingMorphological or vtkPythonContext2D are not available, then PyVista should gracefully handle this by disabling some features. This is a classic example of mismatching what VTK modules are enabled in a given build. There will be plenty of other scenarios just like this.

@dcbr
Copy link
Contributor

dcbr commented Aug 29, 2022

I can deal with the vtkPythonContext2D import in #2868 as that PR already disables this chart backgrounds feature for older VTK versions.

@banesullivan
Copy link
Member Author

Thanks, @dcbr! I'll take on handling the other import(s)

dcbr added a commit to dcbr/pyvista that referenced this issue Dec 28, 2022
akaszynski added a commit that referenced this issue Jan 21, 2023
…2868)

* Improve Charts compatibility with older and upcoming VTK versions.

* Fix ChartBox and ChartPie geometry issues

* Add 'revert to defaults' case again to test_axis_tick_locations

* Fix axis memory leak

* Add fix for #3224

* Add no cover pragma and use proxy instead of weakref

Co-authored-by: Alex Kaszynski <akascap@gmail.com>
Co-authored-by: Bane Sullivan <banesullivan@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Uh-oh! Something isn't working as expected.
Projects
None yet
Development

No branches or pull requests

2 participants