|
11 | 11 | },
|
12 | 12 | {
|
13 | 13 | "cell_type": "code",
|
14 |
| - "execution_count": 41, |
| 14 | + "execution_count": 2, |
15 | 15 | "metadata": {},
|
16 | 16 | "outputs": [],
|
17 | 17 | "source": [
|
18 | 18 | "#|export\n",
|
19 |
| - "from fastcore.utils import *\n", |
| 19 | + "from fastcore.imports import *\n", |
| 20 | + "from fastcore.basics import *\n", |
| 21 | + "from fastcore.foundation import *\n", |
20 | 22 | "from fastcore.meta import *\n",
|
21 | 23 | "from fastcore.xtras import *\n",
|
22 | 24 | "from functools import wraps\n",
|
23 | 25 | "\n",
|
24 | 26 | "import concurrent.futures,time\n",
|
25 | 27 | "from multiprocessing import Process,Queue,Manager,set_start_method,get_all_start_methods,get_context\n",
|
26 |
| - "from threading import Thread" |
| 28 | + "from threading import Thread\n", |
| 29 | + "try:\n", |
| 30 | + " if sys.platform == 'darwin' and IN_NOTEBOOK: set_start_method(\"fork\")\n", |
| 31 | + "except: pass" |
27 | 32 | ]
|
28 | 33 | },
|
29 | 34 | {
|
|
210 | 215 | "Same as Python's ThreadPoolExecutor, except can pass `max_workers==0` for serial execution"
|
211 | 216 | ],
|
212 | 217 | "text/plain": [
|
213 |
| - "<nbdev.showdoc.BasicMarkdownRenderer at 0x111d8beb0>" |
| 218 | + "<nbdev.showdoc.BasicMarkdownRenderer at 0x1034390a0>" |
214 | 219 | ]
|
215 | 220 | },
|
216 | 221 | "execution_count": 11,
|
|
224 | 229 | },
|
225 | 230 | {
|
226 | 231 | "cell_type": "code",
|
227 |
| - "execution_count": 44, |
| 232 | + "execution_count": 12, |
228 | 233 | "metadata": {},
|
229 | 234 | "outputs": [],
|
230 | 235 | "source": [
|
|
254 | 259 | },
|
255 | 260 | {
|
256 | 261 | "cell_type": "code",
|
257 |
| - "execution_count": 45, |
| 262 | + "execution_count": 13, |
258 | 263 | "metadata": {},
|
259 | 264 | "outputs": [
|
260 | 265 | {
|
|
271 | 276 | "Same as Python's ProcessPoolExecutor, except can pass `max_workers==0` for serial execution"
|
272 | 277 | ],
|
273 | 278 | "text/plain": [
|
274 |
| - "<nbdev.showdoc.BasicMarkdownRenderer at 0x130453370>" |
| 279 | + "<nbdev.showdoc.BasicMarkdownRenderer at 0x10f325e20>" |
275 | 280 | ]
|
276 | 281 | },
|
277 |
| - "execution_count": 45, |
| 282 | + "execution_count": 13, |
278 | 283 | "metadata": {},
|
279 | 284 | "output_type": "execute_result"
|
280 | 285 | }
|
|
285 | 290 | },
|
286 | 291 | {
|
287 | 292 | "cell_type": "code",
|
288 |
| - "execution_count": 46, |
| 293 | + "execution_count": 14, |
289 | 294 | "metadata": {},
|
290 | 295 | "outputs": [],
|
291 | 296 | "source": [
|
|
296 | 301 | },
|
297 | 302 | {
|
298 | 303 | "cell_type": "code",
|
299 |
| - "execution_count": 52, |
| 304 | + "execution_count": 15, |
300 | 305 | "metadata": {},
|
301 | 306 | "outputs": [],
|
302 | 307 | "source": [
|
|
320 | 325 | },
|
321 | 326 | {
|
322 | 327 | "cell_type": "code",
|
323 |
| - "execution_count": 48, |
| 328 | + "execution_count": 16, |
324 | 329 | "metadata": {},
|
325 | 330 | "outputs": [],
|
326 | 331 | "source": [
|
|
334 | 339 | },
|
335 | 340 | {
|
336 | 341 | "cell_type": "code",
|
337 |
| - "execution_count": 50, |
| 342 | + "execution_count": 17, |
338 | 343 | "metadata": {},
|
339 | 344 | "outputs": [],
|
340 | 345 | "source": [
|
|
364 | 369 | "name": "stdout",
|
365 | 370 | "output_type": "stream",
|
366 | 371 | "text": [
|
367 |
| - "0 2022-07-26 03:53:34.945994\n", |
368 |
| - "1 2022-07-26 03:53:35.197160\n", |
369 |
| - "2 2022-07-26 03:53:35.449657\n", |
370 |
| - "3 2022-07-26 03:53:35.700623\n", |
371 |
| - "4 2022-07-26 03:53:35.952134\n" |
| 372 | + "0 2022-07-26 04:12:18.858918\n", |
| 373 | + "1 2022-07-26 04:12:19.110316\n", |
| 374 | + "2 2022-07-26 04:12:19.362060\n", |
| 375 | + "3 2022-07-26 04:12:19.612606\n", |
| 376 | + "4 2022-07-26 04:12:19.863821\n" |
372 | 377 | ]
|
373 | 378 | }
|
374 | 379 | ],
|
|
384 | 389 | },
|
385 | 390 | {
|
386 | 391 | "cell_type": "code",
|
387 |
| - "execution_count": 29, |
| 392 | + "execution_count": 19, |
388 | 393 | "metadata": {},
|
389 | 394 | "outputs": [],
|
390 | 395 | "source": [
|
|
395 | 400 | },
|
396 | 401 | {
|
397 | 402 | "cell_type": "code",
|
398 |
| - "execution_count": 30, |
| 403 | + "execution_count": 20, |
399 | 404 | "metadata": {},
|
400 | 405 | "outputs": [
|
401 | 406 | {
|
|
404 | 409 | "(#8) [0,2,4,6,8,10,12,14]"
|
405 | 410 | ]
|
406 | 411 | },
|
407 |
| - "execution_count": 30, |
| 412 | + "execution_count": 20, |
408 | 413 | "metadata": {},
|
409 | 414 | "output_type": "execute_result"
|
410 | 415 | }
|
|
467 | 472 | "cell_type": "code",
|
468 | 473 | "execution_count": 24,
|
469 | 474 | "metadata": {},
|
470 |
| - "outputs": [ |
471 |
| - { |
472 |
| - "data": { |
473 |
| - "text/html": [ |
474 |
| - "\n", |
475 |
| - "<style>\n", |
476 |
| - " /* Turns off some styling */\n", |
477 |
| - " progress {\n", |
478 |
| - " /* gets rid of default border in Firefox and Opera. */\n", |
479 |
| - " border: none;\n", |
480 |
| - " /* Needs to be in here for Safari polyfill so background images work as expected. */\n", |
481 |
| - " background-size: auto;\n", |
482 |
| - " }\n", |
483 |
| - " progress:not([value]), progress:not([value])::-webkit-progress-bar {\n", |
484 |
| - " background: repeating-linear-gradient(45deg, #7e7e7e, #7e7e7e 10px, #5c5c5c 10px, #5c5c5c 20px);\n", |
485 |
| - " }\n", |
486 |
| - " .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n", |
487 |
| - " background: #F44336;\n", |
488 |
| - " }\n", |
489 |
| - "</style>\n" |
490 |
| - ], |
491 |
| - "text/plain": [ |
492 |
| - "<IPython.core.display.HTML object>" |
493 |
| - ] |
494 |
| - }, |
495 |
| - "metadata": {}, |
496 |
| - "output_type": "display_data" |
497 |
| - }, |
498 |
| - { |
499 |
| - "data": { |
500 |
| - "text/html": [], |
501 |
| - "text/plain": [ |
502 |
| - "<IPython.core.display.HTML object>" |
503 |
| - ] |
504 |
| - }, |
505 |
| - "metadata": {}, |
506 |
| - "output_type": "display_data" |
507 |
| - } |
508 |
| - ], |
| 475 | + "outputs": [], |
509 | 476 | "source": [
|
510 | 477 | "# class _C:\n",
|
511 | 478 | "# def __call__(self, o): return ((i+1) for i in o)\n",
|
|
610 | 577 | },
|
611 | 578 | {
|
612 | 579 | "cell_type": "code",
|
613 |
| - "execution_count": 53, |
| 580 | + "execution_count": 27, |
614 | 581 | "metadata": {},
|
615 | 582 | "outputs": [],
|
616 | 583 | "source": [
|
|
0 commit comments