MCPcopy Create free account
hub / github.com/Kitware/VTK / _apply_func2

Function _apply_func2

Wrapping/Python/vtkmodules/numpy_interface/numpy_algorithms.py:14–27  ·  view source on GitHub ↗

Apply a function to each member of a VTKCompositeDataArray. Returns a list of arrays. Note that this function is mainly for internal use by this module.

(func, array, args)

Source from the content-addressed store, hash-verified

12from . import internal_algorithms as algs
13
14def _apply_func2(func, array, args):
15 """Apply a function to each member of a VTKCompositeDataArray.
16 Returns a list of arrays.
17
18 Note that this function is mainly for internal use by this module."""
19 if array is dsa.NoneArray:
20 return []
21 res = []
22 for a in array.Arrays:
23 if a is dsa.NoneArray:
24 res.append(dsa.NoneArray)
25 else:
26 res.append(func(a, *args))
27 return res
28
29def apply_ufunc(func, array, args=()):
30 """Apply a function to each member of a VTKCompositeDataArray.

Callers 4

apply_ufuncFunction · 0.85
serial_compositeMethod · 0.85
serial_compositeMethod · 0.85
serial_compositeMethod · 0.85

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected