fix(paraview): keep plugins working on newer ParaView/VTK - #138
Merged
Merged
Conversation
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.
Collaborator
Author
|
@jourdain can you review? |
Collaborator
|
Any reason that with 9.7 we don't get the numpy arrays directly? Should we fix anything in VTK directly? |
Collaborator
Author
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. |
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three APIs the plugins relied on changed in VTK 9.7, and each failed in a way that pointed somewhere unhelpful:
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.