boltz_data.parallel#
Parallel processing utilities.
Functions
|
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 elementiterable (
Iterable[TypeVar(T)]) – Iterable of items to processn_jobs (
int|None) – Number of parallel processes (default: cpu_count())chunk_size (
int|None) – Size of chunks sent to worker processes (default: automatic)
- Return type:
- Returns:
Generator of results in the same order as the input iterable