diff --git a/IPython/parallel.py b/IPython/parallel.py new file mode 100644 index 0000000..70dca71 --- /dev/null +++ b/IPython/parallel.py @@ -0,0 +1,20 @@ +""" +Shim to maintain backwards compatibility with old IPython.parallel imports. +""" +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. + +from __future__ import print_function + +import sys +from warnings import warn + +warn("The `IPython.parallel` package has been deprecated. " + "You should import from ipython_parallel instead.") + +from IPython.utils.shimmodule import ShimModule + +# Unconditionally insert the shim into sys.modules so that further import calls +# trigger the custom attribute access above + +sys.modules['IPython.parallel'] = ShimModule('parallel', mirror='ipython_parallel') diff --git a/IPython/testing/iptest.py b/IPython/testing/iptest.py index ef6f637..6b20cf2 100644 --- a/IPython/testing/iptest.py +++ b/IPython/testing/iptest.py @@ -170,8 +170,13 @@ class TestSection(object): def will_run(self): return self.enabled and all(have[p] for p in self.dependencies) +shims = { + 'parallel': 'ipython_parallel', +} + # Name -> (include, exclude, dependencies_met) -test_sections = {n:TestSection(n, ['IPython.%s' % n]) for n in test_group_names} +test_sections = {n:TestSection(n, [shims.get(n, 'IPython.%s' % n)]) for n in test_group_names} + # Exclusions and dependencies # --------------------------- diff --git a/IPython/utils/importstring.py b/IPython/utils/importstring.py index 8653d71..c8e1840 100644 --- a/IPython/utils/importstring.py +++ b/IPython/utils/importstring.py @@ -1,22 +1,11 @@ # encoding: utf-8 """ A simple utility to import something by its string name. - -Authors: - -* Brian Granger """ -#----------------------------------------------------------------------------- -# Copyright (C) 2008-2011 The IPython Development Team -# -# Distributed under the terms of the BSD License. The full license is in -# the file COPYING, distributed as part of this software. -#----------------------------------------------------------------------------- +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. -#----------------------------------------------------------------------------- -# Functions and classes -#----------------------------------------------------------------------------- def import_item(name): """Import and return ``bar`` given the string ``foo.bar``. @@ -41,8 +30,8 @@ def import_item(name): package, obj = parts module = __import__(package, fromlist=[obj]) try: - pak = module.__dict__[obj] - except KeyError: + pak = getattr(module, obj) + except AttributeError: raise ImportError('No module named %s' % obj) return pak else: diff --git a/IPython/utils/shimmodule.py b/IPython/utils/shimmodule.py index d9ac634..9b91f27 100644 --- a/IPython/utils/shimmodule.py +++ b/IPython/utils/shimmodule.py @@ -15,7 +15,7 @@ class ShimModule(types.ModuleType): # Use the equivalent of import_item(name), see below name = "%s.%s" % (self._mirror, key) - # NOTE: the code below is copied *verbatim* from + # NOTE: the code below was copied *verbatim* from # importstring.import_item. For some very strange reason that makes no # sense to me, if we call it *as a function*, it doesn't work. This # has something to do with the deep bowels of the import machinery and @@ -33,11 +33,7 @@ class ShimModule(types.ModuleType): # called with 'foo.bar....' package, obj = parts module = __import__(package, fromlist=[obj]) - try: - pak = module.__dict__[obj] - except KeyError: - raise AttributeError(obj) - return pak + return getattr(module, obj) else: # called with un-dotted string return __import__(parts[0]) diff --git a/IPython/parallel/__init__.py b/ipython_parallel/__init__.py similarity index 96% rename from IPython/parallel/__init__.py rename to ipython_parallel/__init__.py index 3f8cbcd..b6863b8 100644 --- a/IPython/parallel/__init__.py +++ b/ipython_parallel/__init__.py @@ -25,7 +25,7 @@ from IPython.utils.zmqrelated import check_for_zmq min_pyzmq = '2.1.11' -check_for_zmq(min_pyzmq, 'IPython.parallel') +check_for_zmq(min_pyzmq, 'ipython_parallel') from IPython.utils.pickleutil import Reference @@ -51,7 +51,7 @@ def bind_kernel(**kwargs): This function returns immediately. """ from IPython.kernel.zmq.kernelapp import IPKernelApp - from IPython.parallel.apps.ipengineapp import IPEngineApp + from ipython_parallel.apps.ipengineapp import IPEngineApp # first check for IPKernelApp, in which case this should be a no-op # because there is already a bound kernel diff --git a/IPython/parallel/apps/__init__.py b/ipython_parallel/apps/__init__.py similarity index 100% rename from IPython/parallel/apps/__init__.py rename to ipython_parallel/apps/__init__.py diff --git a/IPython/parallel/apps/baseapp.py b/ipython_parallel/apps/baseapp.py similarity index 98% rename from IPython/parallel/apps/baseapp.py rename to ipython_parallel/apps/baseapp.py index e538c04..15aa84e 100644 --- a/IPython/parallel/apps/baseapp.py +++ b/ipython_parallel/apps/baseapp.py @@ -1,6 +1,6 @@ # encoding: utf-8 """ -The Base Application class for IPython.parallel apps +The Base Application class for ipython_parallel apps """ @@ -70,7 +70,7 @@ base_flags = { base_flags.update(base_ip_flags) class BaseParallelApplication(BaseIPythonApplication): - """The base Application for IPython.parallel apps + """The base Application for ipython_parallel apps Principle extensions to BaseIPyythonApplication: diff --git a/IPython/parallel/apps/ipclusterapp.py b/ipython_parallel/apps/ipclusterapp.py similarity index 99% rename from IPython/parallel/apps/ipclusterapp.py rename to ipython_parallel/apps/ipclusterapp.py index f476f42..69ce71b 100755 --- a/IPython/parallel/apps/ipclusterapp.py +++ b/ipython_parallel/apps/ipclusterapp.py @@ -23,7 +23,7 @@ from IPython.utils.sysinfo import num_cpus from IPython.utils.traitlets import (Integer, Unicode, Bool, CFloat, Dict, List, Any, DottedObjectName) -from IPython.parallel.apps.baseapp import ( +from ipython_parallel.apps.baseapp import ( BaseParallelApplication, PIDFileError, base_flags, base_aliases @@ -106,7 +106,7 @@ def find_launcher_class(clsname, kind): # doesn't match necessary full class name, assume it's # just 'PBS' or 'MPI' etc prefix: clsname = clsname + kind + 'Launcher' - clsname = 'IPython.parallel.apps.launcher.'+clsname + clsname = 'ipython_parallel.apps.launcher.'+clsname klass = import_item(clsname) return klass @@ -228,7 +228,7 @@ class IPClusterEngines(BaseParallelApplication): default_log_level = logging.INFO classes = List() def _classes_default(self): - from IPython.parallel.apps import launcher + from ipython_parallel.apps import launcher launchers = launcher.all_launchers eslaunchers = [ l for l in launchers if 'EngineSet' in l.__name__] return [ProfileDir]+eslaunchers @@ -432,7 +432,7 @@ class IPClusterStart(IPClusterEngines): help="whether to create the profile_dir if it doesn't exist") classes = List() def _classes_default(self,): - from IPython.parallel.apps import launcher + from ipython_parallel.apps import launcher return [ProfileDir] + [IPClusterEngines] + launcher.all_launchers clean_logs = Bool(True, config=True, @@ -562,7 +562,7 @@ class IPClusterStart(IPClusterEngines): finally: self.remove_pid_file() -base='IPython.parallel.apps.ipclusterapp.IPCluster' +base='ipython_parallel.apps.ipclusterapp.IPCluster' class IPClusterApp(BaseIPythonApplication): name = u'ipcluster' diff --git a/IPython/parallel/apps/ipcontrollerapp.py b/ipython_parallel/apps/ipcontrollerapp.py similarity index 94% rename from IPython/parallel/apps/ipcontrollerapp.py rename to ipython_parallel/apps/ipcontrollerapp.py index bf5a66d..c99e5eb 100755 --- a/IPython/parallel/apps/ipcontrollerapp.py +++ b/ipython_parallel/apps/ipcontrollerapp.py @@ -37,7 +37,7 @@ from zmq.log.handlers import PUBHandler from IPython.core.profiledir import ProfileDir -from IPython.parallel.apps.baseapp import ( +from ipython_parallel.apps.baseapp import ( BaseParallelApplication, base_aliases, base_flags, @@ -51,25 +51,25 @@ from IPython.kernel.zmq.session import ( Session, session_aliases, session_flags, ) -from IPython.parallel.controller.heartmonitor import HeartMonitor -from IPython.parallel.controller.hub import HubFactory -from IPython.parallel.controller.scheduler import TaskScheduler,launch_scheduler -from IPython.parallel.controller.dictdb import DictDB +from ipython_parallel.controller.heartmonitor import HeartMonitor +from ipython_parallel.controller.hub import HubFactory +from ipython_parallel.controller.scheduler import TaskScheduler,launch_scheduler +from ipython_parallel.controller.dictdb import DictDB -from IPython.parallel.util import split_url, disambiguate_url, set_hwm +from ipython_parallel.util import split_url, disambiguate_url, set_hwm # conditional import of SQLiteDB / MongoDB backend class real_dbs = [] try: - from IPython.parallel.controller.sqlitedb import SQLiteDB + from ipython_parallel.controller.sqlitedb import SQLiteDB except ImportError: pass else: real_dbs.append(SQLiteDB) try: - from IPython.parallel.controller.mongodb import MongoDB + from ipython_parallel.controller.mongodb import MongoDB except ImportError: pass else: @@ -106,13 +106,13 @@ flags.update(base_flags) flags.update({ 'usethreads' : ( {'IPControllerApp' : {'use_threads' : True}}, 'Use threads instead of processes for the schedulers'), - 'sqlitedb' : ({'HubFactory' : {'db_class' : 'IPython.parallel.controller.sqlitedb.SQLiteDB'}}, + 'sqlitedb' : ({'HubFactory' : {'db_class' : 'ipython_parallel.controller.sqlitedb.SQLiteDB'}}, 'use the SQLiteDB backend'), - 'mongodb' : ({'HubFactory' : {'db_class' : 'IPython.parallel.controller.mongodb.MongoDB'}}, + 'mongodb' : ({'HubFactory' : {'db_class' : 'ipython_parallel.controller.mongodb.MongoDB'}}, 'use the MongoDB backend'), - 'dictdb' : ({'HubFactory' : {'db_class' : 'IPython.parallel.controller.dictdb.DictDB'}}, + 'dictdb' : ({'HubFactory' : {'db_class' : 'ipython_parallel.controller.dictdb.DictDB'}}, 'use the in-memory DictDB backend'), - 'nodb' : ({'HubFactory' : {'db_class' : 'IPython.parallel.controller.dictdb.NoDB'}}, + 'nodb' : ({'HubFactory' : {'db_class' : 'ipython_parallel.controller.dictdb.NoDB'}}, """use dummy DB backend, which doesn't store any information. This is the default as of IPython 0.13. diff --git a/IPython/parallel/apps/ipengineapp.py b/ipython_parallel/apps/ipengineapp.py similarity index 97% rename from IPython/parallel/apps/ipengineapp.py rename to ipython_parallel/apps/ipengineapp.py index 932a840..43c8b08 100755 --- a/IPython/parallel/apps/ipengineapp.py +++ b/ipython_parallel/apps/ipengineapp.py @@ -30,7 +30,7 @@ import zmq from zmq.eventloop import ioloop from IPython.core.profiledir import ProfileDir -from IPython.parallel.apps.baseapp import ( +from ipython_parallel.apps.baseapp import ( BaseParallelApplication, base_aliases, base_flags, @@ -46,8 +46,8 @@ from IPython.kernel.zmq.zmqshell import ZMQInteractiveShell from IPython.config.configurable import Configurable -from IPython.parallel.engine.engine import EngineFactory -from IPython.parallel.util import disambiguate_ip_address +from ipython_parallel.engine.engine import EngineFactory +from ipython_parallel.util import disambiguate_ip_address from IPython.utils.importstring import import_item from IPython.utils.py3compat import cast_bytes diff --git a/IPython/parallel/apps/iploggerapp.py b/ipython_parallel/apps/iploggerapp.py similarity index 97% rename from IPython/parallel/apps/iploggerapp.py rename to ipython_parallel/apps/iploggerapp.py index 7db6de6..411896d 100755 --- a/IPython/parallel/apps/iploggerapp.py +++ b/ipython_parallel/apps/iploggerapp.py @@ -28,12 +28,12 @@ import zmq from IPython.core.profiledir import ProfileDir from IPython.utils.traitlets import Bool, Dict, Unicode -from IPython.parallel.apps.baseapp import ( +from ipython_parallel.apps.baseapp import ( BaseParallelApplication, base_aliases, catch_config_error, ) -from IPython.parallel.apps.logwatcher import LogWatcher +from ipython_parallel.apps.logwatcher import LogWatcher #----------------------------------------------------------------------------- # Module level variables diff --git a/IPython/parallel/apps/launcher.py b/ipython_parallel/apps/launcher.py similarity index 98% rename from IPython/parallel/apps/launcher.py rename to ipython_parallel/apps/launcher.py index 985d68c..abff230 100644 --- a/IPython/parallel/apps/launcher.py +++ b/ipython_parallel/apps/launcher.py @@ -61,19 +61,19 @@ WINDOWS = os.name == 'nt' # Paths to the kernel apps #----------------------------------------------------------------------------- -ipcluster_cmd_argv = [sys.executable, "-m", "IPython.parallel.cluster"] +ipcluster_cmd_argv = [sys.executable, "-m", "ipython_parallel.cluster"] -ipengine_cmd_argv = [sys.executable, "-m", "IPython.parallel.engine"] +ipengine_cmd_argv = [sys.executable, "-m", "ipython_parallel.engine"] -ipcontroller_cmd_argv = [sys.executable, "-m", "IPython.parallel.controller"] +ipcontroller_cmd_argv = [sys.executable, "-m", "ipython_parallel.controller"] if WINDOWS and sys.version_info < (3,): # `python -m package` doesn't work on Windows Python 2 # due to weird multiprocessing bugs # and python -m module puts classes in the `__main__` module, # so instance checks get confused - ipengine_cmd_argv = [sys.executable, "-c", "from IPython.parallel.engine.__main__ import main; main()"] - ipcontroller_cmd_argv = [sys.executable, "-c", "from IPython.parallel.controller.__main__ import main; main()"] + ipengine_cmd_argv = [sys.executable, "-c", "from ipython_parallel.engine.__main__ import main; main()"] + ipcontroller_cmd_argv = [sys.executable, "-c", "from ipython_parallel.controller.__main__ import main; main()"] #----------------------------------------------------------------------------- # Base launchers and errors diff --git a/IPython/parallel/apps/logwatcher.py b/ipython_parallel/apps/logwatcher.py similarity index 100% rename from IPython/parallel/apps/logwatcher.py rename to ipython_parallel/apps/logwatcher.py diff --git a/IPython/parallel/apps/win32support.py b/ipython_parallel/apps/win32support.py similarity index 100% rename from IPython/parallel/apps/win32support.py rename to ipython_parallel/apps/win32support.py diff --git a/IPython/parallel/apps/winhpcjob.py b/ipython_parallel/apps/winhpcjob.py similarity index 100% rename from IPython/parallel/apps/winhpcjob.py rename to ipython_parallel/apps/winhpcjob.py diff --git a/IPython/parallel/client/__init__.py b/ipython_parallel/client/__init__.py similarity index 100% rename from IPython/parallel/client/__init__.py rename to ipython_parallel/client/__init__.py diff --git a/IPython/parallel/client/asyncresult.py b/ipython_parallel/client/asyncresult.py similarity index 100% rename from IPython/parallel/client/asyncresult.py rename to ipython_parallel/client/asyncresult.py index 340398b..9f7f754 100644 --- a/IPython/parallel/client/asyncresult.py +++ b/ipython_parallel/client/asyncresult.py @@ -13,7 +13,7 @@ from zmq import MessageTracker from IPython.core.display import clear_output, display, display_pretty from decorator import decorator -from IPython.parallel import error +from ipython_parallel import error from IPython.utils.py3compat import string_types diff --git a/IPython/parallel/client/client.py b/ipython_parallel/client/client.py similarity index 99% rename from IPython/parallel/client/client.py rename to ipython_parallel/client/client.py index ea17490..c5a0850 100644 --- a/IPython/parallel/client/client.py +++ b/ipython_parallel/client/client.py @@ -33,9 +33,9 @@ from IPython.utils.traitlets import (HasTraits, Integer, Instance, Unicode, Dict, List, Bool, Set, Any) from decorator import decorator -from IPython.parallel import Reference -from IPython.parallel import error -from IPython.parallel import util +from ipython_parallel import Reference +from ipython_parallel import error +from ipython_parallel import util from IPython.kernel.zmq.session import Session, Message from IPython.kernel.zmq import serialize @@ -1197,7 +1197,7 @@ class Client(HasTraits): NOT IMPLEMENTED whether to restart engines after shutting them down. """ - from IPython.parallel.error import NoEnginesRegistered + from ipython_parallel.error import NoEnginesRegistered if restart: raise NotImplementedError("Engine restart is not yet implemented") diff --git a/IPython/parallel/client/magics.py b/ipython_parallel/client/magics.py similarity index 100% rename from IPython/parallel/client/magics.py rename to ipython_parallel/client/magics.py diff --git a/IPython/parallel/client/map.py b/ipython_parallel/client/map.py similarity index 100% rename from IPython/parallel/client/map.py rename to ipython_parallel/client/map.py diff --git a/IPython/parallel/client/remotefunction.py b/ipython_parallel/client/remotefunction.py similarity index 100% rename from IPython/parallel/client/remotefunction.py rename to ipython_parallel/client/remotefunction.py diff --git a/IPython/parallel/client/view.py b/ipython_parallel/client/view.py similarity index 96% rename from IPython/parallel/client/view.py rename to ipython_parallel/client/view.py index f6b17f6..d344ebc 100644 --- a/IPython/parallel/client/view.py +++ b/ipython_parallel/client/view.py @@ -20,8 +20,8 @@ from IPython.utils.traitlets import ( ) from decorator import decorator -from IPython.parallel import util -from IPython.parallel.controller.dependency import Dependency, dependent +from ipython_parallel import util +from ipython_parallel.controller.dependency import Dependency, dependent from IPython.utils.py3compat import string_types, iteritems, PY3 from . import map as Map @@ -107,7 +107,7 @@ class View(HasTraits): history=List() outstanding = Set() results = Dict() - client = Instance('IPython.parallel.Client') + client = Instance('ipython_parallel.Client') _socket = Instance('zmq.Socket') _flag_names = List(['targets', 'block', 'track']) @@ -215,7 +215,7 @@ class View(HasTraits): This method sets all apply flags via this View's attributes. - Returns :class:`~IPython.parallel.client.asyncresult.AsyncResult` + Returns :class:`~ipython_parallel.client.asyncresult.AsyncResult` instance if ``self.block`` is False, otherwise the return value of ``f(*args, **kwargs)``. """ @@ -224,7 +224,7 @@ class View(HasTraits): def apply_async(self, f, *args, **kwargs): """calls ``f(*args, **kwargs)`` on remote engines in a nonblocking manner. - Returns :class:`~IPython.parallel.client.asyncresult.AsyncResult` instance. + Returns :class:`~ipython_parallel.client.asyncresult.AsyncResult` instance. """ return self._really_apply(f, args, kwargs, block=False) @@ -307,7 +307,7 @@ class View(HasTraits): def get_result(self, indices_or_msg_ids=None, block=None, owner=True): """return one or more results, specified by history index or msg_id. - See :meth:`IPython.parallel.client.client.Client.get_result` for details. + See :meth:`ipython_parallel.client.client.Client.get_result` for details. """ if indices_or_msg_ids is None: @@ -603,7 +603,7 @@ class DirectView(View): If block=False - An :class:`~IPython.parallel.client.asyncresult.AsyncMapResult` instance. + An :class:`~ipython_parallel.client.asyncresult.AsyncMapResult` instance. An object like AsyncResult, but which reassembles the sequence of results into a single list. AsyncMapResults can be iterated through before all results are complete. @@ -832,7 +832,7 @@ class DirectView(View): on the even engines. """ - from IPython.parallel.client.magics import ParallelMagics + from ipython_parallel.client.magics import ParallelMagics try: # This is injected into __builtins__. @@ -1099,7 +1099,7 @@ class LoadBalancedView(View): ------- if block=False - An :class:`~IPython.parallel.client.asyncresult.AsyncMapResult` instance. + An :class:`~ipython_parallel.client.asyncresult.AsyncMapResult` instance. An object like AsyncResult, but which reassembles the sequence of results into a single list. AsyncMapResults can be iterated through before all results are complete. diff --git a/IPython/parallel/cluster.py b/ipython_parallel/cluster.py similarity index 66% rename from IPython/parallel/cluster.py rename to ipython_parallel/cluster.py index 9f947fb..c1d532b 100644 --- a/IPython/parallel/cluster.py +++ b/ipython_parallel/cluster.py @@ -1,3 +1,3 @@ if __name__ == '__main__': - from IPython.parallel.apps import ipclusterapp as app + from ipython_parallel.apps import ipclusterapp as app app.launch_new_instance() diff --git a/IPython/parallel/controller/__init__.py b/ipython_parallel/controller/__init__.py similarity index 100% rename from IPython/parallel/controller/__init__.py rename to ipython_parallel/controller/__init__.py diff --git a/IPython/parallel/controller/__main__.py b/ipython_parallel/controller/__main__.py similarity index 80% rename from IPython/parallel/controller/__main__.py rename to ipython_parallel/controller/__main__.py index 92cbecf..b32f14b 100644 --- a/IPython/parallel/controller/__main__.py +++ b/ipython_parallel/controller/__main__.py @@ -1,5 +1,5 @@ def main(): - from IPython.parallel.apps import ipcontrollerapp as app + from ipython_parallel.apps import ipcontrollerapp as app app.launch_new_instance() if __name__ == '__main__': diff --git a/IPython/parallel/controller/dependency.py b/ipython_parallel/controller/dependency.py similarity index 96% rename from IPython/parallel/controller/dependency.py rename to ipython_parallel/controller/dependency.py index 2d4aa35..3473a9a 100644 --- a/IPython/parallel/controller/dependency.py +++ b/ipython_parallel/controller/dependency.py @@ -13,9 +13,9 @@ Authors: from types import ModuleType -from IPython.parallel.client.asyncresult import AsyncResult -from IPython.parallel.error import UnmetDependency -from IPython.parallel.util import interactive +from ipython_parallel.client.asyncresult import AsyncResult +from ipython_parallel.error import UnmetDependency +from ipython_parallel.util import interactive from IPython.utils import py3compat from IPython.utils.py3compat import string_types from IPython.utils.pickleutil import can, uncan @@ -80,7 +80,7 @@ class dependent(object): @interactive def _require(*modules, **mapping): """Helper for @require decorator.""" - from IPython.parallel.error import UnmetDependency + from ipython_parallel.error import UnmetDependency from IPython.utils.pickleutil import uncan user_ns = globals() for name in modules: diff --git a/IPython/parallel/controller/dictdb.py b/ipython_parallel/controller/dictdb.py similarity index 100% rename from IPython/parallel/controller/dictdb.py rename to ipython_parallel/controller/dictdb.py diff --git a/IPython/parallel/controller/heartmonitor.py b/ipython_parallel/controller/heartmonitor.py similarity index 99% rename from IPython/parallel/controller/heartmonitor.py rename to ipython_parallel/controller/heartmonitor.py index 3692e5e..14ed429 100755 --- a/IPython/parallel/controller/heartmonitor.py +++ b/ipython_parallel/controller/heartmonitor.py @@ -19,7 +19,7 @@ from IPython.config.configurable import LoggingConfigurable from IPython.utils.py3compat import str_to_bytes from IPython.utils.traitlets import Set, Instance, CFloat, Integer, Dict, Bool -from IPython.parallel.util import log_errors +from ipython_parallel.util import log_errors class Heart(object): """A basic heart object for responding to a HeartMonitor. diff --git a/IPython/parallel/controller/hub.py b/ipython_parallel/controller/hub.py similarity index 97% rename from IPython/parallel/controller/hub.py rename to ipython_parallel/controller/hub.py index a20f4d9..6d1af15 100644 --- a/IPython/parallel/controller/hub.py +++ b/ipython_parallel/controller/hub.py @@ -27,8 +27,8 @@ from IPython.utils.traitlets import ( HasTraits, Any, Instance, Integer, Unicode, Dict, Set, Tuple, DottedObjectName ) -from IPython.parallel import error, util -from IPython.parallel.factory import RegistrationFactory +from ipython_parallel import error, util +from ipython_parallel.factory import RegistrationFactory from IPython.kernel.zmq.session import SessionFactory @@ -114,10 +114,10 @@ class EngineConnector(HasTraits): _db_shortcuts = { - 'sqlitedb' : 'IPython.parallel.controller.sqlitedb.SQLiteDB', - 'mongodb' : 'IPython.parallel.controller.mongodb.MongoDB', - 'dictdb' : 'IPython.parallel.controller.dictdb.DictDB', - 'nodb' : 'IPython.parallel.controller.dictdb.NoDB', + 'sqlitedb' : 'ipython_parallel.controller.sqlitedb.SQLiteDB', + 'mongodb' : 'ipython_parallel.controller.mongodb.MongoDB', + 'dictdb' : 'ipython_parallel.controller.dictdb.DictDB', + 'nodb' : 'ipython_parallel.controller.dictdb.NoDB', } class HubFactory(RegistrationFactory): @@ -211,8 +211,8 @@ class HubFactory(RegistrationFactory): return max(30, int(.01 * self.heartmonitor.period)) # not configurable - db = Instance('IPython.parallel.controller.dictdb.BaseDB') - heartmonitor = Instance('IPython.parallel.controller.heartmonitor.HeartMonitor') + db = Instance('ipython_parallel.controller.dictdb.BaseDB') + heartmonitor = Instance('ipython_parallel.controller.heartmonitor.HeartMonitor') def _ip_changed(self, name, old, new): self.engine_ip = new diff --git a/IPython/parallel/controller/mongodb.py b/ipython_parallel/controller/mongodb.py similarity index 100% rename from IPython/parallel/controller/mongodb.py rename to ipython_parallel/controller/mongodb.py diff --git a/IPython/parallel/controller/scheduler.py b/ipython_parallel/controller/scheduler.py similarity index 99% rename from IPython/parallel/controller/scheduler.py rename to ipython_parallel/controller/scheduler.py index 26589b9..6277390 100644 --- a/IPython/parallel/controller/scheduler.py +++ b/ipython_parallel/controller/scheduler.py @@ -32,9 +32,9 @@ from IPython.config.loader import Config from IPython.utils.traitlets import Instance, Dict, List, Set, Integer, Enum, CBytes from IPython.utils.py3compat import cast_bytes -from IPython.parallel import error, util -from IPython.parallel.factory import SessionFactory -from IPython.parallel.util import connect_logger, local_logger +from ipython_parallel import error, util +from ipython_parallel.factory import SessionFactory +from ipython_parallel.util import connect_logger, local_logger from .dependency import Dependency diff --git a/IPython/parallel/controller/sqlitedb.py b/ipython_parallel/controller/sqlitedb.py similarity index 100% rename from IPython/parallel/controller/sqlitedb.py rename to ipython_parallel/controller/sqlitedb.py diff --git a/IPython/parallel/engine/__init__.py b/ipython_parallel/engine/__init__.py similarity index 100% rename from IPython/parallel/engine/__init__.py rename to ipython_parallel/engine/__init__.py diff --git a/IPython/parallel/engine/__main__.py b/ipython_parallel/engine/__main__.py similarity index 80% rename from IPython/parallel/engine/__main__.py rename to ipython_parallel/engine/__main__.py index 67a799e..23de0ee 100644 --- a/IPython/parallel/engine/__main__.py +++ b/ipython_parallel/engine/__main__.py @@ -1,5 +1,5 @@ def main(): - from IPython.parallel.apps import ipengineapp as app + from ipython_parallel.apps import ipengineapp as app app.launch_new_instance() if __name__ == '__main__': diff --git a/IPython/parallel/engine/engine.py b/ipython_parallel/engine/engine.py similarity index 98% rename from IPython/parallel/engine/engine.py rename to ipython_parallel/engine/engine.py index 32146b4..1cbde6c 100644 --- a/IPython/parallel/engine/engine.py +++ b/ipython_parallel/engine/engine.py @@ -21,9 +21,9 @@ from IPython.utils.traitlets import ( ) from IPython.utils.py3compat import cast_bytes -from IPython.parallel.controller.heartmonitor import Heart -from IPython.parallel.factory import RegistrationFactory -from IPython.parallel.util import disambiguate_url +from ipython_parallel.controller.heartmonitor import Heart +from ipython_parallel.factory import RegistrationFactory +from ipython_parallel.util import disambiguate_url from IPython.kernel.zmq.ipkernel import IPythonKernel as Kernel from IPython.kernel.zmq.kernelapp import IPKernelApp diff --git a/IPython/parallel/error.py b/ipython_parallel/error.py similarity index 99% rename from IPython/parallel/error.py rename to ipython_parallel/error.py index 280c356..6707c08 100644 --- a/IPython/parallel/error.py +++ b/ipython_parallel/error.py @@ -4,7 +4,7 @@ Inheritance diagram: -.. inheritance-diagram:: IPython.parallel.error +.. inheritance-diagram:: ipython_parallel.error :parts: 3 Authors: diff --git a/IPython/parallel/factory.py b/ipython_parallel/factory.py similarity index 98% rename from IPython/parallel/factory.py rename to ipython_parallel/factory.py index 92a3d9c..87b0481 100644 --- a/IPython/parallel/factory.py +++ b/ipython_parallel/factory.py @@ -19,7 +19,7 @@ Authors: from IPython.utils.localinterfaces import localhost from IPython.utils.traitlets import Integer, Unicode -from IPython.parallel.util import select_random_ports +from ipython_parallel.util import select_random_ports from IPython.kernel.zmq.session import SessionFactory #----------------------------------------------------------------------------- diff --git a/IPython/parallel/logger.py b/ipython_parallel/logger.py similarity index 66% rename from IPython/parallel/logger.py rename to ipython_parallel/logger.py index 274bea0..f17adbd 100644 --- a/IPython/parallel/logger.py +++ b/ipython_parallel/logger.py @@ -1,3 +1,3 @@ if __name__ == '__main__': - from IPython.parallel.apps import iploggerapp as app + from ipython_parallel.apps import iploggerapp as app app.launch_new_instance() diff --git a/IPython/parallel/tests/__init__.py b/ipython_parallel/tests/__init__.py similarity index 98% rename from IPython/parallel/tests/__init__.py rename to ipython_parallel/tests/__init__.py index 188f897..af64368 100644 --- a/IPython/parallel/tests/__init__.py +++ b/ipython_parallel/tests/__init__.py @@ -20,8 +20,8 @@ from subprocess import Popen, PIPE, STDOUT import nose from IPython.utils.path import get_ipython_dir -from IPython.parallel import Client, error -from IPython.parallel.apps.launcher import (LocalProcessLauncher, +from ipython_parallel import Client, error +from ipython_parallel.apps.launcher import (LocalProcessLauncher, ipengine_cmd_argv, ipcontroller_cmd_argv, SIGKILL, diff --git a/IPython/parallel/tests/clienttest.py b/ipython_parallel/tests/clienttest.py similarity index 97% rename from IPython/parallel/tests/clienttest.py rename to ipython_parallel/tests/clienttest.py index 1bf3403..579a4de 100644 --- a/IPython/parallel/tests/clienttest.py +++ b/ipython_parallel/tests/clienttest.py @@ -24,10 +24,10 @@ from zmq.tests import BaseZMQTestCase from decorator import decorator -from IPython.parallel import error -from IPython.parallel import Client +from ipython_parallel import error +from ipython_parallel import Client -from IPython.parallel.tests import launchers, add_engines +from ipython_parallel.tests import launchers, add_engines # simple tasks for use in apply tests diff --git a/IPython/parallel/tests/test_asyncresult.py b/ipython_parallel/tests/test_asyncresult.py similarity index 91% rename from IPython/parallel/tests/test_asyncresult.py rename to ipython_parallel/tests/test_asyncresult.py index 80fdf3c..8848571 100644 --- a/IPython/parallel/tests/test_asyncresult.py +++ b/ipython_parallel/tests/test_asyncresult.py @@ -9,9 +9,9 @@ import nose.tools as nt from IPython.utils.io import capture_output -from IPython.parallel.error import TimeoutError -from IPython.parallel import error, Client -from IPython.parallel.tests import add_engines +from ipython_parallel.error import TimeoutError +from ipython_parallel import error, Client +from ipython_parallel.tests import add_engines from .clienttest import ClusterTestCase from IPython.utils.py3compat import iteritems diff --git a/IPython/parallel/tests/test_client.py b/ipython_parallel/tests/test_client.py similarity index 95% rename from IPython/parallel/tests/test_client.py rename to ipython_parallel/tests/test_client.py index 02dd290..3dfcc61 100644 --- a/IPython/parallel/tests/test_client.py +++ b/ipython_parallel/tests/test_client.py @@ -11,10 +11,10 @@ from datetime import datetime import zmq from IPython import parallel -from IPython.parallel.client import client as clientmod -from IPython.parallel import error -from IPython.parallel import AsyncResult, AsyncHubResult -from IPython.parallel import LoadBalancedView, DirectView +from ipython_parallel.client import client as clientmod +from ipython_parallel import error +from ipython_parallel import AsyncResult, AsyncHubResult +from ipython_parallel import LoadBalancedView, DirectView from .clienttest import ClusterTestCase, segfault, wait, add_engines diff --git a/IPython/parallel/tests/test_db.py b/ipython_parallel/tests/test_db.py similarity index 96% rename from IPython/parallel/tests/test_db.py rename to ipython_parallel/tests/test_db.py index a00478d..128c70e 100644 --- a/IPython/parallel/tests/test_db.py +++ b/ipython_parallel/tests/test_db.py @@ -26,10 +26,10 @@ import time from datetime import datetime, timedelta from unittest import TestCase -from IPython.parallel import error -from IPython.parallel.controller.dictdb import DictDB -from IPython.parallel.controller.sqlitedb import SQLiteDB -from IPython.parallel.controller.hub import init_record, empty_record +from ipython_parallel import error +from ipython_parallel.controller.dictdb import DictDB +from ipython_parallel.controller.sqlitedb import SQLiteDB +from ipython_parallel.controller.hub import init_record, empty_record from IPython.testing import decorators as dec from IPython.kernel.zmq.session import Session diff --git a/IPython/parallel/tests/test_dependency.py b/ipython_parallel/tests/test_dependency.py similarity index 97% rename from IPython/parallel/tests/test_dependency.py rename to ipython_parallel/tests/test_dependency.py index ddcc749..73349ae 100644 --- a/IPython/parallel/tests/test_dependency.py +++ b/ipython_parallel/tests/test_dependency.py @@ -23,10 +23,10 @@ import os from IPython.utils.pickleutil import can, uncan -import IPython.parallel as pmod -from IPython.parallel.util import interactive +import ipython_parallel as pmod +from ipython_parallel.util import interactive -from IPython.parallel.tests import add_engines +from ipython_parallel.tests import add_engines from .clienttest import ClusterTestCase def setup(): diff --git a/IPython/parallel/tests/test_launcher.py b/ipython_parallel/tests/test_launcher.py similarity index 99% rename from IPython/parallel/tests/test_launcher.py rename to ipython_parallel/tests/test_launcher.py index e452e62..a797cd2 100644 --- a/IPython/parallel/tests/test_launcher.py +++ b/ipython_parallel/tests/test_launcher.py @@ -31,7 +31,7 @@ from nose import SkipTest from IPython.config import Config -from IPython.parallel.apps import launcher +from ipython_parallel.apps import launcher from IPython.testing import decorators as dec from IPython.utils.py3compat import string_types diff --git a/IPython/parallel/tests/test_lbview.py b/ipython_parallel/tests/test_lbview.py similarity index 99% rename from IPython/parallel/tests/test_lbview.py rename to ipython_parallel/tests/test_lbview.py index 96939a8..5608994 100644 --- a/IPython/parallel/tests/test_lbview.py +++ b/ipython_parallel/tests/test_lbview.py @@ -24,9 +24,9 @@ from nose import SkipTest from nose.plugins.attrib import attr from IPython import parallel as pmod -from IPython.parallel import error +from ipython_parallel import error -from IPython.parallel.tests import add_engines +from ipython_parallel.tests import add_engines from .clienttest import ClusterTestCase, crash, wait, skip_without diff --git a/IPython/parallel/tests/test_magics.py b/ipython_parallel/tests/test_magics.py similarity index 98% rename from IPython/parallel/tests/test_magics.py rename to ipython_parallel/tests/test_magics.py index c8ec444..c7fba9a 100644 --- a/IPython/parallel/tests/test_magics.py +++ b/ipython_parallel/tests/test_magics.py @@ -24,9 +24,9 @@ from IPython.testing import decorators as dec from IPython.utils.io import capture_output from IPython import parallel as pmod -from IPython.parallel import AsyncResult +from ipython_parallel import AsyncResult -from IPython.parallel.tests import add_engines +from ipython_parallel.tests import add_engines from .clienttest import ClusterTestCase, generate_output diff --git a/IPython/parallel/tests/test_mongodb.py b/ipython_parallel/tests/test_mongodb.py similarity index 97% rename from IPython/parallel/tests/test_mongodb.py rename to ipython_parallel/tests/test_mongodb.py index 7e78630..80aacd7 100644 --- a/IPython/parallel/tests/test_mongodb.py +++ b/ipython_parallel/tests/test_mongodb.py @@ -23,7 +23,7 @@ from unittest import TestCase from nose import SkipTest from pymongo import Connection -from IPython.parallel.controller.mongodb import MongoDB +from ipython_parallel.controller.mongodb import MongoDB from . import test_db diff --git a/IPython/parallel/tests/test_view.py b/ipython_parallel/tests/test_view.py similarity index 97% rename from IPython/parallel/tests/test_view.py rename to ipython_parallel/tests/test_view.py index 460f13e..27e0882 100644 --- a/IPython/parallel/tests/test_view.py +++ b/ipython_parallel/tests/test_view.py @@ -19,11 +19,11 @@ from IPython.utils.io import capture_output from IPython.utils.py3compat import unicode_type from IPython import parallel as pmod -from IPython.parallel import error -from IPython.parallel import AsyncResult, AsyncHubResult, AsyncMapResult -from IPython.parallel.util import interactive +from ipython_parallel import error +from ipython_parallel import AsyncResult, AsyncHubResult, AsyncMapResult +from ipython_parallel.util import interactive -from IPython.parallel.tests import add_engines +from ipython_parallel.tests import add_engines from .clienttest import ClusterTestCase, crash, wait, skip_without @@ -799,7 +799,7 @@ class TestView(ClusterTestCase): def test_return_namedtuple(self): def namedtuplify(x, y): - from IPython.parallel.tests.test_view import point + from ipython_parallel.tests.test_view import point return point(x, y) view = self.client[-1] diff --git a/IPython/parallel/util.py b/ipython_parallel/util.py similarity index 100% rename from IPython/parallel/util.py rename to ipython_parallel/util.py