Test if the numpy and VTK array share the same data.
(self)
| 94 | self._check_arrays(res, vtk_arr) |
| 95 | |
| 96 | def testNumpyView(self): |
| 97 | "Test if the numpy and VTK array share the same data." |
| 98 | # ---------------------------------------- |
| 99 | # Test if the array is copied or not. |
| 100 | a = numpy.array([[1, 2, 3],[4, 5, 6]], 'd') |
| 101 | vtk_arr = numpy_to_vtk(a) |
| 102 | # Change the numpy array and see if the changes are |
| 103 | # reflected in the VTK array. |
| 104 | a[0] = [10.0, 20.0, 30.0] |
| 105 | self.assertEqual(vtk_arr.GetTuple3(0), (10., 20., 30.)) |
| 106 | |
| 107 | def testNumpyConversion(self): |
| 108 | "Test that converting data copies data properly." |
nothing calls this directly
no test coverage detected