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

Function min_per_block

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

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

(array, axis=None, controller=None)

Source from the content-addressed store, hash-verified

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)
456 for each block of a VTKCompositeDataArray.
457 Given an array of m tuples and n components:
458 * Default is to return the min of all values in an array.
459 * axis=0: Return the min values of all components and return a one
460 tuple, n-component array.
461 * axis=1: Return the min values of all components of each tuple and
462 return an m-tuple, 1-component array.
463
464 When called in parallel, this function will compute the min across
465 processes when a controller argument is passed or the global controller
466 is defined. To disable parallel summing when running in parallel, pass a
467 dummy controller as follows:
468
469 min_per_block(array, controller=vtkmodules.vtkParallelCore.vtkDummyController()).
470 """
471 class MinPerBlockImpl:
472 def op(self):
473 return min
474
475 def op2(self):
476 return algs.min
477
478 def mpi_op(self):
479 from mpi4py import MPI
480 return MPI.MIN
481
482 def default(self):
483 return numpy.finfo(numpy.float64).max
484
485 return _global_per_block(MinPerBlockImpl(), array, axis, controller)
486
487@deprecated(version="9.6", message="Use np.all() instead of algs.all().")
488def all(array, axis=None, controller=None):

Callers

nothing calls this directly

Calls 2

_global_per_blockFunction · 0.85
MinPerBlockImplClass · 0.85

Tested by

no test coverage detected