diff --git a/IPython/parallel/apps/clusterdir.py b/IPython/parallel/apps/clusterdir.py index b707c02..c82a47a 100755 --- a/IPython/parallel/apps/clusterdir.py +++ b/IPython/parallel/apps/clusterdir.py @@ -36,7 +36,7 @@ from IPython.utils.path import ( get_ipython_dir, expand_path ) -from IPython.utils.traitlets import Unicode, Bool, CStr, Instance, Dict +from IPython.utils.traitlets import Unicode, Bool, Instance, Dict #----------------------------------------------------------------------------- # Module errors @@ -360,8 +360,8 @@ class ClusterApplication(BaseIPythonApplication): clean_logs = Bool(False, shortname='--clean-logs', config=True, help="whether to cleanup old logfiles before starting") - log_url = CStr('', shortname='--log-url', config=True, - help="The ZMQ URL of the iplooger to aggregate logging.") + log_url = Unicode('', shortname='--log-url', config=True, + help="The ZMQ URL of the iplogger to aggregate logging.") config_file = Unicode(u'', config=True, help="""Path to ipcontroller configuration file. The default is to use diff --git a/IPython/parallel/apps/ipclusterapp.py b/IPython/parallel/apps/ipclusterapp.py index 3257733..a70740d 100755 --- a/IPython/parallel/apps/ipclusterapp.py +++ b/IPython/parallel/apps/ipclusterapp.py @@ -29,7 +29,7 @@ from IPython.config.application import Application, boolean_flag from IPython.config.loader import Config from IPython.core.newapplication import BaseIPythonApplication from IPython.utils.importstring import import_item -from IPython.utils.traitlets import Int, CStr, CUnicode, Str, Bool, CFloat, Dict, List +from IPython.utils.traitlets import Int, Unicode, Bool, CFloat, Dict, List from IPython.parallel.apps.clusterdir import ( ClusterApplication, ClusterDirError, ClusterDir, @@ -285,7 +285,7 @@ class IPClusterEngines(ClusterApplication): n = Int(2, config=True, help="The number of engines to start.") - engine_launcher_class = Str('LocalEngineSetLauncher', + engine_launcher_class = Unicode('LocalEngineSetLauncher', config=True, help="The class for launching a set of Engines." ) @@ -420,7 +420,7 @@ class IPClusterStart(IPClusterEngines): delay = CFloat(1., config=True, help="delay (in s) between starting the controller and the engines") - controller_launcher_class = Str('LocalControllerLauncher', + controller_launcher_class = Unicode('LocalControllerLauncher', config=True, help="The class for launching a Controller." ) diff --git a/IPython/parallel/apps/ipcontrollerapp.py b/IPython/parallel/apps/ipcontrollerapp.py index 3df9b1b..77cc47a 100755 --- a/IPython/parallel/apps/ipcontrollerapp.py +++ b/IPython/parallel/apps/ipcontrollerapp.py @@ -43,7 +43,7 @@ from IPython.parallel.apps.clusterdir import ( # ClusterDirConfigLoader ) from IPython.utils.importstring import import_item -from IPython.utils.traitlets import Instance, Unicode, Bool, List, CStr, Dict +from IPython.utils.traitlets import Instance, Unicode, Bool, List, Dict # from IPython.parallel.controller.controller import ControllerFactory from IPython.parallel.streamsession import StreamSession @@ -139,7 +139,7 @@ class IPControllerApp(ClusterApplication): # internal children = List() - mq_class = CStr('zmq.devices.ProcessMonitoredQueue') + mq_class = Unicode('zmq.devices.ProcessMonitoredQueue') def _usethreads_changed(self, name, old, new): self.mq_class = 'zmq.devices.%sMonitoredQueue'%('Thread' if new else 'Process') diff --git a/IPython/parallel/apps/ipengineapp.py b/IPython/parallel/apps/ipengineapp.py index a31ad91..a545d42 100755 --- a/IPython/parallel/apps/ipengineapp.py +++ b/IPython/parallel/apps/ipengineapp.py @@ -37,7 +37,7 @@ from IPython.parallel.engine.streamkernel import Kernel from IPython.parallel.util import disambiguate_url from IPython.utils.importstring import import_item -from IPython.utils.traitlets import Str, Bool, Unicode, Dict, List, CStr +from IPython.utils.traitlets import Bool, Unicode, Dict, List, CStr #----------------------------------------------------------------------------- @@ -78,7 +78,7 @@ mpi.size = 0 class MPI(Configurable): """Configurable for MPI initialization""" - use = Str('', config=True, + use = Unicode('', config=True, help='How to enable MPI (mpi4py, pytrilinos, or empty string to disable).' ) @@ -87,7 +87,7 @@ class MPI(Configurable): if not self.init_script: self.init_script = self.default_inits.get(new, '') - init_script = Str('', config=True, + init_script = Unicode('', config=True, help="Initialization code for MPI") default_inits = Dict({'mpi4py' : mpi4py_init, 'pytrilinos':pytrilinos_init}, @@ -111,7 +111,7 @@ class IPEngineApp(ClusterApplication): startup_script = Unicode(u'', config=True, help='specify a script to be run at startup') - startup_command = Str('', config=True, + startup_command = Unicode('', config=True, help='specify a command to be run at startup') url_file = Unicode(u'', config=True, diff --git a/IPython/parallel/apps/launcher.py b/IPython/parallel/apps/launcher.py index 5dce600..42ad434 100644 --- a/IPython/parallel/apps/launcher.py +++ b/IPython/parallel/apps/launcher.py @@ -51,7 +51,7 @@ from zmq.eventloop import ioloop from IPython.external import Itpl # from IPython.config.configurable import Configurable -from IPython.utils.traitlets import Any, Str, Int, List, Unicode, Dict, Instance, CUnicode +from IPython.utils.traitlets import Any, Int, List, Unicode, Dict, Instance from IPython.utils.path import get_ipython_module_path from IPython.utils.process import find_cmd, pycmd2argv, FindCmdError @@ -534,11 +534,11 @@ class SSHLauncher(LocalProcessLauncher): help="Program to launch via ssh") program_args = List([], config=True, help="args to pass to remote program") - hostname = CUnicode('', config=True, + hostname = Unicode('', config=True, help="hostname on which to launch the program") - user = CUnicode('', config=True, + user = Unicode('', config=True, help="username for ssh") - location = CUnicode('', config=True, + location = Unicode('', config=True, help="user@hostname location for ssh in one setting") def _hostname_changed(self, name, old, new): @@ -647,18 +647,18 @@ def find_job_cmd(): class WindowsHPCLauncher(BaseLauncher): - job_id_regexp = Str(r'\d+', config=True, + job_id_regexp = Unicode(r'\d+', config=True, help="""A regular expression used to get the job id from the output of the submit_command. """ ) - job_file_name = CUnicode(u'ipython_job.xml', config=True, + job_file_name = Unicode(u'ipython_job.xml', config=True, help="The filename of the instantiated job script.") # The full path to the instantiated job script. This gets made dynamically # by combining the work_dir with the job_file_name. - job_file = CUnicode(u'') - scheduler = CUnicode('', config=True, + job_file = Unicode(u'') + scheduler = Unicode('', config=True, help="The hostname of the scheduler to submit the job to.") - job_cmd = CUnicode(find_job_cmd(), config=True, + job_cmd = Unicode(find_job_cmd(), config=True, help="The command for submitting jobs.") def __init__(self, work_dir=u'.', config=None, **kwargs): @@ -727,7 +727,7 @@ class WindowsHPCLauncher(BaseLauncher): class WindowsHPCControllerLauncher(WindowsHPCLauncher): - job_file_name = CUnicode(u'ipcontroller_job.xml', config=True, + job_file_name = Unicode(u'ipcontroller_job.xml', config=True, help="WinHPC xml job file.") extra_args = List([], config=False, help="extra args to pass to ipcontroller") @@ -760,7 +760,7 @@ class WindowsHPCControllerLauncher(WindowsHPCLauncher): class WindowsHPCEngineSetLauncher(WindowsHPCLauncher): - job_file_name = CUnicode(u'ipengineset_job.xml', config=True, + job_file_name = Unicode(u'ipengineset_job.xml', config=True, help="jobfile for ipengines job") extra_args = List([], config=False, help="extra args to pas to ipengine") @@ -815,29 +815,29 @@ class BatchSystemLauncher(BaseLauncher): help="The name of the command line program used to submit jobs.") delete_command = List([''], config=True, help="The name of the command line program used to delete jobs.") - job_id_regexp = CUnicode('', config=True, + job_id_regexp = Unicode('', config=True, help="""A regular expression used to get the job id from the output of the submit_command.""") - batch_template = CUnicode('', config=True, + batch_template = Unicode('', config=True, help="The string that is the batch script template itself.") - batch_template_file = CUnicode(u'', config=True, + batch_template_file = Unicode(u'', config=True, help="The file that contains the batch template.") - batch_file_name = CUnicode(u'batch_script', config=True, + batch_file_name = Unicode(u'batch_script', config=True, help="The filename of the instantiated batch script.") - queue = CUnicode(u'', config=True, + queue = Unicode(u'', config=True, help="The PBS Queue.") # not configurable, override in subclasses # PBS Job Array regex - job_array_regexp = CUnicode('') - job_array_template = CUnicode('') + job_array_regexp = Unicode('') + job_array_template = Unicode('') # PBS Queue regex - queue_regexp = CUnicode('') - queue_template = CUnicode('') + queue_regexp = Unicode('') + queue_template = Unicode('') # The default batch template, override in subclasses - default_template = CUnicode('') + default_template = Unicode('') # The full path to the instantiated batch script. - batch_file = CUnicode(u'') + batch_file = Unicode(u'') # the format dict used with batch_template: context = Dict() @@ -924,22 +924,22 @@ class PBSLauncher(BatchSystemLauncher): help="The PBS submit command ['qsub']") delete_command = List(['qdel'], config=True, help="The PBS delete command ['qsub']") - job_id_regexp = CUnicode(r'\d+', config=True, + job_id_regexp = Unicode(r'\d+', config=True, help="Regular expresion for identifying the job ID [r'\d+']") - batch_file = CUnicode(u'') - job_array_regexp = CUnicode('#PBS\W+-t\W+[\w\d\-\$]+') - job_array_template = CUnicode('#PBS -t 1-$n') - queue_regexp = CUnicode('#PBS\W+-q\W+\$?\w+') - queue_template = CUnicode('#PBS -q $queue') + batch_file = Unicode(u'') + job_array_regexp = Unicode('#PBS\W+-t\W+[\w\d\-\$]+') + job_array_template = Unicode('#PBS -t 1-$n') + queue_regexp = Unicode('#PBS\W+-q\W+\$?\w+') + queue_template = Unicode('#PBS -q $queue') class PBSControllerLauncher(PBSLauncher): """Launch a controller using PBS.""" - batch_file_name = CUnicode(u'pbs_controller', config=True, + batch_file_name = Unicode(u'pbs_controller', config=True, help="batch file name for the controller job.") - default_template= CUnicode("""#!/bin/sh + default_template= Unicode("""#!/bin/sh #PBS -V #PBS -N ipcontroller %s --log-to-file cluster_dir $cluster_dir @@ -953,9 +953,9 @@ class PBSControllerLauncher(PBSLauncher): class PBSEngineSetLauncher(PBSLauncher): """Launch Engines using PBS""" - batch_file_name = CUnicode(u'pbs_engines', config=True, + batch_file_name = Unicode(u'pbs_engines', config=True, help="batch file name for the engine(s) job.") - default_template= CUnicode(u"""#!/bin/sh + default_template= Unicode(u"""#!/bin/sh #PBS -V #PBS -N ipengine %s cluster_dir $cluster_dir @@ -970,17 +970,17 @@ class PBSEngineSetLauncher(PBSLauncher): class SGELauncher(PBSLauncher): """Sun GridEngine is a PBS clone with slightly different syntax""" - job_array_regexp = CUnicode('#$$\W+-t\W+[\w\d\-\$]+') - job_array_template = CUnicode('#$$ -t 1-$n') - queue_regexp = CUnicode('#$$\W+-q\W+\$?\w+') - queue_template = CUnicode('#$$ -q $queue') + job_array_regexp = Unicode('#$$\W+-t\W+[\w\d\-\$]+') + job_array_template = Unicode('#$$ -t 1-$n') + queue_regexp = Unicode('#$$\W+-q\W+\$?\w+') + queue_template = Unicode('#$$ -q $queue') class SGEControllerLauncher(SGELauncher): """Launch a controller using SGE.""" - batch_file_name = CUnicode(u'sge_controller', config=True, + batch_file_name = Unicode(u'sge_controller', config=True, help="batch file name for the ipontroller job.") - default_template= CUnicode(u"""#$$ -V + default_template= Unicode(u"""#$$ -V #$$ -S /bin/sh #$$ -N ipcontroller %s --log-to-file cluster_dir=$cluster_dir @@ -993,9 +993,9 @@ class SGEControllerLauncher(SGELauncher): class SGEEngineSetLauncher(SGELauncher): """Launch Engines with SGE""" - batch_file_name = CUnicode(u'sge_engines', config=True, + batch_file_name = Unicode(u'sge_engines', config=True, help="batch file name for the engine(s) job.") - default_template = CUnicode("""#$$ -V + default_template = Unicode("""#$$ -V #$$ -S /bin/sh #$$ -N ipengine %s cluster_dir=$cluster_dir @@ -1020,7 +1020,7 @@ class IPClusterLauncher(LocalProcessLauncher): ipcluster_args = List( ['--clean-logs', '--log-to-file', 'log_level=%i'%logging.INFO], config=True, help="Command line arguments to pass to ipcluster.") - ipcluster_subcommand = Str('start') + ipcluster_subcommand = Unicode('start') ipcluster_n = Int(2) def find_args(self): diff --git a/IPython/parallel/apps/logwatcher.py b/IPython/parallel/apps/logwatcher.py index adf4355..32dbf7d 100644 --- a/IPython/parallel/apps/logwatcher.py +++ b/IPython/parallel/apps/logwatcher.py @@ -19,7 +19,7 @@ import sys import zmq from zmq.eventloop import ioloop, zmqstream -from IPython.utils.traitlets import Int, Str, Instance, List +from IPython.utils.traitlets import Int, Unicode, Instance, List from IPython.parallel.factory import LoggingFactory @@ -36,7 +36,7 @@ class LogWatcher(LoggingFactory): """ # configurables topics = List([''], config=True) - url = Str('tcp://127.0.0.1:20202', config=True) + url = Unicode('tcp://127.0.0.1:20202', config=True) # internals context = Instance(zmq.Context, (), {}) diff --git a/IPython/parallel/apps/winhpcjob.py b/IPython/parallel/apps/winhpcjob.py index 492df58..7a39cb0 100644 --- a/IPython/parallel/apps/winhpcjob.py +++ b/IPython/parallel/apps/winhpcjob.py @@ -24,8 +24,8 @@ from xml.etree import ElementTree as ET from IPython.config.configurable import Configurable from IPython.utils.traitlets import ( - Str, Int, List, Instance, - Enum, Bool, CStr + Unicode, Int, List, Instance, + Enum, Bool ) #----------------------------------------------------------------------------- @@ -74,27 +74,27 @@ def find_username(): class WinHPCJob(Configurable): - job_id = Str('') - job_name = Str('MyJob', config=True) + job_id = Unicode('') + job_name = Unicode('MyJob', config=True) min_cores = Int(1, config=True) max_cores = Int(1, config=True) min_sockets = Int(1, config=True) max_sockets = Int(1, config=True) min_nodes = Int(1, config=True) max_nodes = Int(1, config=True) - unit_type = Str("Core", config=True) + unit_type = Unicode("Core", config=True) auto_calculate_min = Bool(True, config=True) auto_calculate_max = Bool(True, config=True) run_until_canceled = Bool(False, config=True) is_exclusive = Bool(False, config=True) - username = Str(find_username(), config=True) - job_type = Str('Batch', config=True) + username = Unicode(find_username(), config=True) + job_type = Unicode('Batch', config=True) priority = Enum(('Lowest','BelowNormal','Normal','AboveNormal','Highest'), default_value='Highest', config=True) - requested_nodes = Str('', config=True) - project = Str('IPython', config=True) - xmlns = Str('http://schemas.microsoft.com/HPCS2008/scheduler/') - version = Str("2.000") + requested_nodes = Unicode('', config=True) + project = Unicode('IPython', config=True) + xmlns = Unicode('http://schemas.microsoft.com/HPCS2008/scheduler/') + version = Unicode("2.000") tasks = List([]) @property @@ -165,21 +165,21 @@ class WinHPCJob(Configurable): class WinHPCTask(Configurable): - task_id = Str('') - task_name = Str('') - version = Str("2.000") + task_id = Unicode('') + task_name = Unicode('') + version = Unicode("2.000") min_cores = Int(1, config=True) max_cores = Int(1, config=True) min_sockets = Int(1, config=True) max_sockets = Int(1, config=True) min_nodes = Int(1, config=True) max_nodes = Int(1, config=True) - unit_type = Str("Core", config=True) - command_line = CStr('', config=True) - work_directory = CStr('', config=True) + unit_type = Unicode("Core", config=True) + command_line = Unicode('', config=True) + work_directory = Unicode('', config=True) is_rerunnaable = Bool(True, config=True) - std_out_file_path = CStr('', config=True) - std_err_file_path = CStr('', config=True) + std_out_file_path = Unicode('', config=True) + std_err_file_path = Unicode('', config=True) is_parametric = Bool(False, config=True) environment_variables = Instance(dict, args=(), config=True) @@ -223,41 +223,41 @@ class WinHPCTask(Configurable): # By declaring these, we can configure the controller and engine separately! class IPControllerJob(WinHPCJob): - job_name = Str('IPController', config=False) + job_name = Unicode('IPController', config=False) is_exclusive = Bool(False, config=True) - username = Str(find_username(), config=True) + username = Unicode(find_username(), config=True) priority = Enum(('Lowest','BelowNormal','Normal','AboveNormal','Highest'), default_value='Highest', config=True) - requested_nodes = Str('', config=True) - project = Str('IPython', config=True) + requested_nodes = Unicode('', config=True) + project = Unicode('IPython', config=True) class IPEngineSetJob(WinHPCJob): - job_name = Str('IPEngineSet', config=False) + job_name = Unicode('IPEngineSet', config=False) is_exclusive = Bool(False, config=True) - username = Str(find_username(), config=True) + username = Unicode(find_username(), config=True) priority = Enum(('Lowest','BelowNormal','Normal','AboveNormal','Highest'), default_value='Highest', config=True) - requested_nodes = Str('', config=True) - project = Str('IPython', config=True) + requested_nodes = Unicode('', config=True) + project = Unicode('IPython', config=True) class IPControllerTask(WinHPCTask): - task_name = Str('IPController', config=True) + task_name = Unicode('IPController', config=True) controller_cmd = List(['ipcontroller.exe'], config=True) controller_args = List(['--log-to-file', '--log-level', '40'], config=True) # I don't want these to be configurable - std_out_file_path = CStr('', config=False) - std_err_file_path = CStr('', config=False) + std_out_file_path = Unicode('', config=False) + std_err_file_path = Unicode('', config=False) min_cores = Int(1, config=False) max_cores = Int(1, config=False) min_sockets = Int(1, config=False) max_sockets = Int(1, config=False) min_nodes = Int(1, config=False) max_nodes = Int(1, config=False) - unit_type = Str("Core", config=False) - work_directory = CStr('', config=False) + unit_type = Unicode("Core", config=False) + work_directory = Unicode('', config=False) def __init__(self, config=None): super(IPControllerTask, self).__init__(config=config) @@ -272,20 +272,20 @@ class IPControllerTask(WinHPCTask): class IPEngineTask(WinHPCTask): - task_name = Str('IPEngine', config=True) + task_name = Unicode('IPEngine', config=True) engine_cmd = List(['ipengine.exe'], config=True) engine_args = List(['--log-to-file', '--log-level', '40'], config=True) # I don't want these to be configurable - std_out_file_path = CStr('', config=False) - std_err_file_path = CStr('', config=False) + std_out_file_path = Unicode('', config=False) + std_err_file_path = Unicode('', config=False) min_cores = Int(1, config=False) max_cores = Int(1, config=False) min_sockets = Int(1, config=False) max_sockets = Int(1, config=False) min_nodes = Int(1, config=False) max_nodes = Int(1, config=False) - unit_type = Str("Core", config=False) - work_directory = CStr('', config=False) + unit_type = Unicode("Core", config=False) + work_directory = Unicode('', config=False) def __init__(self, config=None): super(IPEngineTask,self).__init__(config=config) diff --git a/IPython/parallel/client/client.py b/IPython/parallel/client/client.py index 329f535..1984ba6 100644 --- a/IPython/parallel/client/client.py +++ b/IPython/parallel/client/client.py @@ -24,8 +24,8 @@ import zmq # from zmq.eventloop import ioloop, zmqstream from IPython.utils.path import get_ipython_dir -from IPython.utils.traitlets import (HasTraits, Int, Instance, CUnicode, - Dict, List, Bool, Str, Set) +from IPython.utils.traitlets import (HasTraits, Int, Instance, Unicode, + Dict, List, Bool, Set) from IPython.external.decorator import decorator from IPython.external.ssh import tunnel @@ -213,7 +213,7 @@ class Client(HasTraits): metadata = Instance('collections.defaultdict', (Metadata,)) history = List() debug = Bool(False) - profile=CUnicode('default') + profile=Unicode('default') _outstanding_dict = Instance('collections.defaultdict', (set,)) _ids = List() @@ -229,7 +229,7 @@ class Client(HasTraits): _notification_socket=Instance('zmq.Socket') _mux_socket=Instance('zmq.Socket') _task_socket=Instance('zmq.Socket') - _task_scheme=Str() + _task_scheme=Unicode() _closed = False _ignored_control_replies=Int(0) _ignored_hub_replies=Int(0) diff --git a/IPython/parallel/controller/dictdb.py b/IPython/parallel/controller/dictdb.py index 0526f2d..05f20ad 100644 --- a/IPython/parallel/controller/dictdb.py +++ b/IPython/parallel/controller/dictdb.py @@ -46,7 +46,7 @@ from datetime import datetime from IPython.config.configurable import Configurable -from IPython.utils.traitlets import Dict, CUnicode +from IPython.utils.traitlets import Dict, Unicode filters = { '$lt' : lambda a,b: a < b, @@ -82,7 +82,7 @@ class CompositeFilter(object): class BaseDB(Configurable): """Empty Parent class so traitlets work on DB.""" # base configurable traits: - session = CUnicode("") + session = Unicode("") class DictDB(BaseDB): """Basic in-memory dict-based object for saving Task Records. diff --git a/IPython/parallel/controller/heartmonitor.py b/IPython/parallel/controller/heartmonitor.py index cee6467..bd69d9a 100644 --- a/IPython/parallel/controller/heartmonitor.py +++ b/IPython/parallel/controller/heartmonitor.py @@ -15,10 +15,10 @@ import time import uuid import zmq -from zmq.devices import ProcessDevice, ThreadDevice +from zmq.devices import ThreadDevice from zmq.eventloop import ioloop, zmqstream -from IPython.utils.traitlets import Set, Instance, CFloat, Bool, CStr +from IPython.utils.traitlets import Set, Instance, CFloat from IPython.parallel.factory import LoggingFactory class Heart(object): diff --git a/IPython/parallel/controller/hub.py b/IPython/parallel/controller/hub.py index 1477da8..5b3bdaa 100755 --- a/IPython/parallel/controller/hub.py +++ b/IPython/parallel/controller/hub.py @@ -26,7 +26,7 @@ from zmq.eventloop.zmqstream import ZMQStream # internal: from IPython.utils.importstring import import_item from IPython.utils.traitlets import ( - HasTraits, Instance, Int, CStr, Str, Dict, Set, List, Bool, Tuple + HasTraits, Instance, Int, Unicode, Dict, Set, Tuple, CStr ) from IPython.parallel import error, util @@ -105,10 +105,10 @@ class EngineConnector(HasTraits): heartbeat (str): identity of heartbeat XREQ socket """ id=Int(0) - queue=Str() - control=Str() - registration=Str() - heartbeat=Str() + queue=CStr() + control=CStr() + registration=CStr() + heartbeat=CStr() pending=Set() class HubFactory(RegistrationFactory): @@ -156,24 +156,24 @@ class HubFactory(RegistrationFactory): def _notifier_port_default(self): return util.select_random_ports(1)[0] - engine_ip = CStr('127.0.0.1', config=True, + engine_ip = Unicode('127.0.0.1', config=True, help="IP on which to listen for engine connections. [default: loopback]") - engine_transport = CStr('tcp', config=True, + engine_transport = Unicode('tcp', config=True, help="0MQ transport for engine connections. [default: tcp]") - client_ip = CStr('127.0.0.1', config=True, + client_ip = Unicode('127.0.0.1', config=True, help="IP on which to listen for client connections. [default: loopback]") - client_transport = CStr('tcp', config=True, + client_transport = Unicode('tcp', config=True, help="0MQ transport for client connections. [default : tcp]") - monitor_ip = CStr('127.0.0.1', config=True, + monitor_ip = Unicode('127.0.0.1', config=True, help="IP on which to listen for monitor messages. [default: loopback]") - monitor_transport = CStr('tcp', config=True, + monitor_transport = Unicode('tcp', config=True, help="0MQ transport for monitor messages. [default : tcp]") - monitor_url = CStr('') + monitor_url = Unicode('') - db_class = CStr('IPython.parallel.controller.dictdb.DictDB', config=True, + db_class = Unicode('IPython.parallel.controller.dictdb.DictDB', config=True, help="""The class to use for the DB backend""") # not configurable @@ -253,7 +253,7 @@ class HubFactory(RegistrationFactory): # connect the db self.log.info('Hub using DB backend: %r'%(self.db_class.split()[-1])) # cdir = self.config.Global.cluster_dir - self.db = import_item(self.db_class)(session=self.session.session, config=self.config) + self.db = import_item(str(self.db_class))(session=self.session.session, config=self.config) time.sleep(.25) try: scheme = self.config.TaskScheduler.scheme_name diff --git a/IPython/parallel/controller/mongodb.py b/IPython/parallel/controller/mongodb.py index 0ecc16c..cb8d4fb 100644 --- a/IPython/parallel/controller/mongodb.py +++ b/IPython/parallel/controller/mongodb.py @@ -9,7 +9,7 @@ from pymongo import Connection from pymongo.binary import Binary -from IPython.utils.traitlets import Dict, List, CUnicode, CStr, Instance +from IPython.utils.traitlets import Dict, List, Unicode, Instance from .dictdb import BaseDB @@ -29,7 +29,7 @@ class MongoDB(BaseDB): necessary if the default mongodb configuration does not point to your mongod instance.""" ) - database = CUnicode(config=True, + database = Unicode(config=True, help="""The MongoDB database name to use for storing tasks for this session. If unspecified, a new database will be created with the Hub's IDENT. Specifying the database will result in tasks from previous sessions being available via Clients' db_query and diff --git a/IPython/parallel/controller/sqlitedb.py b/IPython/parallel/controller/sqlitedb.py index 26f1ce8..737cf2d 100644 --- a/IPython/parallel/controller/sqlitedb.py +++ b/IPython/parallel/controller/sqlitedb.py @@ -15,7 +15,7 @@ import sqlite3 from zmq.eventloop import ioloop -from IPython.utils.traitlets import CUnicode, CStr, Instance, List +from IPython.utils.traitlets import Unicode, Instance, List from .dictdb import BaseDB from IPython.parallel.util import ISO8601 @@ -83,12 +83,12 @@ def _convert_bufs(bs): class SQLiteDB(BaseDB): """SQLite3 TaskRecord backend.""" - filename = CUnicode('tasks.db', config=True, + filename = Unicode('tasks.db', config=True, help="""The filename of the sqlite task database. [default: 'tasks.db']""") - location = CUnicode('', config=True, + location = Unicode('', config=True, help="""The directory containing the sqlite task database. The default is to use the cluster_dir location.""") - table = CUnicode("", config=True, + table = Unicode("", config=True, help="""The SQLite Table to use for storing tasks for this session. If unspecified, a new table will be created with the Hub's IDENT. Specifying the table will result in tasks from previous sessions being available via Clients' db_query and diff --git a/IPython/parallel/engine/engine.py b/IPython/parallel/engine/engine.py index c7dc6e2..891f31a 100755 --- a/IPython/parallel/engine/engine.py +++ b/IPython/parallel/engine/engine.py @@ -19,7 +19,7 @@ import zmq from zmq.eventloop import ioloop, zmqstream # internal -from IPython.utils.traitlets import Instance, Str, Dict, Int, Type, CFloat +from IPython.utils.traitlets import Instance, Dict, Int, Type, CFloat, Unicode # from IPython.utils.localinterfaces import LOCALHOST from IPython.parallel.controller.heartmonitor import Heart @@ -39,7 +39,7 @@ class EngineFactory(RegistrationFactory): display_hook_factory=Type('IPython.zmq.displayhook.DisplayHook', config=True, help="""The class for handling displayhook. Typically 'IPython.zmq.displayhook.DisplayHook'""") - location=Str(config=True, + location=Unicode(config=True, help="""The location (an IP address) of the controller. This is used for disambiguating URLs, to determine whether loopback should be used to connect or the public address.""") diff --git a/IPython/parallel/engine/streamkernel.py b/IPython/parallel/engine/streamkernel.py index 668bba7..8ea1e7f 100755 --- a/IPython/parallel/engine/streamkernel.py +++ b/IPython/parallel/engine/streamkernel.py @@ -28,7 +28,7 @@ import zmq from zmq.eventloop import ioloop, zmqstream # Local imports. -from IPython.utils.traitlets import Instance, List, Int, Dict, Set, Str, CStr +from IPython.utils.traitlets import Instance, List, Int, Dict, Set, Unicode from IPython.zmq.completer import KernelCompleter from IPython.parallel.error import wrap_exception @@ -64,7 +64,7 @@ class Kernel(SessionFactory): #--------------------------------------------------------------------------- # kwargs: - exec_lines = List(CStr, config=True, + exec_lines = List(Unicode, config=True, help="List of lines to execute") int_id = Int(-1) diff --git a/IPython/parallel/factory.py b/IPython/parallel/factory.py index 593ff56..1fb9998 100644 --- a/IPython/parallel/factory.py +++ b/IPython/parallel/factory.py @@ -18,7 +18,7 @@ import os from zmq.eventloop.ioloop import IOLoop from IPython.config.configurable import Configurable -from IPython.utils.traitlets import Str,Int,Instance, CUnicode, CStr +from IPython.utils.traitlets import Int, Instance, Unicode import IPython.parallel.streamsession as ss from IPython.parallel.util import select_random_ports @@ -29,7 +29,7 @@ from IPython.parallel.util import select_random_ports class LoggingFactory(Configurable): """A most basic class, that has a `log` (type:`Logger`) attribute, set via a `logname` Trait.""" log = Instance('logging.Logger', ('ZMQ', logging.WARN)) - logname = CUnicode('ZMQ') + logname = Unicode('ZMQ') def _logname_changed(self, name, old, new): self.log = logging.getLogger(new) @@ -55,14 +55,14 @@ class SessionFactory(LoggingFactory): class RegistrationFactory(SessionFactory): """The Base Configurable for objects that involve registration.""" - url = Str('', config=True, + url = Unicode('', config=True, help="""The 0MQ url used for registration. This sets transport, ip, and port in one variable. For example: url='tcp://127.0.0.1:12345' or url='epgm://*:90210'""") # url takes precedence over ip,regport,transport - transport = Str('tcp', config=True, + transport = Unicode('tcp', config=True, help="""The 0MQ transport for communications. This will likely be the default of 'tcp', but other values include 'ipc', 'epgm', 'inproc'.""") - ip = Str('127.0.0.1', config=True, + ip = Unicode('127.0.0.1', config=True, help="""The IP address for registration. This is generally either '127.0.0.1' for loopback only or '*' for all interfaces. [default: '127.0.0.1']""") diff --git a/IPython/parallel/streamsession.py b/IPython/parallel/streamsession.py index 5c32313..96e4955 100644 --- a/IPython/parallel/streamsession.py +++ b/IPython/parallel/streamsession.py @@ -27,7 +27,7 @@ from zmq.eventloop.zmqstream import ZMQStream from IPython.config.configurable import Configurable from IPython.utils.importstring import import_item -from IPython.utils.traitlets import Str, CStr, CUnicode, Bool, Any +from IPython.utils.traitlets import CStr, Unicode, Bool, Any from .util import ISO8601 @@ -121,7 +121,7 @@ def extract_header(msg_or_header): class StreamSession(Configurable): """tweaked version of IPython.zmq.session.Session, for development in Parallel""" debug=Bool(False, config=True, help="""Debug output in the StreamSession""") - packer = Str('json',config=True, + packer = Unicode('json',config=True, help="""The name of the packer for serializing messages. Should be one of 'json', 'pickle', or an import name for a custom serializer.""") @@ -135,7 +135,7 @@ class StreamSession(Configurable): else: self.pack = import_item(new) - unpacker = Str('json',config=True, + unpacker = Unicode('json',config=True, help="""The name of the unpacker for unserializing messages. Only used with custom functions for `packer`.""") def _unpacker_changed(self, name, old, new): @@ -151,13 +151,13 @@ class StreamSession(Configurable): session = CStr('',config=True, help="""The UUID identifying this session.""") def _session_default(self): - return str(uuid.uuid4()) - username = CUnicode(os.environ.get('USER','username'),config=True, + return bytes(uuid.uuid4()) + username = Unicode(os.environ.get('USER','username'),config=True, help="""Username for the Session. Default is your system username.""") key = CStr('', config=True, help="""execution key, for extra authentication.""") - keyfile = CUnicode('', config=True, + keyfile = Unicode('', config=True, help="""path to file containing execution key.""") def _keyfile_changed(self, name, old, new): with open(new, 'rb') as f: