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

VTK 9.4 - more pythonic style #116

Open
andrea-bistacchi opened this issue Nov 5, 2024 · 1 comment
Open

VTK 9.4 - more pythonic style #116

andrea-bistacchi opened this issue Nov 5, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@andrea-bistacchi
Copy link
Collaborator

andrea-bistacchi commented Nov 5, 2024

Until recently, the python wrapper naively exposed the C++ functions to Python. For example, a C++ member function vtkRenderWindow::SetSize got wrapped into the python member function SetSize. While that is uninspiring for many, it was already challenging to get to that point. Recall that python wrapping in VTK was developed long before pybind11 existed. (...) Over the years, the wrapper subsystem was extended to include more capabilities for developer convenience. One of the feature (...) added for VTK 9.3 was the introduction of interface files (.pyi) that PyCharm and other development tools use to provide more information, such as PEP 484 type hints.

Starting with the upcoming 9.4 release, (...) the wrapper subsystem enables access to properties of a VTK object in a pythonic style, initialization of VTK objects through specifying keyword arguments in the constructor, and finally, a convenient syntax to connect VTK algorithms and data objects and reuse the resulting pipelines with different inputs.

https://www.kitware.com/vtk-9-4-a-step-closer-to-the-ways-of-python/

As for 2024-11-05 we are using VTK 9.3, but we should consider upgrading in the future.

@gbene
Copy link
Collaborator

gbene commented Nov 5, 2024

Finally!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants