Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

eliminate relative imports

  • Loading branch information...
commit a0bfb1f70d5c3300a322d126618cbb2fcb836395 1 parent 4f574e1
@minrk minrk authored
View
14 IPython/utils/newserialized.py
@@ -100,7 +100,7 @@ def __init__(self, unSerialized):
self.typeDescriptor = 'ndarray'
self.metadata = {'shape':self.obj.shape,
'dtype':self.obj.dtype.str}
- elif isinstance(self.obj, str):
+ elif isinstance(self.obj, bytes):
self.typeDescriptor = 'bytes'
self.metadata = {}
elif isinstance(self.obj, buffer):
@@ -109,7 +109,7 @@ def __init__(self, unSerialized):
else:
self.typeDescriptor = 'pickle'
self.metadata = {}
- self._generateData()
+ self._generateData()
def _generateData(self):
if self.typeDescriptor == 'ndarray':
@@ -145,11 +145,13 @@ def __init__(self, serialized):
def getObject(self):
typeDescriptor = self.serialized.getTypeDescriptor()
if globals().has_key('numpy') and typeDescriptor == 'ndarray':
- result = numpy.frombuffer(self.serialized.getData(), dtype = self.serialized.metadata['dtype'])
+ buf = self.serialized.getData()
+ if isinstance(buf, buffer):
+ result = numpy.frombuffer(buf, dtype = self.serialized.metadata['dtype'])
+ else:
+ # memoryview
+ result = numpy.array(buf, dtype = self.serialized.metadata['dtype'])
result.shape = self.serialized.metadata['shape']
- # numpy arrays with frombuffer are read-only. We are working with
- # the numpy folks to address this issue.
- # result = result.copy()
elif typeDescriptor == 'pickle':
result = pickle.loads(self.serialized.getData())
elif typeDescriptor in ('bytes', 'buffer'):
View
2  IPython/zmq/parallel/asyncresult.py
@@ -13,7 +13,7 @@
import time
from IPython.external.decorator import decorator
-import error
+from . import error
#-----------------------------------------------------------------------------
# Classes
View
18 IPython/zmq/parallel/client.py
@@ -29,15 +29,15 @@
from IPython.external.decorator import decorator
from IPython.external.ssh import tunnel
-import error
-import map as Map
-import streamsession as ss
-from asyncresult import AsyncResult, AsyncMapResult, AsyncHubResult
-from clusterdir import ClusterDir, ClusterDirError
-from dependency import Dependency, depend, require, dependent
-from remotefunction import remote,parallel,ParallelFunction,RemoteFunction
-from util import ReverseDict, disambiguate_url, validate_url
-from view import DirectView, LoadBalancedView
+from . import error
+from . import map as Map
+from . import streamsession as ss
+from .asyncresult import AsyncResult, AsyncMapResult, AsyncHubResult
+from .clusterdir import ClusterDir, ClusterDirError
+from .dependency import Dependency, depend, require, dependent
+from .remotefunction import remote,parallel,ParallelFunction,RemoteFunction
+from .util import ReverseDict, disambiguate_url, validate_url
+from .view import DirectView, LoadBalancedView
#--------------------------------------------------------------------------
# helpers for implementing old MEC API via client.apply
View
6 IPython/zmq/parallel/controller.py
@@ -23,9 +23,9 @@
from IPython.utils.importstring import import_item
from IPython.utils.traitlets import Int, Str, Instance, List, Bool
-from entry_point import signal_children
-from hub import Hub, HubFactory
-from scheduler import launch_scheduler
+from .entry_point import signal_children
+from .hub import Hub, HubFactory
+from .scheduler import launch_scheduler
#-----------------------------------------------------------------------------
# Configurable
View
4 IPython/zmq/parallel/dependency.py
@@ -2,8 +2,8 @@
from IPython.external.decorator import decorator
-from asyncresult import AsyncResult
-from error import UnmetDependency
+from .asyncresult import AsyncResult
+from .error import UnmetDependency
class depend(object):
View
10 IPython/zmq/parallel/engine.py
@@ -19,11 +19,11 @@
from IPython.utils.traitlets import Instance, Str, Dict, Int, Type, CFloat
# from IPython.utils.localinterfaces import LOCALHOST
-import heartmonitor
-from factory import RegistrationFactory
-from streamkernel import Kernel
-from streamsession import Message
-from util import disambiguate_url
+from . import heartmonitor
+from .factory import RegistrationFactory
+from .streamkernel import Kernel
+from .streamsession import Message
+from .util import disambiguate_url
def printer(*msg):
# print (self.log.handlers, file=sys.__stdout__)
View
1  IPython/zmq/parallel/entry_point.py
@@ -23,6 +23,7 @@
# System library imports.
import zmq
from zmq.log import handlers
+
# Local imports.
from IPython.core.ultratb import FormattedTB
from IPython.external.argparse import ArgumentParser
View
2  IPython/zmq/parallel/error.py
@@ -215,7 +215,7 @@ def _get_engine_str(self, ei):
if not ei:
return '[Engine Exception]'
else:
- return '[%s:%s]: ' % (ei['engineid'], ei['method'])
+ return '[%s:%s]: ' % (ei['engine_id'], ei['method'])
def _get_traceback(self, ev):
try:
View
2  IPython/zmq/parallel/heartmonitor.py
@@ -14,7 +14,7 @@
from zmq.eventloop import ioloop, zmqstream
from IPython.utils.traitlets import Set, Instance, CFloat, Bool
-from factory import LoggingFactory
+from .factory import LoggingFactory
class Heart(object):
"""A basic heart object for responding to a HeartMonitor.
View
10 IPython/zmq/parallel/hub.py
@@ -29,12 +29,12 @@
from IPython.utils.importstring import import_item
from IPython.utils.traitlets import HasTraits, Instance, Int, CStr, Str, Dict, Set, List, Bool
-from entry_point import select_random_ports
-from factory import RegistrationFactory, LoggingFactory
+from .entry_point import select_random_ports
+from .factory import RegistrationFactory, LoggingFactory
-from heartmonitor import HeartMonitor
-from streamsession import Message, wrap_exception, ISO8601
-from util import validate_url_container
+from .heartmonitor import HeartMonitor
+from .streamsession import Message, wrap_exception, ISO8601
+from .util import validate_url_container
try:
from pymongo.binary import Binary
View
2  IPython/zmq/parallel/ipcontrollerapp.py
@@ -36,10 +36,10 @@
ApplicationWithClusterDir,
ClusterDirConfigLoader
)
+from IPython.zmq.parallel.util import disambiguate_ip_address, split_url
# from IPython.kernel.fcutil import FCServiceFactory, FURLError
from IPython.utils.traitlets import Instance, Unicode
-from util import disambiguate_ip_address, split_url
#-----------------------------------------------------------------------------
View
2  IPython/zmq/parallel/ipengineapp.py
@@ -31,9 +31,9 @@
from IPython.zmq.parallel import factory
from IPython.zmq.parallel.engine import EngineFactory
from IPython.zmq.parallel.streamkernel import Kernel
+from IPython.zmq.parallel.util import disambiguate_url
from IPython.utils.importstring import import_item
-from util import disambiguate_url
#-----------------------------------------------------------------------------
# Module level variables
View
2  IPython/zmq/parallel/iploggerapp.py
@@ -24,7 +24,7 @@
ApplicationWithClusterDir,
ClusterDirConfigLoader
)
-from IPython.zmq.parallel.logwatcher import LogWatcher
+from .logwatcher import LogWatcher
#-----------------------------------------------------------------------------
# Module level variables
View
3  IPython/zmq/parallel/kernelstarter.py
@@ -1,7 +1,8 @@
"""KernelStarter class that intercepts Control Queue messages, and handles process management."""
from zmq.eventloop import ioloop
-from streamsession import StreamSession
+
+from .streamsession import StreamSession
class KernelStarter(object):
"""Object for resetting/killing the Kernel."""
View
2  IPython/zmq/parallel/launcher.py
@@ -48,7 +48,7 @@ def check_output(*args, **kwargs):
from IPython.utils.path import get_ipython_module_path
from IPython.utils.process import find_cmd, pycmd2argv, FindCmdError
-from factory import LoggingFactory
+from .factory import LoggingFactory
# load winhpcjob from IPython.kernel
try:
View
2  IPython/zmq/parallel/logwatcher.py
@@ -21,7 +21,7 @@
from IPython.utils.traitlets import Int, Str, Instance, List
-from factory import LoggingFactory
+from .factory import LoggingFactory
#-----------------------------------------------------------------------------
# Classes
View
2  IPython/zmq/parallel/mongodb.py
@@ -10,7 +10,7 @@
from pymongo import Connection
-from dictdb import BaseDB
+from .dictdb import BaseDB
#-----------------------------------------------------------------------------
# MongoDB class
View
4 IPython/zmq/parallel/remotefunction.py
@@ -14,8 +14,8 @@
from IPython.testing import decorators as testdec
-import map as Map
-from asyncresult import AsyncMapResult
+from . import map as Map
+from .asyncresult import AsyncMapResult
#-----------------------------------------------------------------------------
# Decorators
View
10 IPython/zmq/parallel/scheduler.py
@@ -30,11 +30,11 @@
from IPython.external.decorator import decorator
from IPython.utils.traitlets import Instance, Dict, List, Set
-import error
-import streamsession as ss
-from dependency import Dependency
-from entry_point import connect_logger, local_logger
-from factory import SessionFactory
+from . import error
+from . import streamsession as ss
+from .dependency import Dependency
+from .entry_point import connect_logger, local_logger
+from .factory import SessionFactory
@decorator
View
8 IPython/zmq/parallel/streamkernel.py
@@ -33,10 +33,10 @@
from IPython.zmq.iostream import OutStream
from IPython.zmq.displayhook import DisplayHook
-import heartmonitor
-from client import Client
-from factory import SessionFactory
-from streamsession import StreamSession, Message, extract_header, serialize_object,\
+from . import heartmonitor
+from .client import Client
+from .factory import SessionFactory
+from .streamsession import StreamSession, Message, extract_header, serialize_object,\
unpack_apply_message, ISO8601, wrap_exception
def printer(*args):
View
2  IPython/zmq/parallel/streamsession.py
@@ -24,7 +24,7 @@
from IPython.utils.pickleutil import can, uncan, canSequence, uncanSequence
from IPython.utils.newserialized import serialize, unserialize
-from IPython.zmq.parallel.error import RemoteError
+from .error import RemoteError
# packer priority: jsonlib[2], cPickle, simplejson/json, pickle
json_name = '' if not jsonapi.jsonmod else jsonapi.jsonmod.__name__
View
28 IPython/zmq/parallel/view.py
@@ -14,9 +14,10 @@
from IPython.utils.traitlets import HasTraits, Bool, List, Dict, Set, Int, Instance
from IPython.external.decorator import decorator
-from IPython.zmq.parallel.asyncresult import AsyncResult
-from IPython.zmq.parallel.dependency import Dependency
-from IPython.zmq.parallel.remotefunction import ParallelFunction, parallel, remote
+
+from .asyncresult import AsyncResult
+from .dependency import Dependency
+from .remotefunction import ParallelFunction, parallel, remote
#-----------------------------------------------------------------------------
# Decorators
@@ -405,15 +406,32 @@ def map(self, f, *sequences, **kwargs):
@sync_results
@save_ids
- def execute(self, code, block=True):
+ def execute(self, code, block=None):
"""execute some code on my targets."""
+
+ block = block if block is not None else self.block
+
return self.client.execute(code, block=block, targets=self._targets)
+ @sync_results
+ @save_ids
+ def run(self, fname, block=None):
+ """execute the code in a file on my targets."""
+
+ block = block if block is not None else self.block
+
+ return self.client.run(fname, block=block, targets=self._targets)
+
def update(self, ns):
"""update remote namespace with dict `ns`"""
return self.client.push(ns, targets=self._targets, block=self.block)
- push = update
+ def push(self, ns, block=None):
+ """update remote namespace with dict `ns`"""
+
+ block = block if block is not None else self.block
+
+ return self.client.push(ns, targets=self._targets, block=block)
def get(self, key_s):
"""get object(s) by `key_s` from remote namespace
View
278 docs/source/parallelz/parallel_multiengine.txt
@@ -170,14 +170,26 @@ communicate with the engines are built on top of it), is :meth:`Client.apply`.
Ideally, :meth:`apply` would have the signature ``apply(f,*args,**kwargs)``,
which would call ``f(*args,**kwargs)`` remotely. However, since :class:`Clients`
require some more options, they cannot easily provide this interface.
-Instead, they provide the signature::
+Instead, they provide the signature:
+
+.. sourcecode:: python
c.apply(f, args=None, kwargs=None, bound=True, block=None, targets=None,
after=None, follow=None, timeout=None)
+Where various behavior is controlled via keyword arguments. This means that in the client,
+you must pass `args` as a tuple, and `kwargs` as a dict.
+
In order to provide the nicer interface, we have :class:`View` classes, which wrap
:meth:`Client.apply` by using attributes and extra :meth:`apply_x` methods to determine
-the extra arguments. For instance, performing index-access on a client creates a
+the extra keyword arguments. This means that the views can have the desired pattern:
+
+.. sourcecode:: python
+
+ v.apply(f, *args, **kwargs)
+
+
+For instance, performing index-access on a client creates a
:class:`.DirectView`.
.. sourcecode:: ipython
@@ -221,7 +233,7 @@ blocks until the engines are done executing the command:
In [5]: dview['b'] = 10
In [6]: dview.apply_bound(lambda x: a+b+x, 27)
- Out[6]: [42, 42, 42, 42]
+ Out[6]: [42, 42, 42, 42]%exit
Python commands can be executed on specific engines by calling execute using the ``targets``
keyword argument in :meth:`client.execute`, or creating a :class:`DirectView` instance by
@@ -553,15 +565,14 @@ In non-blocking mode :meth:`push` and :meth:`pull` also return
Dictionary interface
--------------------
-Since a namespace is just a :class:`dict`, :class:`DirectView` objects provide
+Since a Python namespace is just a :class:`dict`, :class:`DirectView` objects provide
dictionary-style access by key and methods such as :meth:`get` and
:meth:`update` for convenience. This make the remote namespaces of the engines
-appear as a local dictionary. Underneath, this uses :meth:`push` and
-:meth:`pull`:
+appear as a local dictionary. Underneath, these methods call :meth:`apply`:
.. sourcecode:: ipython
- In [50]: rc.block=True
+ In [50]: dview.block=True
In [51]: dview['a']=['foo','bar']
@@ -603,7 +614,6 @@ basic effect using :meth:`scatter` and :meth:`gather`:
.. sourcecode:: ipython
In [66]: dview.scatter('x',range(64))
- Out[66]: [None,None,None,None]
In [67]: px y = [i**10 for i in x]
Parallel execution on engines: [0, 1, 2, 3]
@@ -620,40 +630,49 @@ Parallel exceptions
In the multiengine interface, parallel commands can raise Python exceptions,
just like serial commands. But, it is a little subtle, because a single
parallel command can actually raise multiple exceptions (one for each engine
-the command was run on). To express this idea, the MultiEngine interface has a
+the command was run on). To express this idea, we have a
:exc:`CompositeError` exception class that will be raised in most cases. The
:exc:`CompositeError` class is a special type of exception that wraps one or
more other types of exceptions. Here is how it works:
.. sourcecode:: ipython
- In [76]: rc.block=True
+ In [76]: dview.block=True
- In [77]: rc.execute('1/0')
+ In [77]: dview.execute('1/0')
---------------------------------------------------------------------------
CompositeError Traceback (most recent call last)
+ /Users/minrk/<ipython-input-10-5d56b303a66c> in <module>()
+ ----> 1 dview.execute('1/0')
- /ipython1-client-r3021/docs/examples/<ipython console> in <module>()
-
- /ipython1-client-r3021/ipython1/kernel/multiengineclient.pyc in execute(self, lines, targets, block)
- 432 targets, block = self._findTargetsAndBlock(targets, block)
- 433 result = blockingCallFromThread(self.smultiengine.execute, lines,
- --> 434 targets=targets, block=block)
- 435 if block:
- 436 result = ResultList(result)
-
- /ipython1-client-r3021/ipython1/kernel/twistedutil.pyc in blockingCallFromThread(f, *a, **kw)
- 72 result.raiseException()
- 73 except Exception, e:
- ---> 74 raise e
- 75 return result
- 76
-
- CompositeError: one or more exceptions from call to method: execute
- [0:execute]: ZeroDivisionError: integer division or modulo by zero
- [1:execute]: ZeroDivisionError: integer division or modulo by zero
- [2:execute]: ZeroDivisionError: integer division or modulo by zero
- [3:execute]: ZeroDivisionError: integer division or modulo by zero
+ ...
+
+ /Users/minrk/dev/ip/mine/IPython/zmq/parallel/client.pyc in apply(self, f, args, kwargs, bound, block, targets, balanced, after, follow, timeout)
+ 1012 raise ValueError(msg)
+ 1013 else:
+ -> 1014 return self._apply_direct(f, args, kwargs, **options)
+ 1015
+ 1016 def _apply_balanced(self, f, args, kwargs, bound=None, block=None, targets=None,
+
+ /Users/minrk/dev/ip/mine/IPython/zmq/parallel/client.pyc in _apply_direct(self, f, args, kwargs, bound, block, targets)
+ 1100 if block:
+ 1101 try:
+ -> 1102 return ar.get()
+ 1103 except KeyboardInterrupt:
+ 1104 return ar
+
+ /Users/minrk/dev/ip/mine/IPython/zmq/parallel/asyncresult.pyc in get(self, timeout)
+ 78 return self._result
+ 79 else:
+ ---> 80 raise self._exception
+ 81 else:
+ 82 raise error.TimeoutError("Result not ready.")
+
+ CompositeError: one or more exceptions from call to method: _execute
+ [0:apply]: ZeroDivisionError: integer division or modulo by zero
+ [1:apply]: ZeroDivisionError: integer division or modulo by zero
+ [2:apply]: ZeroDivisionError: integer division or modulo by zero
+ [3:apply]: ZeroDivisionError: integer division or modulo by zero
Notice how the error message printed when :exc:`CompositeError` is raised has
information about the individual exceptions that were raised on each engine.
@@ -690,37 +709,68 @@ instance:
In [81]: rc.execute('1/0')
---------------------------------------------------------------------------
CompositeError Traceback (most recent call last)
-
- /ipython1-client-r3021/docs/examples/<ipython console> in <module>()
-
- /ipython1-client-r3021/ipython1/kernel/multiengineclient.pyc in execute(self, lines, targets, block)
- 432 targets, block = self._findTargetsAndBlock(targets, block)
- 433 result = blockingCallFromThread(self.smultiengine.execute, lines,
- --> 434 targets=targets, block=block)
- 435 if block:
- 436 result = ResultList(result)
-
- /ipython1-client-r3021/ipython1/kernel/twistedutil.pyc in blockingCallFromThread(f, *a, **kw)
- 72 result.raiseException()
- 73 except Exception, e:
- ---> 74 raise e
- 75 return result
- 76
-
- CompositeError: one or more exceptions from call to method: execute
- [0:execute]: ZeroDivisionError: integer division or modulo by zero
- [1:execute]: ZeroDivisionError: integer division or modulo by zero
- [2:execute]: ZeroDivisionError: integer division or modulo by zero
- [3:execute]: ZeroDivisionError: integer division or modulo by zero
-
+ /Users/minrk/<ipython-input-5-b0c7a2b62c52> in <module>()
+ ----> 1 rc.execute('1/0')
+
+ /Users/minrk/<string> in execute(self, code, targets, block)
+
+ /Users/minrk/dev/ip/mine/IPython/zmq/parallel/client.pyc in defaultblock(f, self, *args, **kwargs)
+ 88 self.block = block
+ 89 try:
+ ---> 90 ret = f(self, *args, **kwargs)
+ 91 finally:
+ 92 self.block = saveblock
+
+ /Users/minrk/dev/ip/mine/IPython/zmq/parallel/client.pyc in execute(self, code, targets, block)
+ 855 default: self.block
+ 856 """
+ --> 857 result = self.apply(_execute, (code,), targets=targets, block=block, bound=True, balanced=False)
+ 858 if not block:
+ 859 return result
+
+ /Users/minrk/<string> in apply(self, f, args, kwargs, bound, block, targets, balanced, after, follow, timeout)
+
+ /Users/minrk/dev/ip/mine/IPython/zmq/parallel/client.pyc in defaultblock(f, self, *args, **kwargs)
+ 88 self.block = block
+ 89 try:
+ ---> 90 ret = f(self, *args, **kwargs)
+ 91 finally:
+ 92 self.block = saveblock
+
+ /Users/minrk/dev/ip/mine/IPython/zmq/parallel/client.pyc in apply(self, f, args, kwargs, bound, block, targets, balanced, after, follow, timeout)
+ 1012 raise ValueError(msg)
+ 1013 else:
+ -> 1014 return self._apply_direct(f, args, kwargs, **options)
+ 1015
+ 1016 def _apply_balanced(self, f, args, kwargs, bound=None, block=None, targets=None,
+
+ /Users/minrk/dev/ip/mine/IPython/zmq/parallel/client.pyc in _apply_direct(self, f, args, kwargs, bound, block, targets)
+ 1100 if block:
+ 1101 try:
+ -> 1102 return ar.get()
+ 1103 except KeyboardInterrupt:
+ 1104 return ar
+
+ /Users/minrk/dev/ip/mine/IPython/zmq/parallel/asyncresult.pyc in get(self, timeout)
+ 78 return self._result
+ 79 else:
+ ---> 80 raise self._exception
+ 81 else:
+ 82 raise error.TimeoutError("Result not ready.")
+
+ CompositeError: one or more exceptions from call to method: _execute
+ [0:apply]: ZeroDivisionError: integer division or modulo by zero
+ [1:apply]: ZeroDivisionError: integer division or modulo by zero
+ [2:apply]: ZeroDivisionError: integer division or modulo by zero
+ [3:apply]: ZeroDivisionError: integer division or modulo by zero
+
In [82]: %debug
- >
+ > /Users/minrk/dev/ip/mine/IPython/zmq/parallel/asyncresult.py(80)get()
+ 79 else:
+ ---> 80 raise self._exception
+ 81 else:
+
- /ipython1-client-r3021/ipython1/kernel/twistedutil.py(74)blockingCallFromThread()
- 73 except Exception, e:
- ---> 74 raise e
- 75 return result
-
# With the debugger running, e is the exceptions instance. We can tab complete
# on it and see the extra methods that are available.
ipdb> e.
@@ -730,37 +780,49 @@ instance:
e.__doc__ e.__init__ e.__repr__ e._get_engine_str e.print_tracebacks
e.__getattribute__ e.__module__ e.__setattr__ e._get_traceback e.raise_exception
ipdb> e.print_tracebacks()
- [0:execute]:
- ---------------------------------------------------------------------------
- ZeroDivisionError Traceback (most recent call last)
-
- /ipython1-client-r3021/docs/examples/<string> in <module>()
-
+ [0:apply]:
+ Traceback (most recent call last):
+ File "/Users/minrk/dev/ip/mine/IPython/zmq/parallel/streamkernel.py", line 332, in apply_request
+ exec code in working, working
+ File "<string>", line 1, in <module>
+ File "/Users/minrk/dev/ip/mine/IPython/zmq/parallel/client.py", line 69, in _execute
+ exec code in globals()
+ File "<string>", line 1, in <module>
ZeroDivisionError: integer division or modulo by zero
- [1:execute]:
- ---------------------------------------------------------------------------
- ZeroDivisionError Traceback (most recent call last)
-
- /ipython1-client-r3021/docs/examples/<string> in <module>()
+ [1:apply]:
+ Traceback (most recent call last):
+ File "/Users/minrk/dev/ip/mine/IPython/zmq/parallel/streamkernel.py", line 332, in apply_request
+ exec code in working, working
+ File "<string>", line 1, in <module>
+ File "/Users/minrk/dev/ip/mine/IPython/zmq/parallel/client.py", line 69, in _execute
+ exec code in globals()
+ File "<string>", line 1, in <module>
ZeroDivisionError: integer division or modulo by zero
- [2:execute]:
- ---------------------------------------------------------------------------
- ZeroDivisionError Traceback (most recent call last)
-
- /ipython1-client-r3021/docs/examples/<string> in <module>()
+ [2:apply]:
+ Traceback (most recent call last):
+ File "/Users/minrk/dev/ip/mine/IPython/zmq/parallel/streamkernel.py", line 332, in apply_request
+ exec code in working, working
+ File "<string>", line 1, in <module>
+ File "/Users/minrk/dev/ip/mine/IPython/zmq/parallel/client.py", line 69, in _execute
+ exec code in globals()
+ File "<string>", line 1, in <module>
ZeroDivisionError: integer division or modulo by zero
- [3:execute]:
- ---------------------------------------------------------------------------
- ZeroDivisionError Traceback (most recent call last)
-
- /ipython1-client-r3021/docs/examples/<string> in <module>()
+ [3:apply]:
+ Traceback (most recent call last):
+ File "/Users/minrk/dev/ip/mine/IPython/zmq/parallel/streamkernel.py", line 332, in apply_request
+ exec code in working, working
+ File "<string>", line 1, in <module>
+ File "/Users/minrk/dev/ip/mine/IPython/zmq/parallel/client.py", line 69, in _execute
+ exec code in globals()
+ File "<string>", line 1, in <module>
ZeroDivisionError: integer division or modulo by zero
+
All of this same error handling magic even works in non-blocking mode:
@@ -774,41 +836,19 @@ All of this same error handling magic even works in non-blocking mode:
In [85]: ar.get()
---------------------------------------------------------------------------
CompositeError Traceback (most recent call last)
-
- /ipython1-client-r3021/docs/examples/<ipython console> in <module>()
-
- /ipython1-client-r3021/ipython1/kernel/multiengineclient.pyc in _get_r(self)
- 170
- 171 def _get_r(self):
- --> 172 return self.get_result(block=True)
- 173
- 174 r = property(_get_r)
-
- /ipython1-client-r3021/ipython1/kernel/multiengineclient.pyc in get_result(self, default, block)
- 131 return self.result
- 132 try:
- --> 133 result = self.client.get_pending_deferred(self.result_id, block)
- 134 except error.ResultNotCompleted:
- 135 return default
-
- /ipython1-client-r3021/ipython1/kernel/multiengineclient.pyc in get_pending_deferred(self, deferredID, block)
- 385
- 386 def get_pending_deferred(self, deferredID, block):
- --> 387 return blockingCallFromThread(self.smultiengine.get_pending_deferred, deferredID, block)
- 388
- 389 def barrier(self, pendingResults):
-
- /ipython1-client-r3021/ipython1/kernel/twistedutil.pyc in blockingCallFromThread(f, *a, **kw)
- 72 result.raiseException()
- 73 except Exception, e:
- ---> 74 raise e
- 75 return result
- 76
-
- CompositeError: one or more exceptions from call to method: execute
- [0:execute]: ZeroDivisionError: integer division or modulo by zero
- [1:execute]: ZeroDivisionError: integer division or modulo by zero
- [2:execute]: ZeroDivisionError: integer division or modulo by zero
- [3:execute]: ZeroDivisionError: integer division or modulo by zero
-
+ /Users/minrk/<ipython-input-3-8531eb3d26fb> in <module>()
+ ----> 1 ar.get()
+
+ /Users/minrk/dev/ip/mine/IPython/zmq/parallel/asyncresult.pyc in get(self, timeout)
+ 78 return self._result
+ 79 else:
+ ---> 80 raise self._exception
+ 81 else:
+ 82 raise error.TimeoutError("Result not ready.")
+
+ CompositeError: one or more exceptions from call to method: _execute
+ [0:apply]: ZeroDivisionError: integer division or modulo by zero
+ [1:apply]: ZeroDivisionError: integer division or modulo by zero
+ [2:apply]: ZeroDivisionError: integer division or modulo by zero
+ [3:apply]: ZeroDivisionError: integer division or modulo by zero
Please sign in to comment.
Something went wrong with that request. Please try again.