utils.multiprocessing#
Back to Module page
Summary#
A shorthand function to apply multiprocessing in a one liner
Signature#
def multiprocessing(func, input_list, num_processors)
Name |
Type |
Default |
Description |
|---|---|---|---|
|
Function to apply. Callable with single objects in input list |
||
|
inputs for the function. |
||
|
number of processors to use. If 1, will apply locally in the shell. |
Output variables#
Return annotation |
Docstring type |
Description |
|---|---|---|
|
the list [func(inp) for inp in input_list] |
Docstring#
A shorthand function to apply multiprocessing in a one liner
:param func: Function to apply. Callable with single objects in input list
:param input_list: inputs for the function.
:param num_processors: number of processors to use. If 1, will apply locally in the shell.
:return: the list [func(inp) for inp in input_list]