Show More
@@ -522,13 +522,13 b' be collected and raise a CompositeError, as demonstrated in the next section.' | |||||
522 |
|
522 | |||
523 | In [69]: from IPython.parallel import require |
|
523 | In [69]: from IPython.parallel import require | |
524 |
|
524 | |||
525 |
In [70]: @require('re') |
|
525 | In [70]: @require('re') | |
526 | ....: def findall(pat, x): |
|
526 | ....: def findall(pat, x): | |
527 | ....: # re is guaranteed to be available |
|
527 | ....: # re is guaranteed to be available | |
528 | ....: return re.findall(pat, x) |
|
528 | ....: return re.findall(pat, x) | |
529 |
|
529 | |||
530 | # you can also pass modules themselves, that you already have locally: |
|
530 | # you can also pass modules themselves, that you already have locally: | |
531 |
In [71]: @require(time) |
|
531 | In [71]: @require(time) | |
532 | ....: def wait(t): |
|
532 | ....: def wait(t): | |
533 | ....: time.sleep(t) |
|
533 | ....: time.sleep(t) | |
534 | ....: return t |
|
534 | ....: return t |
@@ -186,7 +186,7 b' will be assigned to another engine. If the dependency returns *anything other th' | |||||
186 | ....: def wintask(): |
|
186 | ....: def wintask(): | |
187 | ....: do_windows_stuff() |
|
187 | ....: do_windows_stuff() | |
188 |
|
188 | |||
189 |
In this case, any time you apply ``m |
|
189 | In this case, any time you apply ``mactask``, it will only run on an OSX machine. | |
190 | ``@depend`` is just like ``apply``, in that it has a ``@depend(f,*args,**kwargs)`` |
|
190 | ``@depend`` is just like ``apply``, in that it has a ``@depend(f,*args,**kwargs)`` | |
191 | signature. |
|
191 | signature. | |
192 |
|
192 |
General Comments 0
You need to be logged in to leave comments.
Login now