Equivalent of `list(map(fn, *iterables))` driven by `concurrent.futures.ThreadPoolExecutor`. Parameters ---------- tqdm_class : optional `tqdm` class to use for bars [default: tqdm.auto.tqdm]. max_workers : int, optional Maximum number of workers to spawn;
(fn, *iterables, **tqdm_kwargs)
| 52 | |
| 53 | |
| 54 | def thread_map(fn, *iterables, **tqdm_kwargs): |
| 55 | """ |
| 56 | Equivalent of `list(map(fn, *iterables))` |
| 57 | driven by `concurrent.futures.ThreadPoolExecutor`. |
| 58 | |
| 59 | Parameters |
| 60 | ---------- |
| 61 | tqdm_class : optional |
| 62 | `tqdm` class to use for bars [default: tqdm.auto.tqdm]. |
| 63 | max_workers : int, optional |
| 64 | Maximum number of workers to spawn; passed to |
| 65 | `concurrent.futures.ThreadPoolExecutor.__init__`. |
| 66 | [default: max(32, cpu_count() + 4)]. |
| 67 | """ |
| 68 | from concurrent.futures import ThreadPoolExecutor |
| 69 | return _executor_map(ThreadPoolExecutor, fn, *iterables, **tqdm_kwargs) |
| 70 | |
| 71 | |
| 72 | def process_map(fn, *iterables, **tqdm_kwargs): |
nothing calls this directly
no test coverage detected