Issues in pyvista with upcoming VTK changes #5470
Replies: 6 comments 11 replies
-
This seems like an appropriate solution to me, but I would need to take time to give it a try to see what issues this may provide.
It's unclear to me what you mean. Would you please elaborate on this? Are you suggesting that we leverage VTK's soon-to-come
I'm interpreting from this statement that VTK would soon to provide its own new Python wrappings, is that correct? |
Beta Was this translation helpful? Give feedback.
-
that sounds really nice. Will the properties also be settable through the constructor? E.g. |
Beta Was this translation helpful? Give feedback.
-
Yes. See https://gitlab.kitware.com/berkgeveci/pythonic-vtk for a prototype. Note that this is a sandbox to explore ideas not the actual implementation. If you look at datamodel.py and filters.py, you can see some of the ideas I have explored. |
Beta Was this translation helpful? Give feedback.
-
Hi all,
This has to be done only in a few places and is fairly clean. However, I ran into a bigger issue. As part of the wrapper changes, we now have the constructor of the VTK type parse keyword arguments and initialize properties. Well, that works great except in |
Beta Was this translation helpful? Give feedback.
-
Hi all, I made some progress in fixing issues but there is more to go. Here is a very much work in progress diff: There are two sets of issues that I have encountered so far:
As a reminder, the work-in-progress merge request is here: We aim to merge this in the next couple of weeks so some help addressing the PyVista issues sooner rather than later would be very appreciated. PS: I verified that these changes do not effect vedo. Thanks. |
Beta Was this translation helpful? Give feedback.
-
Hi folks. Any progress on this topic? We made great progress on the properties interface and we are preparing to merge. It will be another week probably. |
Beta Was this translation helpful? Give feedback.
-
Hello everyone.
I am one of the VTK developers. We are working on some changes to VTK that are causing issues with pyvista and we could use some help from the community. The changes, which can be seen here, add support for the creation of Python properties in the VTK Python wrappers. In short, the wrappers will create a property called
point_data
when they see a method calledGetPointData()
. This is overall working well. However, we ran into issues in pyvista. This is because pyvista dataset classes are multiply inherited and after this change, the new VTK properties are taking precedence over pyvista properties. For example:In this cases, the
point_data
property defined invtkPolyData
hides thepoint_data
property defined in_PointSet
. I tried fixing this with:however, there are several places where
super()
is called and is assumed to return the VTK type, not the pyvista mixin. I quickly got lost in this class hierarchy trying to fix this.I can think of two ways of dealing with this:
@overload
functionality (which allows substituting a subclass of, for example,vtkPointData
with your subclass ofvtkPointData
written in Python.Option (1) is probably the most straightforward. Option (2) may be cleaner. We are going to option (2) in VTK's Python modules to create more pythonic dataset classes.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions