Skip to content

Commit

Permalink
Merge pull request #636 from fastai/nit
Browse files Browse the repository at this point in the history
rm `progress=False` from tests of `parallel` since that is the default
  • Loading branch information
jph00 authored Oct 10, 2024
2 parents f4a05cf + 62a6b32 commit 13a70b2
Showing 1 changed file with 38 additions and 15 deletions.
53 changes: 38 additions & 15 deletions nbs/03a_parallel.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -286,15 +286,26 @@
"text/markdown": [
"---\n",
"\n",
"### ThreadPoolExecutor\n",
"[source](https://github.com/fastai/fastcore/blob/master/fastcore/parallel.py#L75){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n",
"\n",
"> ThreadPoolExecutor (max_workers=8, on_exc=<built-infunctionprint>,\n",
"#### ThreadPoolExecutor\n",
"\n",
"> ThreadPoolExecutor (max_workers=8, on_exc=<built-in function print>,\n",
"> pause=0, **kwargs)\n",
"\n",
"Same as Python's ThreadPoolExecutor, except can pass `max_workers==0` for serial execution"
"*Same as Python's ThreadPoolExecutor, except can pass `max_workers==0` for serial execution*"
],
"text/plain": [
"<nbdev.showdoc.BasicMarkdownRenderer>"
"---\n",
"\n",
"[source](https://github.com/fastai/fastcore/blob/master/fastcore/parallel.py#L75){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n",
"\n",
"#### ThreadPoolExecutor\n",
"\n",
"> ThreadPoolExecutor (max_workers=8, on_exc=<built-in function print>,\n",
"> pause=0, **kwargs)\n",
"\n",
"*Same as Python's ThreadPoolExecutor, except can pass `max_workers==0` for serial execution*"
]
},
"execution_count": null,
Expand Down Expand Up @@ -346,16 +357,28 @@
"text/markdown": [
"---\n",
"\n",
"### ProcessPoolExecutor\n",
"[source](https://github.com/fastai/fastcore/blob/master/fastcore/parallel.py#L94){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n",
"\n",
"#### ProcessPoolExecutor\n",
"\n",
"> ProcessPoolExecutor (max_workers=8, on_exc=<built-infunctionprint>,\n",
"> ProcessPoolExecutor (max_workers=8, on_exc=<built-in function print>,\n",
"> pause=0, mp_context=None, initializer=None,\n",
"> initargs=())\n",
"\n",
"Same as Python's ProcessPoolExecutor, except can pass `max_workers==0` for serial execution"
"*Same as Python's ProcessPoolExecutor, except can pass `max_workers==0` for serial execution*"
],
"text/plain": [
"<nbdev.showdoc.BasicMarkdownRenderer>"
"---\n",
"\n",
"[source](https://github.com/fastai/fastcore/blob/master/fastcore/parallel.py#L94){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n",
"\n",
"#### ProcessPoolExecutor\n",
"\n",
"> ProcessPoolExecutor (max_workers=8, on_exc=<built-in function print>,\n",
"> pause=0, mp_context=None, initializer=None,\n",
"> initargs=())\n",
"\n",
"*Same as Python's ProcessPoolExecutor, except can pass `max_workers==0` for serial execution*"
]
},
"execution_count": null,
Expand Down Expand Up @@ -424,8 +447,8 @@
"source": [
"inp,exp = range(50),range(1,51)\n",
"\n",
"test_eq(parallel(add_one, inp, n_workers=2, progress=False), exp)\n",
"test_eq(parallel(add_one, inp, threadpool=True, n_workers=2, progress=False), exp)\n",
"test_eq(parallel(add_one, inp, n_workers=2), exp)\n",
"test_eq(parallel(add_one, inp, threadpool=True, n_workers=2), exp)\n",
"test_eq(parallel(add_one, inp, n_workers=1, a=2), range(2,52))\n",
"test_eq(parallel(add_one, inp, n_workers=0), exp)\n",
"test_eq(parallel(add_one, inp, n_workers=0, a=2), range(2,52))"
Expand Down Expand Up @@ -456,11 +479,11 @@
"name": "stdout",
"output_type": "stream",
"text": [
"0 2022-08-07 05:10:05.999916\n",
"1 2022-08-07 05:10:06.252031\n",
"2 2022-08-07 05:10:06.503603\n",
"3 2022-08-07 05:10:06.755216\n",
"4 2022-08-07 05:10:07.006702\n"
"0 2024-10-09 16:08:39.462154\n",
"1 2024-10-09 16:08:39.715074\n",
"2 2024-10-09 16:08:39.969191\n",
"3 2024-10-09 16:08:40.221442\n",
"4 2024-10-09 16:08:40.473224\n"
]
}
],
Expand Down

0 comments on commit 13a70b2

Please sign in to comment.