boltz_data.parallel

Contents

boltz_data.parallel#

Parallel processing utilities.

Functions

parallel_imap(func, iterable, /, *[, ...])

Apply a function to an iterable in parallel using multiprocessing.

boltz_data.parallel.parallel_imap(func, iterable, /, *, n_jobs=None, chunk_size=None, desc=None)[source]#

Apply a function to an iterable in parallel using multiprocessing.

Parameters:
  • func (Callable[[TypeVar(T)], TypeVar(R)]) – Function to apply to each element

  • iterable (Iterable[TypeVar(T)]) – Iterable of items to process

  • n_jobs (int | None) – Number of parallel processes (default: cpu_count())

  • chunk_size (int | None) – Size of chunks sent to worker processes (default: automatic)

  • desc (str | None) – Description for progress bar

Return type:

Generator[TypeVar(R)]

Returns:

Generator of results in the same order as the input iterable