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

Function max_per_block

Wrapping/Python/vtkmodules/numpy_interface/algorithms.py:421–452  ·  view source on GitHub ↗

Returns the max 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 max of all values in an array. * axis=0: Return the max values of all components and return a one

(array, axis=None, controller=None)

Source from the content-addressed store, hash-verified

419 return sum(array, axis, controller)
420
421def max_per_block(array, axis=None, controller=None):
422 """Returns the max of all values along a particular axis (dimension)
423 for each block of a VTKCompositeDataArray.
424 Given an array of m tuples and n components:
425 * Default is to return the max of all values in an array.
426 * axis=0: Return the max values of all components and return a one
427 tuple, n-component array.
428 * axis=1: Return the max values of all components of each tuple and return
429 an m-tuple, 1-component array.
430
431 When called in parallel, this function will compute the max across
432 processes when a controller argument is passed or the global controller
433 is defined. To disable parallel summing when running in parallel, pass a
434 dummy controller as follows:
435
436 max_per_block(array, controller=vtkmodules.vtkParallelCore.vtkDummyController()).
437 """
438 class MaxPerBlockImpl:
439 def op(self):
440 return max
441
442 def op2(self):
443 return algs.max
444
445 def mpi_op(self):
446 from mpi4py import MPI
447 return MPI.MAX
448
449 def default(self):
450 return numpy.finfo(numpy.float64).min
451
452 return _global_per_block(MaxPerBlockImpl(), array, axis, controller)
453
454def min_per_block(array, axis=None, controller=None):
455 """Returns the min of all values along a particular axis (dimension)

Callers

nothing calls this directly

Calls 2

_global_per_blockFunction · 0.85
MaxPerBlockImplClass · 0.85

Tested by

no test coverage detected