Skip to content

fix(paraview): keep plugins working on newer ParaView/VTK - #138

Merged
berkgeveci merged 1 commit into
Kitware:masterfrom
berkgeveci:paraview-api-compat
Sep 17, 2026
Merged

berkgeveci merged 1 commit into
Kitware:masterfrom
berkgeveci:paraview-api-compat

Conversation

@berkgeveci

Copy link
Copy Markdown
Collaborator

Three APIs the plugins relied on changed in VTK 9.7, and each failed in a way that pointed somewhere unhelpful:

  • vtkUnstructuredGrid.points returns a vtkPoints subclass, where it used to hand back a numpy array. EAMProject died on .flatten(), and EAMSphere assigned an ndarray straight back to .points, which SetPoints now refuses. Both go through numpy_support instead.
  • GetCellTypesArray() is gone; GetCellTypes() returns that array now. A small _cell_types_array() helper prefers the old name when present.
  • vtkTrackballPan is no longer exported from vtkPVVTKExtensionsInteractionStyle; vtkPVTrackballPan is the survivor, and it exists in 6.0 as well.

All of it is backward compatible. Verified against ParaView 6.0.1 (VTK 9.5.2) and ParaView master (VTK 9.7): identical pg2 output, full and cropped.

Three APIs the plugins relied on changed in VTK 9.7, and each failed in a
way that pointed somewhere unhelpful:

- vtkUnstructuredGrid.points returns a vtkPoints subclass, where it used to
  hand back a numpy array. EAMProject died on .flatten(), and EAMSphere
  assigned an ndarray straight back to .points, which SetPoints now refuses.
  Both go through numpy_support instead.
- GetCellTypesArray() is gone; GetCellTypes() returns that array now. A small
  _cell_types_array() helper prefers the old name when present.
- vtkTrackballPan is no longer exported from vtkPVVTKExtensionsInteractionStyle;
  vtkPVTrackballPan is the survivor, and it exists in 6.0 as well.

All of it is backward compatible. Verified against ParaView 6.0.1 (VTK 9.5.2)
and ParaView master (VTK 9.7): identical pg2 output, full and cropped.
@berkgeveci

Copy link
Copy Markdown
Collaborator Author

@jourdain can you review?

@berkgeveci
berkgeveci requested a review from jourdain September 17, 2026 15:52
@jourdain

Copy link
Copy Markdown
Collaborator

Any reason that with 9.7 we don't get the numpy arrays directly? Should we fix anything in VTK directly?

@jourdain jourdain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@berkgeveci

Copy link
Copy Markdown
Collaborator Author

Any reason that with 9.7 we don't get the numpy arrays directly? Should we fix anything in VTK directly?

It's intentional. The new API requires that one has to convert to numpy arrays explicitly but can still work with the VTK classes as if they are numpy classes. I can clean up QuickView to fully leverage the new API once we require 9.7. This is the easiest way to support both 9.6 and 9.7.

@berkgeveci
berkgeveci merged commit cdee3a0 into Kitware:master Sep 17, 2026
1 check passed
@jourdain

Copy link
Copy Markdown
Collaborator

I had to do something similar in SiteView, but ideally with https://github.com/Kitware/e3sm-io and our repo moving forward we could use a better API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants