Returns True if all values of an array evaluate to True, returns False otherwise. This is useful to check if all values of an array match a certain condition such as: algorithms.all(array > 5)
(array, axis=None, controller=None)
| 270 | |
| 271 | @dsa._override_numpy(numpy.all) |
| 272 | def all(array, axis=None, controller=None): |
| 273 | """Returns True if all values of an array evaluate to True, returns |
| 274 | False otherwise. |
| 275 | This is useful to check if all values of an array match a certain |
| 276 | condition such as: |
| 277 | |
| 278 | algorithms.all(array > 5) |
| 279 | """ |
| 280 | from .algorithms import global_func |
| 281 | class AllImpl: |
| 282 | def op(self): |
| 283 | return algs.all |
| 284 | |
| 285 | def mpi_op(self): |
| 286 | from mpi4py import MPI |
| 287 | return MPI.LAND |
| 288 | |
| 289 | def serial_composite(self, array, axis): |
| 290 | res = _apply_func2(algs.all, array, (axis,)) |
| 291 | clean_list = [] |
| 292 | for a in res: |
| 293 | if a is not dsa.NoneArray: |
| 294 | clean_list.append(a) |
| 295 | if clean_list is []: |
| 296 | return None |
| 297 | return algs.all(clean_list, axis=0) |
| 298 | |
| 299 | def default(self, max_comps): |
| 300 | return numpy.ones(max_comps, dtype=bool) |
| 301 | |
| 302 | return global_func(AllImpl(), array, axis, controller) |
| 303 | |
| 304 | @dsa._override_numpy(numpy.mean) |
| 305 | def mean(array, axis=None, controller=None, size=None): |
nothing calls this directly
no test coverage detected