Closed yellowshippo closed 2 years ago
@yellowshippo -- thank you for the PR! Will run the tests to see if this passes.
Thank you for your quick response. It seems the test failed for Windows. Since I have no Windows environment, I couldn't investigate the problem deeply. Any ideas to fix it?
@yellowshippo -- yes so this seems like a windows specific issue. I too do not have a Windows environment handy right now. One way to do this is to try a more defensive approach as done early in the same module, where we try to detect the type by instantiating a vtkUnsignedLongLongArray
and checking its type and mapping to that. You can try making a change and pushing here to see if that works. @rahulporuri -- do you have access to a windows machine?
One way to do this is to try a more defensive approach as done early in the same module, where we try to detect the type by instantiating a vtkUnsignedLongLongArray and checking its type and mapping to that.
OK, I can give it a try, but where can I find the relevant code? I could not find anything related to vtkUnsignedLongLongArray in tvtk/array_handler.py and tvtk/tests/test_array_handler.py.
Sorry I mean, if you look at line 35, you will see this: VTK_ID_TYPE_SIZE = vtk.vtkIdTypeArray().GetDataTypeSize()
, perhaps something similar, there is also a GetDataTypeAsString()
method that may be useful?
@prabhuramachandran Thank you for the clarification. After some consideration, I found that I only need VTK_LONG_LONG and I have no use case for VTK_UNSIGNED_LONG_LONG, thus I simply removed lines related to VTK_UNSIGNED_LONG_LONG. Now it works.
Merged, thank you!
This PR adds supports for VTK_LONG_LONG ~and VTK_UNSIGNED_LONG_LONG~ to tvtk/array_handler.py.
It is necessary because some files can contain arrays of these types. In particular, VTU files exported using ParaView can have Int64 ~and UInt64~, as attached below. mesh.vtu.zip
I also added some lines in tvtk/tests/test_array_handler.py and confirmed the VTU file attached was successfully loaded using the modified code.
Edit: I removed the description related to VTK_UNSIGNED_LONG_LONG, which is not necessary (at least) for my usage.