Apply a function to each member of a VTKCompositeDataArray. VTKArray and numpy arrays are also supported.
(func, array, args=())
| 27 | return res |
| 28 | |
| 29 | def apply_ufunc(func, array, args=()): |
| 30 | """Apply a function to each member of a VTKCompositeDataArray. |
| 31 | VTKArray and numpy arrays are also supported.""" |
| 32 | if array is dsa.NoneArray: |
| 33 | return dsa.NoneArray |
| 34 | elif type(array) == dsa.VTKCompositeDataArray: |
| 35 | return dsa.VTKCompositeDataArray(_apply_func2(func, array, args), dataset = array.DataSet) |
| 36 | else: |
| 37 | return func(array, *args) |
| 38 | |
| 39 | def _make_ufunc(ufunc): |
| 40 | """ Given a ufunc, creates a closure that applies it to each member |
no test coverage detected