parallel_apply_along_axis

sitelle.parallel.parallel_apply_along_axis(func1d, axis, arr, *args, **kwargs)

Apply a function to 1-D slices along the given axis. Like numpy.apply_along_axis(), but takes advantage of multiple cores.

Parameters:
  • func1d (callable) – This function should accept 1-D arrays. It is applied to 1-D slice of arr along the specified axis.
  • axis (integer) – Axis along which arr is sliced.
  • arr (ndarray) – Input array
  • modules (tuple of strings) – The modules to be imported so that func1d works correctly. Example : (‘import numpy as np’,)
  • depfuncs (tuple of string) – The functions used by func1d but defined outside of its body
  • args – Additional arguments to be passed to func1d
  • kwargs – Additional keywords arguments to be passed to func1d
Returns:

out – The output array. The shape of out is identical to the shape of arr, except along the axis dimension. This axis is removed, and replaced with new dimensions equal to the shape of the return value of func1d. So if func1d returns a scalar out will have one fewer dimensions than arr.

Return type:

ndarray