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)
Input variables#

Name

Type

Default

Description

func

Function to apply. Callable with single objects in input list

input_list

inputs for the function.

num_processors

number of processors to use. If 1, will apply locally in the shell.

Output variables#

Return annotation

Docstring type

Description

None

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]