##// END OF EJS Templates
Misc updates the display system....
Misc updates the display system. * PNG base64 encoding is now done at the ZMQ level, not in the display formatter itself. * All formatters are documented as to the exact nature of their return value. PNGs are not base64 encoded, LaTeX must include $/$$, Javascript should not have the <script> tags, etc. * Updated the Circle display example in docs/examples/core. * Renamed the sympy printing extension to sympyprinting.py.

File last commit:

r3666:a6a0636a
r3880:e7df0ac1
Show More
map.py
36 lines | 756 B | text/x-python | PythonLexer
MinRK
move IPython.zmq.parallel to IPython.parallel
r3666 from IPython.parallel import *
MinRK
updated newparallel examples, moved into docs
r3609
client = Client()
MinRK
update API after sagedays29...
r3664 view = client[:]
MinRK
updated newparallel examples, moved into docs
r3609
MinRK
update API after sagedays29...
r3664 @view.remote(block=True)
MinRK
updated newparallel examples, moved into docs
r3609 def square(a):
"""return square of a number"""
return a*a
squares = map(square, range(42))
# but that blocked between each result; not exactly useful
square.block = False
arlist = map(square, range(42))
# submitted very fast
# wait for the results:
squares2 = [ r.get() for r in arlist ]
# now the more convenient @parallel decorator, which has a map method:
MinRK
update API after sagedays29...
r3664 @view.parallel(block=False)
MinRK
updated newparallel examples, moved into docs
r3609 def psquare(a):
"""return square of a number"""
return a*a
# this chunks the data into n-negines jobs, not 42 jobs:
ar = psquare.map(range(42))
# wait for the results to be done:
squares3 = ar.get()
print squares == squares2, squares3==squares
# True