Skip to content

Commit c27c2a3

Browse files
Juan Daniel TorresJuan Daniel Torres
Juan Daniel Torres
authored and
Juan Daniel Torres
committed
docstring for f
1 parent 7435ecc commit c27c2a3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

docs/source/tutorial/tutorial.advanced-topics.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ Adaptive by itself does not implement a way of sharing partial results between f
373373
Its implementation of parallel computation using executors is minimal by design.
374374
Instead the appropriate way to implement custom parallelization is by using coroutines (asynchronous functions).
375375

376-
We illustrate this approach by using dask.distributed for parallel computations in part because it supports asynchronous operation out-of-the-box.
376+
We illustrate this approach by using `dask.distributed` for parallel computations in part because it supports asynchronous operation out-of-the-box.
377377
Let us consider a function `f(x)` which is composed by two parts.
378378
It has a slow part `g` which can be reused by multiple inputs and shared between workers.
379379
It has fast part `h` that will be computed for every `x`.
@@ -382,6 +382,10 @@ It has fast part `h` that will be computed for every `x`.
382382
import time
383383
384384
def f(x):
385+
"""
386+
Integer part of `x` will be reused
387+
Decimal part requires a new computation
388+
"""
385389
return g(int(x)) + h(x % 1)
386390
387391

0 commit comments

Comments
 (0)