Returns the min of all values along a particular axis (dimension). 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 tuples and return a one tuple, n-component array. * axis=1: Return th
(array, axis=None, controller=None)
| 230 | |
| 231 | @dsa._override_numpy(numpy.min) |
| 232 | def min(array, axis=None, controller=None): |
| 233 | """Returns the min of all values along a particular axis (dimension). |
| 234 | Given an array of m tuples and n components: |
| 235 | * Default is to return the min of all values in an array. |
| 236 | * axis=0: Return the min values of all tuples and return a one |
| 237 | tuple, n-component array. |
| 238 | * axis=1: Return the min values of all components of each tuple and |
| 239 | return an m-tuple, 1-component array. |
| 240 | |
| 241 | When called in parallel, this function will compute the min across processes |
| 242 | when a controller argument is passed or the global controller is defined. |
| 243 | To disable parallel summing when running in parallel, pass a dummy controller as follows: |
| 244 | |
| 245 | min(array, controller=vtkmodules.vtkParallelCore.vtkDummyController()). |
| 246 | """ |
| 247 | from .algorithms import global_func |
| 248 | class MinImpl: |
| 249 | def op(self): |
| 250 | return algs.min |
| 251 | |
| 252 | def mpi_op(self): |
| 253 | from mpi4py import MPI |
| 254 | return MPI.MIN |
| 255 | |
| 256 | def serial_composite(self, array, axis): |
| 257 | res = _apply_func2(algs.min, array, (axis,)) |
| 258 | clean_list = [] |
| 259 | for a in res: |
| 260 | if a is not dsa.NoneArray: |
| 261 | clean_list.append(a) |
| 262 | if clean_list is []: |
| 263 | return None |
| 264 | return algs.min(clean_list, axis=0).astype(numpy.float64) |
| 265 | |
| 266 | def default(self): |
| 267 | return numpy.finfo(numpy.float64).max |
| 268 | |
| 269 | return global_func(MinImpl(), array, axis, controller) |
| 270 | |
| 271 | @dsa._override_numpy(numpy.all) |
| 272 | def all(array, axis=None, controller=None): |
nothing calls this directly
no test coverage detected