IPython Documentation

Table Of Contents

Previous topic

parallel.apps.baseapp

Next topic

parallel.apps.ipcontrollerapp

This Page

parallel.apps.ipclusterapp

Module: parallel.apps.ipclusterapp

Inheritance diagram for IPython.parallel.apps.ipclusterapp:

The ipcluster application.

Authors:

  • Brian Granger
  • MinRK

Classes

IPClusterApp

class IPython.parallel.apps.ipclusterapp.IPClusterApp(**kwargs)

Bases: IPython.config.application.Application

__init__(**kwargs)
aliases

An instance of a Python dict.

classmethod class_config_section()

Get the config class config section

classmethod class_get_help()

Get the help string for this class in ReST format.

classmethod class_get_trait_help(trait)

Get the help string for a single trait.

classmethod class_print_help()

Get the help string for a single trait and print it.

classmethod class_trait_names(**metadata)

Get a list of all the names of this classes traits.

This method is just like the trait_names() method, but is unbound.

classmethod class_traits(**metadata)

Get a list of all the traits of this class.

This method is just like the traits() method, but is unbound.

The TraitTypes returned don’t know anything about the values that the various HasTrait’s instances are holding.

This follows the same algorithm as traits does and does not allow for any simple way of specifying merely that a metadata name exists, but has any value. This is because get_metadata returns None if a metadata key doesn’t exist.

classes

An instance of a Python list.

classmethod clear_instance()

unset _instance for this class and singleton parents.

config

A trait whose value must be an instance of a specified class.

The value can also be an instance of a subclass of the specified class.

created = None
description = "Start an IPython cluster for parallel computing.\n\nAn IPython cluster consists of 1 controller and 1 or more engines.\nThis command automates the startup of these processes using a wide\nrange of startup methods (SSH, local processes, PBS, mpiexec,\nWindows HPC Server 2008). To start a cluster with 4 engines on your\nlocal host simply do 'ipcluster start --n=4'. For more complex usage\nyou will typically do 'ipython profile create mycluster --parallel', then edit\nconfiguration files, followed by 'ipcluster start --profile=mycluster --n=4'.\n"
examples = '\nipcluster start --n=4 # start a 4 node cluster on localhost\nipcluster start -h # show the help string for the start subcmd\n\nipcluster stop -h # show the help string for the stop subcmd\nipcluster engines -h # show the help string for the engines subcmd\n'
exit(exit_status=0)
extra_args

An instance of a Python list.

flags

An instance of a Python dict.

generate_config_file()

generate default config file from Configurables

init_logging()

Start logging for this application.

The default is to log to stdout using a StreaHandler. The log level starts at loggin.WARN, but this can be adjusted by setting the log_level attribute.

initialize(argv=None)

Do the basic steps to configure me.

Override in subclasses.

initialize_subcommand(subc, argv=None)

Initialize a subcommand with argv.

classmethod initialized()

Has an instance been created?

classmethod instance(*args, **kwargs)

Returns a global instance of this class.

This method create a new instance if none have previously been created and returns a previously created instance is one already exists.

The arguments and keyword arguments passed to this method are passed on to the __init__() method of the class upon instantiation.

Examples

Create a singleton class using instance, and retrieve it:

>>> from IPython.config.configurable import SingletonConfigurable
>>> class Foo(SingletonConfigurable): pass
>>> foo = Foo.instance()
>>> foo == Foo.instance()
True

Create a subclass that is retrived using the base class instance:

>>> class Bar(SingletonConfigurable): pass
>>> class Bam(Bar): pass
>>> bam = Bam.instance()
>>> bam == Bar.instance()
True
keyvalue_description

A trait for unicode strings.

load_config_file(filename, path=None)

Load a .py based config file by filename and path.

log_level

An enum that whose value must be in a given sequence.

name = u'ipcluster'
on_trait_change(handler, name=None, remove=False)

Setup a handler to be called when a trait changes.

This is used to setup dynamic notifications of trait changes.

Static handlers can be created by creating methods on a HasTraits subclass with the naming convention ‘_[traitname]_changed’. Thus, to create static handler for the trait ‘a’, create the method _a_changed(self, name, old, new) (fewer arguments can be used, see below).

Parameters :

handler : callable

A callable that is called when a trait changes. Its signature can be handler(), handler(name), handler(name, new) or handler(name, old, new).

name : list, str, None

If None, the handler will apply to all traits. If a list of str, handler will apply to all names in the list. If a str, the handler will apply just to that name.

remove : bool

If False (the default), then install the handler. If True then unintall it.

option_description

A trait for unicode strings.

parse_command_line(argv=None)

Parse the command line arguments.

print_alias_help()

Print the alias part of the help.

print_description()

Print the application description.

print_examples()

Print usage and examples.

This usage string goes at the end of the command line help string and should contain examples of the application’s usage.

print_flag_help()

Print the flag part of the help.

print_help(classes=False)

Print the help for each Configurable class in self.classes.

If classes=False (the default), only flags and aliases are printed.

print_options()
print_subcommands()

Print the subcommand part of the help.

print_version()

Print the version string.

start()
subapp

A trait whose value must be an instance of a specified class.

The value can also be an instance of a subclass of the specified class.

subcommand_description

A trait for unicode strings.

subcommands = {'start': ('IPython.parallel.apps.ipclusterapp.IPClusterStart', "Start an IPython cluster for parallel computing\n\nStart an ipython cluster by its profile name or cluster\ndirectory. Cluster directories contain configuration, log and\nsecurity related files and are named using the convention\n'profile_<name>' and should be creating using the 'start'\nsubcommand of 'ipcluster'. If your cluster directory is in \nthe cwd or the ipython directory, you can simply refer to it\nusing its profile name, 'ipcluster start --n=4 --profile=<profile>`,\notherwise use the 'profile-dir' option.\n"), 'stop': ('IPython.parallel.apps.ipclusterapp.IPClusterStop', "Stop a running IPython cluster\n\nStop a running ipython cluster by its profile name or cluster\ndirectory. Cluster directories are named using the convention\n'profile_<name>'. If your cluster directory is in \nthe cwd or the ipython directory, you can simply refer to it\nusing its profile name, 'ipcluster stop --profile=<profile>`, otherwise\nuse the '--profile-dir' option.\n"), 'engines': ('IPython.parallel.apps.ipclusterapp.IPClusterEngines', "Start engines connected to an existing IPython cluster\n\nStart one or more engines to connect to an existing Cluster\nby profile name or cluster directory.\nCluster directories contain configuration, log and\nsecurity related files and are named using the convention\n'profile_<name>' and should be creating using the 'start'\nsubcommand of 'ipcluster'. If your cluster directory is in \nthe cwd or the ipython directory, you can simply refer to it\nusing its profile name, 'ipcluster engines --n=4 --profile=<profile>`,\notherwise use the 'profile-dir' option.\n")}
trait_metadata(traitname, key)

Get metadata values for trait by key.

trait_names(**metadata)

Get a list of all the names of this classes traits.

traits(**metadata)

Get a list of all the traits of this class.

The TraitTypes returned don’t know anything about the values that the various HasTrait’s instances are holding.

This follows the same algorithm as traits does and does not allow for any simple way of specifying merely that a metadata name exists, but has any value. This is because get_metadata returns None if a metadata key doesn’t exist.

update_config(config)

Fire the traits events when the config is updated.

version

A trait for unicode strings.

IPClusterEngines

class IPython.parallel.apps.ipclusterapp.IPClusterEngines(**kwargs)

Bases: IPython.parallel.apps.baseapp.BaseParallelApplication

__init__(**kwargs)
aliases

An instance of a Python dict.

auto_create

A boolean (True, False) trait.

build_launcher(clsname)

import and instantiate a Launcher based on importstring

builtin_profile_dir

A trait for unicode strings.

check_pid(pid)
classmethod class_config_section()

Get the config class config section

classmethod class_get_help()

Get the help string for this class in ReST format.

classmethod class_get_trait_help(trait)

Get the help string for a single trait.

classmethod class_print_help()

Get the help string for a single trait and print it.

classmethod class_trait_names(**metadata)

Get a list of all the names of this classes traits.

This method is just like the trait_names() method, but is unbound.

classmethod class_traits(**metadata)

Get a list of all the traits of this class.

This method is just like the traits() method, but is unbound.

The TraitTypes returned don’t know anything about the values that the various HasTrait’s instances are holding.

This follows the same algorithm as traits does and does not allow for any simple way of specifying merely that a metadata name exists, but has any value. This is because get_metadata returns None if a metadata key doesn’t exist.

classes

An instance of a Python list.

clean_logs

A boolean (True, False) trait.

classmethod clear_instance()

unset _instance for this class and singleton parents.

config

A trait whose value must be an instance of a specified class.

The value can also be an instance of a subclass of the specified class.

config_file_name

A trait for unicode strings.

config_file_paths

An instance of a Python list.

config_file_specified

A boolean (True, False) trait.

config_files

An instance of a Python list.

copy_config_files

A boolean (True, False) trait.

crash_handler_class

alias of ParallelCrashHandler

created = None
daemonize

A boolean (True, False) trait.

default_log_level = 20
description = "Start engines connected to an existing IPython cluster\n\nStart one or more engines to connect to an existing Cluster\nby profile name or cluster directory.\nCluster directories contain configuration, log and\nsecurity related files and are named using the convention\n'profile_<name>' and should be creating using the 'start'\nsubcommand of 'ipcluster'. If your cluster directory is in \nthe cwd or the ipython directory, you can simply refer to it\nusing its profile name, 'ipcluster engines --n=4 --profile=<profile>`,\notherwise use the 'profile-dir' option.\n"
engine_launcher_class

A string holding a valid dotted object name in Python, such as A.b3._c

examples = '\nipcluster engines --profile=mycluster --n=4 # start 4 engines only\n'
exit(exit_status=0)
extra_args

An instance of a Python list.

flags

An instance of a Python dict.

generate_config_file()

generate default config file from Configurables

get_pid_from_file()

Get the pid from the pid file.

If the pid file doesn’t exist a PIDFileError is raised.

init_config_files()

[optionally] copy default config files into profile dir.

init_crash_handler()

Create a crash handler, typically setting sys.excepthook to it.

init_launchers()
init_logging()

Start logging for this application.

The default is to log to stdout using a StreaHandler. The log level starts at loggin.WARN, but this can be adjusted by setting the log_level attribute.

init_profile_dir()

initialize the profile dir

init_signal()
initialize(argv=None)
initialize_subcommand(subc, argv=None)

Initialize a subcommand with argv.

classmethod initialized()

Has an instance been created?

classmethod instance(*args, **kwargs)

Returns a global instance of this class.

This method create a new instance if none have previously been created and returns a previously created instance is one already exists.

The arguments and keyword arguments passed to this method are passed on to the __init__() method of the class upon instantiation.

Examples

Create a singleton class using instance, and retrieve it:

>>> from IPython.config.configurable import SingletonConfigurable
>>> class Foo(SingletonConfigurable): pass
>>> foo = Foo.instance()
>>> foo == Foo.instance()
True

Create a subclass that is retrived using the base class instance:

>>> class Bar(SingletonConfigurable): pass
>>> class Bam(Bar): pass
>>> bam = Bam.instance()
>>> bam == Bar.instance()
True
ipython_dir

A trait for unicode strings.

keyvalue_description

A trait for unicode strings.

load_config_file(suppress_errors=True)

Load the config file.

By default, errors in loading config are handled, and a warning printed on screen. For testing, the suppress_errors option is set to False, so errors will make tests fail.

log_level

An enum that whose value must be in a given sequence.

log_to_file

A boolean (True, False) trait.

log_url

A trait for unicode strings.

loop

A trait whose value must be an instance of a specified class.

The value can also be an instance of a subclass of the specified class.

n

A integer trait.

name = u'ipcluster'
on_trait_change(handler, name=None, remove=False)

Setup a handler to be called when a trait changes.

This is used to setup dynamic notifications of trait changes.

Static handlers can be created by creating methods on a HasTraits subclass with the naming convention ‘_[traitname]_changed’. Thus, to create static handler for the trait ‘a’, create the method _a_changed(self, name, old, new) (fewer arguments can be used, see below).

Parameters :

handler : callable

A callable that is called when a trait changes. Its signature can be handler(), handler(name), handler(name, new) or handler(name, old, new).

name : list, str, None

If None, the handler will apply to all traits. If a list of str, handler will apply to all names in the list. If a str, the handler will apply just to that name.

remove : bool

If False (the default), then install the handler. If True then unintall it.

option_description

A trait for unicode strings.

overwrite

A boolean (True, False) trait.

parse_command_line(argv=None)

Parse the command line arguments.

print_alias_help()

Print the alias part of the help.

print_description()

Print the application description.

print_examples()

Print usage and examples.

This usage string goes at the end of the command line help string and should contain examples of the application’s usage.

print_flag_help()

Print the flag part of the help.

print_help(classes=False)

Print the help for each Configurable class in self.classes.

If classes=False (the default), only flags and aliases are printed.

print_options()
print_subcommands()

Print the subcommand part of the help.

print_version()

Print the version string.

profile

A trait for unicode strings.

reinit_logging()
remove_pid_file()

Remove the pid file.

This should be called at shutdown by registering a callback with reactor.addSystemEventTrigger(). This needs to return None.

sigint_handler(signum, frame)
stage_default_config_file()

auto generate default config file, and stage it into the profile.

start()

Start the app for the engines subcommand.

start_engines()
start_logging()
stop_engines()
stop_launchers(r=None)
subapp

A trait whose value must be an instance of a specified class.

The value can also be an instance of a subclass of the specified class.

subcommand_description

A trait for unicode strings.

subcommands

An instance of a Python dict.

to_work_dir()
trait_metadata(traitname, key)

Get metadata values for trait by key.

trait_names(**metadata)

Get a list of all the names of this classes traits.

traits(**metadata)

Get a list of all the traits of this class.

The TraitTypes returned don’t know anything about the values that the various HasTrait’s instances are holding.

This follows the same algorithm as traits does and does not allow for any simple way of specifying merely that a metadata name exists, but has any value. This is because get_metadata returns None if a metadata key doesn’t exist.

update_config(config)

Fire the traits events when the config is updated.

usage = None
version

A trait for unicode strings.

work_dir

A trait for unicode strings.

write_pid_file(overwrite=False)

Create a .pid file in the pid_dir with my pid.

This must be called after pre_construct, which sets self.pid_dir. This raises PIDFileError if the pid file exists already.

IPClusterStart

class IPython.parallel.apps.ipclusterapp.IPClusterStart(**kwargs)

Bases: IPython.parallel.apps.ipclusterapp.IPClusterEngines

__init__(**kwargs)
aliases

An instance of a Python dict.

auto_create

A boolean (True, False) trait.

build_launcher(clsname)

import and instantiate a Launcher based on importstring

builtin_profile_dir

A trait for unicode strings.

check_pid(pid)
classmethod class_config_section()

Get the config class config section

classmethod class_get_help()

Get the help string for this class in ReST format.

classmethod class_get_trait_help(trait)

Get the help string for a single trait.

classmethod class_print_help()

Get the help string for a single trait and print it.

classmethod class_trait_names(**metadata)

Get a list of all the names of this classes traits.

This method is just like the trait_names() method, but is unbound.

classmethod class_traits(**metadata)

Get a list of all the traits of this class.

This method is just like the traits() method, but is unbound.

The TraitTypes returned don’t know anything about the values that the various HasTrait’s instances are holding.

This follows the same algorithm as traits does and does not allow for any simple way of specifying merely that a metadata name exists, but has any value. This is because get_metadata returns None if a metadata key doesn’t exist.

classes

An instance of a Python list.

clean_logs

A boolean (True, False) trait.

classmethod clear_instance()

unset _instance for this class and singleton parents.

config

A trait whose value must be an instance of a specified class.

The value can also be an instance of a subclass of the specified class.

config_file_name

A trait for unicode strings.

config_file_paths

An instance of a Python list.

config_file_specified

A boolean (True, False) trait.

config_files

An instance of a Python list.

controller_launcher_class

A string holding a valid dotted object name in Python, such as A.b3._c

copy_config_files

A boolean (True, False) trait.

crash_handler_class

alias of ParallelCrashHandler

created = None
daemonize

A boolean (True, False) trait.

default_log_level = 20
delay

A casting version of the float trait.

description = "Start an IPython cluster for parallel computing\n\nStart an ipython cluster by its profile name or cluster\ndirectory. Cluster directories contain configuration, log and\nsecurity related files and are named using the convention\n'profile_<name>' and should be creating using the 'start'\nsubcommand of 'ipcluster'. If your cluster directory is in \nthe cwd or the ipython directory, you can simply refer to it\nusing its profile name, 'ipcluster start --n=4 --profile=<profile>`,\notherwise use the 'profile-dir' option.\n"
engine_launcher_class

A string holding a valid dotted object name in Python, such as A.b3._c

examples = '\nipython profile create mycluster --parallel # create mycluster profile\nipcluster start --profile=mycluster --n=4 # start mycluster with 4 nodes\n'
exit(exit_status=0)
extra_args

An instance of a Python list.

flags

An instance of a Python dict.

generate_config_file()

generate default config file from Configurables

get_pid_from_file()

Get the pid from the pid file.

If the pid file doesn’t exist a PIDFileError is raised.

init_config_files()

[optionally] copy default config files into profile dir.

init_crash_handler()

Create a crash handler, typically setting sys.excepthook to it.

init_launchers()
init_logging()

Start logging for this application.

The default is to log to stdout using a StreaHandler. The log level starts at loggin.WARN, but this can be adjusted by setting the log_level attribute.

init_profile_dir()

initialize the profile dir

init_signal()
initialize(argv=None)
initialize_subcommand(subc, argv=None)

Initialize a subcommand with argv.

classmethod initialized()

Has an instance been created?

classmethod instance(*args, **kwargs)

Returns a global instance of this class.

This method create a new instance if none have previously been created and returns a previously created instance is one already exists.

The arguments and keyword arguments passed to this method are passed on to the __init__() method of the class upon instantiation.

Examples

Create a singleton class using instance, and retrieve it:

>>> from IPython.config.configurable import SingletonConfigurable
>>> class Foo(SingletonConfigurable): pass
>>> foo = Foo.instance()
>>> foo == Foo.instance()
True

Create a subclass that is retrived using the base class instance:

>>> class Bar(SingletonConfigurable): pass
>>> class Bam(Bar): pass
>>> bam = Bam.instance()
>>> bam == Bar.instance()
True
ipython_dir

A trait for unicode strings.

keyvalue_description

A trait for unicode strings.

load_config_file(suppress_errors=True)

Load the config file.

By default, errors in loading config are handled, and a warning printed on screen. For testing, the suppress_errors option is set to False, so errors will make tests fail.

log_level

An enum that whose value must be in a given sequence.

log_to_file

A boolean (True, False) trait.

log_url

A trait for unicode strings.

loop

A trait whose value must be an instance of a specified class.

The value can also be an instance of a subclass of the specified class.

n

A integer trait.

name = u'ipcluster'
on_trait_change(handler, name=None, remove=False)

Setup a handler to be called when a trait changes.

This is used to setup dynamic notifications of trait changes.

Static handlers can be created by creating methods on a HasTraits subclass with the naming convention ‘_[traitname]_changed’. Thus, to create static handler for the trait ‘a’, create the method _a_changed(self, name, old, new) (fewer arguments can be used, see below).

Parameters :

handler : callable

A callable that is called when a trait changes. Its signature can be handler(), handler(name), handler(name, new) or handler(name, old, new).

name : list, str, None

If None, the handler will apply to all traits. If a list of str, handler will apply to all names in the list. If a str, the handler will apply just to that name.

remove : bool

If False (the default), then install the handler. If True then unintall it.

option_description

A trait for unicode strings.

overwrite

A boolean (True, False) trait.

parse_command_line(argv=None)

Parse the command line arguments.

print_alias_help()

Print the alias part of the help.

print_description()

Print the application description.

print_examples()

Print usage and examples.

This usage string goes at the end of the command line help string and should contain examples of the application’s usage.

print_flag_help()

Print the flag part of the help.

print_help(classes=False)

Print the help for each Configurable class in self.classes.

If classes=False (the default), only flags and aliases are printed.

print_options()
print_subcommands()

Print the subcommand part of the help.

print_version()

Print the version string.

profile

A trait for unicode strings.

reinit_logging()
remove_pid_file()

Remove the pid file.

This should be called at shutdown by registering a callback with reactor.addSystemEventTrigger(). This needs to return None.

reset

A boolean (True, False) trait.

sigint_handler(signum, frame)
stage_default_config_file()

auto generate default config file, and stage it into the profile.

start()

Start the app for the start subcommand.

start_controller()
start_engines()
start_logging()
stop_controller()
stop_engines()
stop_launchers(r=None)
subapp

A trait whose value must be an instance of a specified class.

The value can also be an instance of a subclass of the specified class.

subcommand_description

A trait for unicode strings.

subcommands

An instance of a Python dict.

to_work_dir()
trait_metadata(traitname, key)

Get metadata values for trait by key.

trait_names(**metadata)

Get a list of all the names of this classes traits.

traits(**metadata)

Get a list of all the traits of this class.

The TraitTypes returned don’t know anything about the values that the various HasTrait’s instances are holding.

This follows the same algorithm as traits does and does not allow for any simple way of specifying merely that a metadata name exists, but has any value. This is because get_metadata returns None if a metadata key doesn’t exist.

update_config(config)

Fire the traits events when the config is updated.

usage = None
version

A trait for unicode strings.

work_dir

A trait for unicode strings.

write_pid_file(overwrite=False)

Create a .pid file in the pid_dir with my pid.

This must be called after pre_construct, which sets self.pid_dir. This raises PIDFileError if the pid file exists already.

IPClusterStop

class IPython.parallel.apps.ipclusterapp.IPClusterStop(**kwargs)

Bases: IPython.parallel.apps.baseapp.BaseParallelApplication

__init__(**kwargs)
aliases

An instance of a Python dict.

auto_create

A boolean (True, False) trait.

builtin_profile_dir

A trait for unicode strings.

check_pid(pid)
classmethod class_config_section()

Get the config class config section

classmethod class_get_help()

Get the help string for this class in ReST format.

classmethod class_get_trait_help(trait)

Get the help string for a single trait.

classmethod class_print_help()

Get the help string for a single trait and print it.

classmethod class_trait_names(**metadata)

Get a list of all the names of this classes traits.

This method is just like the trait_names() method, but is unbound.

classmethod class_traits(**metadata)

Get a list of all the traits of this class.

This method is just like the traits() method, but is unbound.

The TraitTypes returned don’t know anything about the values that the various HasTrait’s instances are holding.

This follows the same algorithm as traits does and does not allow for any simple way of specifying merely that a metadata name exists, but has any value. This is because get_metadata returns None if a metadata key doesn’t exist.

classes

An instance of a Python list.

clean_logs

A boolean (True, False) trait.

classmethod clear_instance()

unset _instance for this class and singleton parents.

config

A trait whose value must be an instance of a specified class.

The value can also be an instance of a subclass of the specified class.

config_file_name

A trait for unicode strings.

config_file_paths

An instance of a Python list.

config_file_specified

A boolean (True, False) trait.

config_files

An instance of a Python list.

copy_config_files

A boolean (True, False) trait.

crash_handler_class

alias of ParallelCrashHandler

created = None
description = "Stop a running IPython cluster\n\nStop a running ipython cluster by its profile name or cluster\ndirectory. Cluster directories are named using the convention\n'profile_<name>'. If your cluster directory is in \nthe cwd or the ipython directory, you can simply refer to it\nusing its profile name, 'ipcluster stop --profile=<profile>`, otherwise\nuse the '--profile-dir' option.\n"
examples = '\nipcluster stop --profile=mycluster # stop a running cluster by profile name\n'
exit(exit_status=0)
extra_args

An instance of a Python list.

flags

An instance of a Python dict.

generate_config_file()

generate default config file from Configurables

get_pid_from_file()

Get the pid from the pid file.

If the pid file doesn’t exist a PIDFileError is raised.

init_config_files()

[optionally] copy default config files into profile dir.

init_crash_handler()

Create a crash handler, typically setting sys.excepthook to it.

init_logging()

Start logging for this application.

The default is to log to stdout using a StreaHandler. The log level starts at loggin.WARN, but this can be adjusted by setting the log_level attribute.

init_profile_dir()

initialize the profile dir

initialize(argv=None)

initialize the app

initialize_subcommand(subc, argv=None)

Initialize a subcommand with argv.

classmethod initialized()

Has an instance been created?

classmethod instance(*args, **kwargs)

Returns a global instance of this class.

This method create a new instance if none have previously been created and returns a previously created instance is one already exists.

The arguments and keyword arguments passed to this method are passed on to the __init__() method of the class upon instantiation.

Examples

Create a singleton class using instance, and retrieve it:

>>> from IPython.config.configurable import SingletonConfigurable
>>> class Foo(SingletonConfigurable): pass
>>> foo = Foo.instance()
>>> foo == Foo.instance()
True

Create a subclass that is retrived using the base class instance:

>>> class Bar(SingletonConfigurable): pass
>>> class Bam(Bar): pass
>>> bam = Bam.instance()
>>> bam == Bar.instance()
True
ipython_dir

A trait for unicode strings.

keyvalue_description

A trait for unicode strings.

load_config_file(suppress_errors=True)

Load the config file.

By default, errors in loading config are handled, and a warning printed on screen. For testing, the suppress_errors option is set to False, so errors will make tests fail.

log_level

An enum that whose value must be in a given sequence.

log_to_file

A boolean (True, False) trait.

log_url

A trait for unicode strings.

loop

A trait whose value must be an instance of a specified class.

The value can also be an instance of a subclass of the specified class.

name = u'ipcluster'
on_trait_change(handler, name=None, remove=False)

Setup a handler to be called when a trait changes.

This is used to setup dynamic notifications of trait changes.

Static handlers can be created by creating methods on a HasTraits subclass with the naming convention ‘_[traitname]_changed’. Thus, to create static handler for the trait ‘a’, create the method _a_changed(self, name, old, new) (fewer arguments can be used, see below).

Parameters :

handler : callable

A callable that is called when a trait changes. Its signature can be handler(), handler(name), handler(name, new) or handler(name, old, new).

name : list, str, None

If None, the handler will apply to all traits. If a list of str, handler will apply to all names in the list. If a str, the handler will apply just to that name.

remove : bool

If False (the default), then install the handler. If True then unintall it.

option_description

A trait for unicode strings.

overwrite

A boolean (True, False) trait.

parse_command_line(argv=None)

Parse the command line arguments.

print_alias_help()

Print the alias part of the help.

print_description()

Print the application description.

print_examples()

Print usage and examples.

This usage string goes at the end of the command line help string and should contain examples of the application’s usage.

print_flag_help()

Print the flag part of the help.

print_help(classes=False)

Print the help for each Configurable class in self.classes.

If classes=False (the default), only flags and aliases are printed.

print_options()
print_subcommands()

Print the subcommand part of the help.

print_version()

Print the version string.

profile

A trait for unicode strings.

reinit_logging()
remove_pid_file()

Remove the pid file.

This should be called at shutdown by registering a callback with reactor.addSystemEventTrigger(). This needs to return None.

signal

A integer trait.

stage_default_config_file()

auto generate default config file, and stage it into the profile.

start()

Start the app for the stop subcommand.

subapp

A trait whose value must be an instance of a specified class.

The value can also be an instance of a subclass of the specified class.

subcommand_description

A trait for unicode strings.

subcommands

An instance of a Python dict.

to_work_dir()
trait_metadata(traitname, key)

Get metadata values for trait by key.

trait_names(**metadata)

Get a list of all the names of this classes traits.

traits(**metadata)

Get a list of all the traits of this class.

The TraitTypes returned don’t know anything about the values that the various HasTrait’s instances are holding.

This follows the same algorithm as traits does and does not allow for any simple way of specifying merely that a metadata name exists, but has any value. This is because get_metadata returns None if a metadata key doesn’t exist.

update_config(config)

Fire the traits events when the config is updated.

version

A trait for unicode strings.

work_dir

A trait for unicode strings.

write_pid_file(overwrite=False)

Create a .pid file in the pid_dir with my pid.

This must be called after pre_construct, which sets self.pid_dir. This raises PIDFileError if the pid file exists already.

Function

IPython.parallel.apps.ipclusterapp.launch_new_instance()

Create and run the IPython cluster.