deepmol.parallelism package

Submodules

deepmol.parallelism.multiprocessing module

class JoblibMultiprocessing(n_jobs: int = -1, process: callable | None = None)[source]

Bases: MultiprocessingClass

Multiprocessing class using joblib.

run(items: Iterable) Iterable[source]

Runs the multiprocessing.

Parameters:

items (Iterable) – The items to use for multiprocessing.

Returns:

results – The results of the multiprocessing.

Return type:

Iterable

class MultiprocessingClass(n_jobs: int = -1, process: callable | None = None)[source]

Bases: ABC

Base class for multiprocessing.

property process

Returns the function to use for multiprocessing.

abstract run(items: Iterable) Iterable[source]

Runs the multiprocessing.

Parameters:

items (Iterable) – The items to use for multiprocessing.

Returns:

results – The results of the multiprocessing.

Return type:

Iterable

run_iteratively(items: list)[source]

Does not run multiprocessing due to an error pickling the process function or other.

tqdm_joblib(tqdm_object)[source]

Context manager to patch joblib to report into tqdm progress bar given as argument

Module contents