dohlee.thread module

dohlee.thread.imap_helper(args)[source]

Helper function for imap. This is needed since built-in multiprocessing library does not have istarmap function. If packed arguments are passed, it unpacks the arguments and pass through the function. Otherwise, it just pass the argument through the given function.

Attributes:
args: Tuple of two arguments, user-defined function and arguments to pass through.
dohlee.thread.threaded(func, params, processes, progress=False, progress_type='tqdm')[source]

Generate results of the function with given parameters with threads.

Attributes:
func (function): Function to be executed. params (iterable): A list of parameters. processes (int): Number of processes to work on. progress (bool): if True, show progress bar. progress_type (str): ‘tqdm’ or ‘tqdm_notebook’ can be used.