|
286 | 286 | "text/markdown": [
|
287 | 287 | "---\n",
|
288 | 288 | "\n",
|
289 |
| - "### ThreadPoolExecutor\n", |
| 289 | + "[source](https://github.com/fastai/fastcore/blob/master/fastcore/parallel.py#L75){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", |
290 | 290 | "\n",
|
291 |
| - "> ThreadPoolExecutor (max_workers=8, on_exc=<built-infunctionprint>,\n", |
| 291 | + "#### ThreadPoolExecutor\n", |
| 292 | + "\n", |
| 293 | + "> ThreadPoolExecutor (max_workers=8, on_exc=<built-in function print>,\n", |
292 | 294 | "> pause=0, **kwargs)\n",
|
293 | 295 | "\n",
|
294 |
| - "Same as Python's ThreadPoolExecutor, except can pass `max_workers==0` for serial execution" |
| 296 | + "*Same as Python's ThreadPoolExecutor, except can pass `max_workers==0` for serial execution*" |
295 | 297 | ],
|
296 | 298 | "text/plain": [
|
297 |
| - "<nbdev.showdoc.BasicMarkdownRenderer>" |
| 299 | + "---\n", |
| 300 | + "\n", |
| 301 | + "[source](https://github.com/fastai/fastcore/blob/master/fastcore/parallel.py#L75){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", |
| 302 | + "\n", |
| 303 | + "#### ThreadPoolExecutor\n", |
| 304 | + "\n", |
| 305 | + "> ThreadPoolExecutor (max_workers=8, on_exc=<built-in function print>,\n", |
| 306 | + "> pause=0, **kwargs)\n", |
| 307 | + "\n", |
| 308 | + "*Same as Python's ThreadPoolExecutor, except can pass `max_workers==0` for serial execution*" |
298 | 309 | ]
|
299 | 310 | },
|
300 | 311 | "execution_count": null,
|
|
346 | 357 | "text/markdown": [
|
347 | 358 | "---\n",
|
348 | 359 | "\n",
|
349 |
| - "### ProcessPoolExecutor\n", |
| 360 | + "[source](https://github.com/fastai/fastcore/blob/master/fastcore/parallel.py#L94){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", |
| 361 | + "\n", |
| 362 | + "#### ProcessPoolExecutor\n", |
350 | 363 | "\n",
|
351 |
| - "> ProcessPoolExecutor (max_workers=8, on_exc=<built-infunctionprint>,\n", |
| 364 | + "> ProcessPoolExecutor (max_workers=8, on_exc=<built-in function print>,\n", |
352 | 365 | "> pause=0, mp_context=None, initializer=None,\n",
|
353 | 366 | "> initargs=())\n",
|
354 | 367 | "\n",
|
355 |
| - "Same as Python's ProcessPoolExecutor, except can pass `max_workers==0` for serial execution" |
| 368 | + "*Same as Python's ProcessPoolExecutor, except can pass `max_workers==0` for serial execution*" |
356 | 369 | ],
|
357 | 370 | "text/plain": [
|
358 |
| - "<nbdev.showdoc.BasicMarkdownRenderer>" |
| 371 | + "---\n", |
| 372 | + "\n", |
| 373 | + "[source](https://github.com/fastai/fastcore/blob/master/fastcore/parallel.py#L94){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", |
| 374 | + "\n", |
| 375 | + "#### ProcessPoolExecutor\n", |
| 376 | + "\n", |
| 377 | + "> ProcessPoolExecutor (max_workers=8, on_exc=<built-in function print>,\n", |
| 378 | + "> pause=0, mp_context=None, initializer=None,\n", |
| 379 | + "> initargs=())\n", |
| 380 | + "\n", |
| 381 | + "*Same as Python's ProcessPoolExecutor, except can pass `max_workers==0` for serial execution*" |
359 | 382 | ]
|
360 | 383 | },
|
361 | 384 | "execution_count": null,
|
|
424 | 447 | "source": [
|
425 | 448 | "inp,exp = range(50),range(1,51)\n",
|
426 | 449 | "\n",
|
427 |
| - "test_eq(parallel(add_one, inp, n_workers=2, progress=False), exp)\n", |
428 |
| - "test_eq(parallel(add_one, inp, threadpool=True, n_workers=2, progress=False), exp)\n", |
| 450 | + "test_eq(parallel(add_one, inp, n_workers=2), exp)\n", |
| 451 | + "test_eq(parallel(add_one, inp, threadpool=True, n_workers=2), exp)\n", |
429 | 452 | "test_eq(parallel(add_one, inp, n_workers=1, a=2), range(2,52))\n",
|
430 | 453 | "test_eq(parallel(add_one, inp, n_workers=0), exp)\n",
|
431 | 454 | "test_eq(parallel(add_one, inp, n_workers=0, a=2), range(2,52))"
|
|
456 | 479 | "name": "stdout",
|
457 | 480 | "output_type": "stream",
|
458 | 481 | "text": [
|
459 |
| - "0 2022-08-07 05:10:05.999916\n", |
460 |
| - "1 2022-08-07 05:10:06.252031\n", |
461 |
| - "2 2022-08-07 05:10:06.503603\n", |
462 |
| - "3 2022-08-07 05:10:06.755216\n", |
463 |
| - "4 2022-08-07 05:10:07.006702\n" |
| 482 | + "0 2024-10-09 16:08:39.462154\n", |
| 483 | + "1 2024-10-09 16:08:39.715074\n", |
| 484 | + "2 2024-10-09 16:08:39.969191\n", |
| 485 | + "3 2024-10-09 16:08:40.221442\n", |
| 486 | + "4 2024-10-09 16:08:40.473224\n" |
464 | 487 | ]
|
465 | 488 | }
|
466 | 489 | ],
|
|
0 commit comments