Returns the mean of all values along a particular axis (dimension) for each block of a VTKCompositeDataArray. Given an array of m tuples and n components: * Default is to return the mean of all values in an array. * axis=0: Return the mean values of all components and return a one
(array, axis=None, controller=None)
| 396 | return _global_per_block(CountPerBlockImpl(), array, axis, controller) |
| 397 | |
| 398 | def mean_per_block(array, axis=None, controller=None): |
| 399 | """Returns the mean of all values along a particular axis (dimension) |
| 400 | for each block of a VTKCompositeDataArray. |
| 401 | |
| 402 | Given an array of m tuples and n components: |
| 403 | * Default is to return the mean of all values in an array. |
| 404 | * axis=0: Return the mean values of all components and return a one |
| 405 | tuple, n-component array. |
| 406 | * axis=1: Return the mean values of all components of each tuple and |
| 407 | return an m-tuple, 1-component array. |
| 408 | |
| 409 | When called in parallel, this function will compute the mean across |
| 410 | processes when a controller argument is passed or the global controller |
| 411 | is defined. To disable parallel summing when running in parallel, pass a |
| 412 | dummy controller as follows: |
| 413 | |
| 414 | mean(array, controller=vtkmodules.vtkParallelCore.vtkDummyController()). |
| 415 | """ |
| 416 | if axis is None or axis == 0: |
| 417 | return sum_per_block(array, axis, controller) / count_per_block(array, axis, controller) |
| 418 | else: |
| 419 | return sum(array, axis, controller) |
| 420 | |
| 421 | def max_per_block(array, axis=None, controller=None): |
| 422 | """Returns the max of all values along a particular axis (dimension) |
nothing calls this directly
no test coverage detected