topo.command Package


command Package

Inheritance diagram of topo.command

A family of high-level user commands acting on the entire simulation.

Any new commands added to this directory will automatically become available for any program.

Commands here should be ‘bullet-proof’ and work ‘from scratch’. That is, they should print warnings if required but should not raise errors that would interrupt e.g. a long batch run of simulation work, no matter what the context from which they are called.

topo.command.save_snapshot(snapshot_name=None)[source]

Save a snapshot of the network’s current state.

The snapshot is saved as a gzip-compressed Python binary pickle.

As this function uses Python’s ‘pickle’ module, it is subject to the same limitations (see the pickle module’s documentation) - with the notable exception of class attributes. Python does not pickle class attributes, but this function stores class attributes of any Parameterized class that is declared within the topo package. See the param.parameterized.PicklableClassAttributes class for more information.

class topo.command.runscript(**params)[source]

Bases: param.parameterized.ParameterizedFunction

Runs a script that has been parameterized with script parameters. For example, runscript(‘tiny.ty’, cortex_density=10) will execute the ‘tiny.ty’ script in the currently active namespace.

param Boolean load (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to automatically load class based models when called. Useful for compatibility with older ty script definition files.
param Callable push (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=False, precedence=None, readonly=False)
Hook to push the updated namespace for handling more complicated namespaces, such as IPython Notebook.
param Parameter ns (allow_None=False, constant=False, default={}, instantiate=False, pickle_default_value=False, precedence=None, readonly=False)
The namespace in which the script is to be executed.
debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07ab940788>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07ab9404c8>
inspect_value = <functools.partial object at 0x2b07ab940890>
instance = <functools.partial object at 0x2b07ab940730>
message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07ab9407e0>
set_param = <functools.partial object at 0x2b07ab940940>
state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

topo.command.default_analysis_function()[source]

Basic example of an analysis command for run_batch; users are likely to need something similar but highly customized.

class topo.command.run_batch(**params)[source]

Bases: param.parameterized.ParameterizedFunction

Run a Topographica simulation in batch mode.

Features:

  • Generates a unique, well-defined name for each ‘experiment’ (i.e. simulation run) based on the date, script file, and parameter settings. Note that very long names may be truncated (see the max_name_length parameter).
  • Allows parameters to be varied on the command-line, to allow comparing various settings
  • Saves a script capturing the simulation state periodically, to preserve parameter values from old experiments and to allow them to be reproduced exactly later
  • Can perform user-specified analysis routines periodically, to monitor the simulation as it progresses.
  • Stores commandline output (stdout) in the output directory

A typical use of this function is for remote execution of a large number of simulations with different parameters, often on remote machines (such as clusters).

The script_file parameter defines the .ty script we want to run in batch mode. The output_directory defines the root directory in which a unique individual directory will be created for this particular run. The optional analysis_fn can be any python function to be called at each of the simulation iterations defined in the analysis times list. The analysis_fn should perform whatever analysis of the simulation you want to perform, such as plotting or calculating some statistics. The analysis_fn should avoid using any GUI functions (i.e., should not import anything from topo.tkgui), and it should save all of its results into files.

As a special case, a number can be passed for the times list, in which case it is used to scale a default list of times up to 10000; e.g. times=2 will select a default list of times up to 20000. Alternatively, an explicit list of times can be supplied.

Any other optional parameters supplied will be set in the main namespace before any scripts are run. They will also be used to construct a unique topo.sim.name for the file, and they will be encoded into the simulation directory name, to make it clear how each simulation differs from the others.

If requested by setting snapshot=True, saves a snapshot at the end of the simulation.

If available and requested by setting vc_info=True, prints the revision number and any outstanding diffs from the version control system.

Note that this function alters param.normalize_path.prefix so that all output goes into the same location. The original value of param.normalize_path.prefix is deliberately not restored at the end of the function so that the output of any subsequent commands will go into the same place.

param Callable dirname_params_filter (allow_None=False, constant=False, default=param_formatter(), instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Function to control how the parameter names will appear in the output_directory’s name.

param Callable analysis_fn (allow_None=False, constant=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)

param String progress_bar (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=stdout, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
The display mode for the progress bar. By default, the progress of run_batch is displayed using standard output but may also be set to ‘disabled’ as necessary.
param Number max_name_length (allow_None=False, bounds=None, constant=False, default=200, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The experiment’s directory name will be truncated at this number of characters (since most filesystems have a limit).
param String dirname_prefix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional prefix for the directory name (allowing e.g. easy grouping).

param Parameter times (allow_None=False, constant=False, default=1.0, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)

param ObjectSelector save_script_repr (allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=first, instantiate=False, objects=[None, ‘first’, ‘last’, ‘all’], pickle_default_value=True, precedence=None, readonly=False)
Whether to save a script_repr and if so, how often. If set to ‘first’, the script_repr is saved on the first time value, if set to ‘last’ then it will be saved on the last time value. If set to ‘all’ then a script repr is saved for all time values. Saving is disabled entirely if set to None.
param String name_time_format (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=%Y%m%d%H%M, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
String format for the time included in the output directory and file names. See the Python time module library documentation for codes. E.g. Adding ‘%S’ to the default would include seconds.

param Boolean vc_info (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)

param String output_directory (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=Output, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)

param String tag (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional tag to embed in directory prefix to allow unique directory naming across multiple independent batches that share a common timestamp.

param Boolean snapshot (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)

param Number progress_interval (allow_None=False, bounds=None, constant=False, default=100, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Interval between updates of the progress bar (if enabled) in units of topo.sim.time.
param NumericTuple timestamp (allow_None=False, constant=False, default=(0, 0), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False)
Optional override of timestamp in Python struct_time 8-tuple format. Useful when running many run_batch commands as part of a group with a shared timestamp. By default, the timestamp used is the time when run_batch is started.
param Boolean save_global_params (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to save the script’s global_parameters to a pickle in the output_directory after the script has been loaded (for e.g. future inspection of the experiment).
param String metadata_dir (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Specifies the name of a subdirectory used to output metadata from run_batch (if set).
param ObjectSelector compress_metadata (allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=None, instantiate=False, objects=[None, ‘tar.gz’, ‘zip’], pickle_default_value=True, precedence=None, readonly=False)
If not None and a metadata directory is specified, the metadata directory will be replaced by either a tar.gz file or a .zip file.
static analysis_fn()

Basic example of an analysis command for run_batch; users are likely to need something similar but highly customized.

debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07ab9405d0>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07ab940578>
inspect_value = <functools.partial object at 0x2b07ab940628>
instance = <functools.partial object at 0x2b07ab940890>
message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07ab940520>
set_param = <functools.partial object at 0x2b07ab940998>
state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

topo.command.load_kwargs(fname, glob, loc, fail_exception=False)[source]

Helper function to allow keyword arguments (dictionary format) to be loaded from a file ‘fname’. The intended use is to allow a callable (specifically run_batch) to obtain its settings and parameters from file.

This is useful when dispatching jobs on a cluster as you can then queue run_batch jobs (eg. using qsub) before all the settings are known. This type of scenario is typical in parameter search (eg hillclimbing) where the settings file for future run_batch instances are conditional on data from previous simulations.

Variable glob should be provided as globals() and loc should be provided as locals(). Either a dictionary is returned or an exception is raised (conditioned on fail_exception). If fail_exception=False and eval does not evaluateas expected, an empty dictionary is returned. Eval is used as it allows classes, objects and other complex datastructures to load.

topo.command.save_script_repr(script_name=None)[source]

Save the current simulation as a Topographica script.

Generates a script that, if run, would generate a simulation with the same architecture as the one currently in memory. This can be useful when defining networks in place, so that the same general configuration can be recreated later. It also helps when comparing two similar networks generated with different scripts, so that the corresponding items can be matched rigorously.

Note that the result of this operation is usually just a starting point for further editing, because it will not usually be runnable as-is (for instance, some parameters may not have runnable representations). Even so, this is usually a good start.

topo.command.generate_example(target)[source]

Generate the saved network target, as defined in topo.misc.genexamples.

class topo.command.PatternDrivenAnalysis(**params)

Bases: param.parameterized.ParameterizedFunction

Abstract base class for various stimulus-response types of analysis.

This type of analysis consists of presenting a set of input patterns and collecting the responses to each one, which one will often want to do in a way that does not affect the current state of the network.

To achieve this, the class defines several types of hooks where arbitrary function objects (i.e., callables) can be registered. These hooks are generally used to ensure that unrelated previous activity is eliminated, that subsequent patterns do not interact, and that the initial state is restored after analysis.

Any subclasses must ensure that these hook lists are run at the appropriate stage in their processing, using e.g. “for f in some_hook_list: f()”.

param HookList pre_presentation_hooks (allow_None=False, bounds=(0, None), constant=False, default=[<bound method Simulation.state_push of Simulation(basename_format=’%(name)s_%(timestr)s’, name=None, register=True, startup_commands=[], time=Time(label=’Time’, name=’Time00001’, time_type=<built-in function mpq>, timestep=1.0, unit=None, until=Infinity()), time_printing_format=’%(_time)09.2f’)>, <function wipe_out_activity at 0x2b07a8f5db18>, <function clear_event_queue at 0x2b07a8f5d2a8>], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
List of callable objects to be run before each pattern is presented.
param HookList post_presentation_hooks (allow_None=False, bounds=(0, None), constant=False, default=[<bound method Simulation.state_pop of Simulation(basename_format=’%(name)s_%(timestr)s’, name=None, register=True, startup_commands=[], time=Time(label=’Time’, name=’Time00001’, time_type=<built-in function mpq>, timestep=1.0, unit=None, until=Infinity()), time_printing_format=’%(_time)09.2f’)>], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
List of callable objects to be run after each pattern is presented.
param HookList post_analysis_session_hooks (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
List of callable objects to be run after an analysis session ends.
param HookList pre_analysis_session_hooks (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
List of callable objects to be run before an analysis session begins.
debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07ab9407e0>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07ab9406d8>
inspect_value = <functools.partial object at 0x2b07ab9409f0>
instance = <functools.partial object at 0x2b07ab940aa0>
message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07ab940e68>
set_param = <functools.partial object at 0x2b07ab940ec0>
state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

class topo.command.Command(**params)[source]

Bases: param.parameterized.ParameterizedFunction

Parameterized command: any error when the command is run (called) will not raise an exception, but will instead generate a warning.

debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07ab9409f0>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07ab940aa0>
inspect_value = <functools.partial object at 0x2b07ab940838>
instance = <functools.partial object at 0x2b07ab940b50>
message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07ab940a48>
set_param = <functools.partial object at 0x2b07ab940cb0>
state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

topo.command.clear_event_queue()[source]

Remove pending events from the simulator’s event queue.

topo.command.wipe_out_activity()[source]

Resets activity of all Sheets and their connections to zero.

class topo.command.normalize_path(**params)

Bases: param.parameterized.ParameterizedFunction

params(prefix=String, name=String)

Convert a UNIX-style path to the current OS’s format, typically for creating a new file or directory.

If the path is not already absolute, it will be made absolute (using the prefix parameter).

Should do the same as Python’s os.path.abspath(), except using prefix rather than os.getcwd).

 Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Mode 

prefix ‘/var/lib/buildbot/slaves/topographic... String V RW

Parameter docstrings: =====================

prefix: Prepended to the specified path, if that path is not  absolute.

param String prefix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=/var/lib/buildbot/slaves/topographica_docs/build/doc, instantiate=False, pickle_default_value=False, precedence=None, readonly=False)
Prepended to the specified path, if that path is not absolute.
debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07ab9407e0>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07ab9409f0>
inspect_value = <functools.partial object at 0x2b07ab940730>
instance = <functools.partial object at 0x2b07ab9406d8>
message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07ab940578>
set_param = <functools.partial object at 0x2b07ab940c00>
state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

topo.command.restore_input_generators()[source]

Restore previously saved input_generators for all of topo.sim’s GeneratorSheets.

class topo.command.ParameterizedFunction(**params)

Bases: param.parameterized.Parameterized

params(name=String)

Acts like a Python function, but with arguments that are Parameters.

Implemented as a subclass of Parameterized that, when instantiated, automatically invokes __call__ and returns the result, instead of returning an instance of the class.

To obtain an instance of this class, call instance().

 Object has no parameters.

debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07ab940a48>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07ab940ba8>
inspect_value = <functools.partial object at 0x2b07ab940c58>
instance = <functools.partial object at 0x2b07ab940d60>
message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07ab940680>
set_param = <functools.partial object at 0x2b07ab940998>
state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

topo.command.n_conns()[source]

Count the number of connections in all ProjectionSheets in the current Simulation.

topo.command.load_snapshot(snapshot_name)[source]

Load the simulation stored in snapshot_name.

topo.command.print_sizes()[source]

Format the results from n_conns() and n_bytes() for use in batch output.

topo.command.n_bytes()[source]

Estimate the minimum memory needed for the Sheets in this Simulation, in bytes.

This estimate is a lower bound only, based primarily on memory for the matrices used for activity and connections.

topo.command.save_input_generators()[source]

Save a copy of the active_sim’s current input_generators for all GeneratorSheets.

class topo.command.UnpickleEnvironmentCreator(release, version)[source]

Bases: object

When unpickled, installs any necessary legacy support.

class topo.command.ImportErrorRaisingFakeModule(module_name)[source]

Bases: object

Returns an ImportErrorObject for any attribute request.

Instances of this class can be used in place of a module to delay an import error until the point of use of an attribute of that module.

See ImportErrorObject for more details.

class topo.command.ImportErrorObject(module_name)[source]

Bases: object

Raises an ImportError on any attempt to access an attribute, call, or get an item.

Useful to delay an ImportError until the point of use, thus allowing e.g. a class attribute to contain something from a non-core external module (e.g. pylab).

Delaying an ImportError until the point of use allows users to be informed of the possibility of having various extra functions on installation of a missing package.


analysis Module


pylabplot Module

Inheritance diagram of topo.command.pylabplot

Line-based and matrix-based plotting commands using MatPlotLib.

Before importing this file, you will probably want to do something like:

from matplotlib import rcParams rcParams[‘backend’]=’TkAgg’

to select a backend, or else select an appropriate one in your matplotlib.rc file (if any). There are many backends available for different GUI or non-GUI uses.

class topo.command.pylabplot.fftplot(**params)[source]

Bases: topo.command.pylabplot.matrixplot

Compute and show the 2D Fast Fourier Transform (FFT) of the supplied data.

Example:: fftplot(topo.sim[“V1”].views.Maps[“OrientationPreference”].data,filename=”out”)

param Parameter extent (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Subregion of the matrix to plot, as a tuple (l,b,r,t).
param Callable plot_type (allow_None=False, constant=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Matplotlib command to generate the plot, e.g. plt.gray or plt.hsv.
param Number file_dpi (allow_None=False, bounds=(0, None), constant=False, default=100.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Default DPI when rendering to a bitmap. The nominal size * the dpi gives the final image size in pixels. E.g.: 4”x4” image * 80 dpi ==> 320x320 pixel image.
param String title (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional title to be used when displaying the plot interactively.
param String file_format (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=png, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Which image format to use when saving images. The output can be png, ps, pdf, svg, or any other format supported by Matplotlib.
param String filename (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional base of the filename to use when saving images; if None the plot will be displayed interactively. The actual name is constructed from the filename base plus the suffix plus the current simulator time plus the file_format.
param String filename_suffix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional suffix to be used for disambiguation of the filename.
param Boolean display_window (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to open a display window containing the plot when Topographica is running in a non-batch mode.
debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07ac61afc8>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07ac7730a8>
inspect_value = <functools.partial object at 0x2b07ac773100>
instance = <functools.partial object at 0x2b07ac773050>
message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

static plot_type()

set the default colormap to gray and apply to current image if any. See help(colormaps) for more information

pprint(imports=None, prefix='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07ac773158>
set_param = <functools.partial object at 0x2b07ac773260>
state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

class topo.command.pylabplot.xy_grid(**params)[source]

Bases: topo.command.pylabplot.PylabPlotCommand

By default, plot the x and y coordinate preferences as a grid.

param Number file_dpi (allow_None=False, bounds=(0, None), constant=False, default=100.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Default DPI when rendering to a bitmap. The nominal size * the dpi gives the final image size in pixels. E.g.: 4”x4” image * 80 dpi ==> 320x320 pixel image.
param String title (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional title to be used when displaying the plot interactively.
param Integer skip (allow_None=False, bounds=[1, None], constant=False, default=1, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Plot every skipth line in each direction. E.g. skip=4 means to keep only every fourth horizontal line and every fourth vertical line, except that the first and last are always included. The default is to include all data points.
param String file_format (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=png, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Which image format to use when saving images. The output can be png, ps, pdf, svg, or any other format supported by Matplotlib.
param String filename (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional base of the filename to use when saving images; if None the plot will be displayed interactively. The actual name is constructed from the filename base plus the suffix plus the current simulator time plus the file_format.
param String filename_suffix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional suffix to be used for disambiguation of the filename.
param Boolean display_window (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to open a display window containing the plot when Topographica is running in a non-batch mode.
param Array y (allow_None=True, constant=False, default=None, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Numpy array of y positions in the grid.
param Array x (allow_None=True, constant=False, default=None, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Numpy array of x positions in the grid.
param Parameter axis (allow_None=False, constant=False, default=[-0.5, 0.5, -0.5, 0.5], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Four-element list of the plot bounds, i.e. [xmin, xmax, ymin, ymax].
debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07ac61af70>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07ac7700a8>
inspect_value = <functools.partial object at 0x2b07ac770100>
instance = <functools.partial object at 0x2b07ac770050>
message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07ac770158>
set_param = <functools.partial object at 0x2b07ac770260>
state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

topo.command.pylabplot.fftshift(x, axes=None)

Shift the zero-frequency component to the center of the spectrum.

This function swaps half-spaces for all axes listed (defaults to all). Note that y[0] is the Nyquist component only if len(x) is even.

x : array_like
Input array.
axes : int or shape tuple, optional
Axes over which to shift. Default is None, which shifts all axes.
y : ndarray
The shifted array.

ifftshift : The inverse of fftshift.

>>> freqs = np.fft.fftfreq(10, 0.1)
>>> freqs
array([ 0.,  1.,  2.,  3.,  4., -5., -4., -3., -2., -1.])
>>> np.fft.fftshift(freqs)
array([-5., -4., -3., -2., -1.,  0.,  1.,  2.,  3.,  4.])

Shift the zero-frequency component only along the second axis:

>>> freqs = np.fft.fftfreq(9, d=1./9).reshape(3, 3)
>>> freqs
array([[ 0.,  1.,  2.],
       [ 3.,  4., -4.],
       [-3., -2., -1.]])
>>> np.fft.fftshift(freqs, axes=(1,))
array([[ 2.,  0.,  1.],
       [-4.,  3.,  4.],
       [-1., -3., -2.]])
topo.command.pylabplot.wrap(lower, upper, x)

Circularly alias the numeric value x into the range [lower,upper).

Valid for cyclic quantities like orientations or hues.

class topo.command.pylabplot.matrixplot3dx3(**params)[source]

Bases: topo.command.pylabplot.PylabPlotCommand

Plot three matching matrices x,y,z as a 3D wireframe with axes. See matrixplot3d for caveats and description; this plot is the same but instead of using implicit r,c values of the matrix, allows them to be specified directly, thus plotting a series of 3D points.

param Number file_dpi (allow_None=False, bounds=(0, None), constant=False, default=100.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Default DPI when rendering to a bitmap. The nominal size * the dpi gives the final image size in pixels. E.g.: 4”x4” image * 80 dpi ==> 320x320 pixel image.
param String title (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional title to be used when displaying the plot interactively.
param String file_format (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=png, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Which image format to use when saving images. The output can be png, ps, pdf, svg, or any other format supported by Matplotlib.
param String filename (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional base of the filename to use when saving images; if None the plot will be displayed interactively. The actual name is constructed from the filename base plus the suffix plus the current simulator time plus the file_format.
param String filename_suffix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional suffix to be used for disambiguation of the filename.
param Boolean display_window (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to open a display window containing the plot when Topographica is running in a non-batch mode.
debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07ac61af18>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07ac786050>
inspect_value = <functools.partial object at 0x2b07ac786100>
instance = <functools.partial object at 0x2b07ac786158>
message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07ac786208>
set_param = <functools.partial object at 0x2b07ac786260>
state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

topo.command.pylabplot.plot_coord_mapping(mapper, sheet, style='b-')[source]

Plot a coordinate mapping for a sheet.

Given a CoordinateMapperFn (as for a CFProjection) and a sheet of the projection, plot a grid showing where the sheet’s units are mapped.

topo.command.pylabplot.cyclic_tuning_curve

alias of tuning_curve

topo.command.pylabplot.fft2(a, s=None, axes=(-2, -1))

Compute the 2-dimensional discrete Fourier Transform

This function computes the n-dimensional discrete Fourier Transform over any axes in an M-dimensional array by means of the Fast Fourier Transform (FFT). By default, the transform is computed over the last two axes of the input array, i.e., a 2-dimensional FFT.

a : array_like
Input array, can be complex
s : sequence of ints, optional
Shape (length of each transformed axis) of the output (s[0] refers to axis 0, s[1] to axis 1, etc.). This corresponds to n for fft(x, n). Along each axis, if the given shape is smaller than that of the input, the input is cropped. If it is larger, the input is padded with zeros. if s is not given, the shape of the input along the axes specified by axes is used.
axes : sequence of ints, optional
Axes over which to compute the FFT. If not given, the last two axes are used. A repeated index in axes means the transform over that axis is performed multiple times. A one-element sequence means that a one-dimensional FFT is performed.
out : complex ndarray
The truncated or zero-padded input, transformed along the axes indicated by axes, or the last two axes if axes is not given.
ValueError
If s and axes have different length, or axes not given and len(s) != 2.
IndexError
If an element of axes is larger than than the number of axes of a.
numpy.fft : Overall view of discrete Fourier transforms, with definitions
and conventions used.

ifft2 : The inverse two-dimensional FFT. fft : The one-dimensional FFT. fftn : The n-dimensional FFT. fftshift : Shifts zero-frequency terms to the center of the array.

For two-dimensional input, swaps first and third quadrants, and second and fourth quadrants.

fft2 is just fftn with a different default for axes.

The output, analogously to fft, contains the term for zero frequency in the low-order corner of the transformed axes, the positive frequency terms in the first half of these axes, the term for the Nyquist frequency in the middle of the axes and the negative frequency terms in the second half of the axes, in order of decreasingly negative frequency.

See fftn for details and a plotting example, and numpy.fft for definitions and conventions used.

>>> a = np.mgrid[:5, :5][0]
>>> np.fft.fft2(a)
array([[ 50.0 +0.j        ,   0.0 +0.j        ,   0.0 +0.j        ,
          0.0 +0.j        ,   0.0 +0.j        ],
       [-12.5+17.20477401j,   0.0 +0.j        ,   0.0 +0.j        ,
          0.0 +0.j        ,   0.0 +0.j        ],
       [-12.5 +4.0614962j ,   0.0 +0.j        ,   0.0 +0.j        ,
          0.0 +0.j        ,   0.0 +0.j        ],
       [-12.5 -4.0614962j ,   0.0 +0.j        ,   0.0 +0.j        ,
            0.0 +0.j        ,   0.0 +0.j        ],
       [-12.5-17.20477401j,   0.0 +0.j        ,   0.0 +0.j        ,
          0.0 +0.j        ,   0.0 +0.j        ]])
class topo.command.pylabplot.matrixplot3d(**params)[source]

Bases: topo.command.pylabplot.PylabPlotCommand

Simple plotting for any matrix as a 3D wireframe with axes.

Uses Matplotlib’s beta-quality features for 3D plotting. These usually work fine for wireframe plots, although they don’t always format the axis labels properly, and do not support removal of hidden lines. Note that often the plot can be rotated within the window to make such problems go away, and then the best result can be saved if needed.

Other than the default “wireframe”, the type can be “contour” to get a contour plot, or “surface” to get a solid surface plot, but surface plots currently fail in many cases, e.g. for small matrices.

If you have trouble, you can try matrixplot3d_gnuplot instead.

param Number file_dpi (allow_None=False, bounds=(0, None), constant=False, default=100.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Default DPI when rendering to a bitmap. The nominal size * the dpi gives the final image size in pixels. E.g.: 4”x4” image * 80 dpi ==> 320x320 pixel image.
param String title (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional title to be used when displaying the plot interactively.
param String file_format (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=png, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Which image format to use when saving images. The output can be png, ps, pdf, svg, or any other format supported by Matplotlib.
param String filename (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional base of the filename to use when saving images; if None the plot will be displayed interactively. The actual name is constructed from the filename base plus the suffix plus the current simulator time plus the file_format.
param String filename_suffix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional suffix to be used for disambiguation of the filename.
param Boolean display_window (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to open a display window containing the plot when Topographica is running in a non-batch mode.
debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07ac793158>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07ac793100>
inspect_value = <functools.partial object at 0x2b07ac793208>
instance = <functools.partial object at 0x2b07ac793260>
message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07ac793310>
set_param = <functools.partial object at 0x2b07ac793368>
state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

class topo.command.pylabplot.gradientplot(**params)[source]

Bases: topo.command.pylabplot.matrixplot

Compute and show the gradient plot of the supplied data. Translated from Octave code originally written by Yoonsuck Choe.

If the data is specified to be cyclic, negative differences will be wrapped into the range specified (1.0 by default).

param Parameter extent (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Subregion of the matrix to plot, as a tuple (l,b,r,t).
param Callable plot_type (allow_None=False, constant=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Matplotlib command to generate the plot, e.g. plt.gray or plt.hsv.
param Number file_dpi (allow_None=False, bounds=(0, None), constant=False, default=100.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Default DPI when rendering to a bitmap. The nominal size * the dpi gives the final image size in pixels. E.g.: 4”x4” image * 80 dpi ==> 320x320 pixel image.
param String title (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional title to be used when displaying the plot interactively.
param String file_format (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=png, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Which image format to use when saving images. The output can be png, ps, pdf, svg, or any other format supported by Matplotlib.
param String filename (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional base of the filename to use when saving images; if None the plot will be displayed interactively. The actual name is constructed from the filename base plus the suffix plus the current simulator time plus the file_format.
param String filename_suffix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional suffix to be used for disambiguation of the filename.
param Boolean display_window (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to open a display window containing the plot when Topographica is running in a non-batch mode.
debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07ac793158>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07ac793100>
inspect_value = <functools.partial object at 0x2b07ac793208>
instance = <functools.partial object at 0x2b07ac793260>
message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

static plot_type()

set the default colormap to gray and apply to current image if any. See help(colormaps) for more information

pprint(imports=None, prefix='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07ac793310>
set_param = <functools.partial object at 0x2b07ac793368>
state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

topo.command.pylabplot.plot_cfproj_mapping(dest, proj='Afferent', style='b-')[source]

Given a CF sheet receiving a CFProjection, plot the mapping of the dests CF centers on the src sheet.

class topo.command.pylabplot.Command(**params)

Bases: param.parameterized.ParameterizedFunction

Parameterized command: any error when the command is run (called) will not raise an exception, but will instead generate a warning.

debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07ac7a71b0>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07ac7a7158>
inspect_value = <functools.partial object at 0x2b07ac7a7208>
instance = <functools.partial object at 0x2b07ac7a7100>
message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07ac7a7260>
set_param = <functools.partial object at 0x2b07ac7a7368>
state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

class topo.command.pylabplot.overlaid_plot(**params)[source]

Bases: topo.command.pylabplot.PylabPlotCommand

Use matplotlib to make a plot combining a bitmap and line-based overlays for a single plot template and sheet.

param Boolean normalize (allow_None=False, bounds=(0, 1), constant=False, default=Individually, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Type of normalization, if any, to use. Options include ‘None’, ‘Individually’, and ‘AllTogether’. See topo.plotting.plotgroup.TemplatePlotGroup.normalize for more details.
param Dict plot_template (allow_None=False, constant=False, default={‘Hue’: ‘OrientationPreference’}, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Template for the underlying bitmap plot.
param ClassSelector sheet (allow_None=True, constant=False, default=None, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
The sheet from which sheetViews are to be obtained for plotting.
param Number file_dpi (allow_None=False, bounds=(0, None), constant=False, default=100.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Default DPI when rendering to a bitmap. The nominal size * the dpi gives the final image size in pixels. E.g.: 4”x4” image * 80 dpi ==> 320x320 pixel image.
param String title (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional title to be used when displaying the plot interactively.
param String file_format (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=png, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Which image format to use when saving images. The output can be png, ps, pdf, svg, or any other format supported by Matplotlib.
param List overlay (allow_None=False, bounds=(0, None), constant=False, default=[(‘contours’, ‘OcularPreference’, 0.5, ‘black’), (‘arrows’, ‘DirectionPreference’, ‘DirectionSelectivity’, ‘white’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
List of overlaid plots, where each list item may be a 4-tuple specifying either a contour line or a field of arrows:: (‘contours’,map-name,contour-value,line-color) (‘arrows’,arrow-location-map-name,arrow-size-map-name,arrow-color) Any number or combination of contours and arrows may be supplied.
param String filename (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional base of the filename to use when saving images; if None the plot will be displayed interactively. The actual name is constructed from the filename base plus the suffix plus the current simulator time plus the file_format.
param String filename_suffix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional suffix to be used for disambiguation of the filename.
param Boolean display_window (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to open a display window containing the plot when Topographica is running in a non-batch mode.
debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07ac7a7100>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07ac7a7260>
inspect_value = <functools.partial object at 0x2b07ac7a7368>
instance = <functools.partial object at 0x2b07ac7a7050>
message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07ac7a72b8>
set_param = <functools.partial object at 0x2b07ac7a73c0>
state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

topo.command.pylabplot.make_template_plot(channels, sheet_views, density=None, plot_bounding_box=None, normalize='None', name='None', range_=False)

Factory function for constructing a Plot object whose type is not yet known.

Typically, a TemplatePlot will be constructed through this call, because it selects the appropriate type automatically, rather than calling one of the Plot subclasses automatically. See TemplatePlot.__init__ for a description of the arguments.

class topo.command.pylabplot.vectorplot(**params)[source]

Bases: topo.command.pylabplot.PylabPlotCommand

Simple line plotting for any vector or list of numbers.

Intended for interactive debugging or analyzing from the command prompt. See MatPlotLib’s pylab functions to create more elaborate or customized plots; this is just a simple example.

An optional string can be supplied as a title for the figure, if desired. At present, this is only used for the window, not the actual body of the figure (and will thus not appear when the figure is saved).

The style argument allows different line/linespoints style for the plot: ‘r-‘ for red solid line, ‘bx’ for blue x-marks, etc. See http://matplotlib.sourceforge.net/matplotlib.pylab.html#-plot for more possibilities.

The label argument can be used to identify the line in a figure legend.

Ordinarily, the x value for each point on the line is the index of that point in the vec array, but a explicit list of xvalues can be supplied; it should be the same length as vec.

Execution of multiple vectorplot() commands with different styles will result in all those styles overlaid on a single plot window.

param Number file_dpi (allow_None=False, bounds=(0, None), constant=False, default=100.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Default DPI when rendering to a bitmap. The nominal size * the dpi gives the final image size in pixels. E.g.: 4”x4” image * 80 dpi ==> 320x320 pixel image.
param String title (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional title to be used when displaying the plot interactively.
param String file_format (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=png, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Which image format to use when saving images. The output can be png, ps, pdf, svg, or any other format supported by Matplotlib.
param String filename (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional base of the filename to use when saving images; if None the plot will be displayed interactively. The actual name is constructed from the filename base plus the suffix plus the current simulator time plus the file_format.
param String filename_suffix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional suffix to be used for disambiguation of the filename.
param Boolean display_window (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to open a display window containing the plot when Topographica is running in a non-batch mode.
debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07ac7b6158>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07ac7b61b0>
inspect_value = <functools.partial object at 0x2b07ac7b6260>
instance = <functools.partial object at 0x2b07ac7b6208>
message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07ac7b6310>
set_param = <functools.partial object at 0x2b07ac7b6368>
state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

class topo.command.pylabplot.topographic_grid(**params)[source]

Bases: topo.command.pylabplot.xy_grid

By default, plot the XPreference and YPreference preferences for all Sheets for which they are defined, using MatPlotLib.

If sheet_views other than XPreference and YPreference are desired, the names of these can be passed in as arguments.

param String ysheet_view_name (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=YPreference, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Name of the Image holding the Y position locations.
param Number file_dpi (allow_None=False, bounds=(0, None), constant=False, default=100.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Default DPI when rendering to a bitmap. The nominal size * the dpi gives the final image size in pixels. E.g.: 4”x4” image * 80 dpi ==> 320x320 pixel image.
param String title (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional title to be used when displaying the plot interactively.
param Integer skip (allow_None=False, bounds=[1, None], constant=False, default=1, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Plot every skipth line in each direction. E.g. skip=4 means to keep only every fourth horizontal line and every fourth vertical line, except that the first and last are always included. The default is to include all data points.
param String file_format (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=png, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Which image format to use when saving images. The output can be png, ps, pdf, svg, or any other format supported by Matplotlib.
param String filename (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional base of the filename to use when saving images; if None the plot will be displayed interactively. The actual name is constructed from the filename base plus the suffix plus the current simulator time plus the file_format.
param String filename_suffix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional suffix to be used for disambiguation of the filename.
param Boolean display_window (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to open a display window containing the plot when Topographica is running in a non-batch mode.
param Array y (allow_None=True, constant=True, default=None, instantiate=True, is_instance=True, pickle_default_value=True, precedence=-1, readonly=False)
Numpy array of y positions in the grid.
param Array x (allow_None=True, constant=True, default=None, instantiate=True, is_instance=True, pickle_default_value=True, precedence=-1, readonly=False)
Numpy array of x positions in the grid.
param String xsheet_view_name (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=XPreference, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Name of the Image holding the X position locations.
param Parameter axis (allow_None=False, constant=False, default=[-0.5, 0.5, -0.5, 0.5], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Four-element list of the plot bounds, i.e. [xmin, xmax, ymin, ymax].
debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07ac7be158>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07ac7be208>
inspect_value = <functools.partial object at 0x2b07ac7be260>
instance = <functools.partial object at 0x2b07ac7be2b8>
message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07ac7be1b0>
set_param = <functools.partial object at 0x2b07ac7be3c0>
state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

class topo.command.pylabplot.autocorrelationplot(**params)[source]

Bases: topo.command.pylabplot.matrixplot

Compute and show the 2D autocorrelation of the supplied data. Requires the external SciPy package.

Example:: autocorrelationplot(topo.sim[“V1”].views.Maps[“OrientationPreference”].data,filename=”out”)

param Parameter extent (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Subregion of the matrix to plot, as a tuple (l,b,r,t).
param Callable plot_type (allow_None=False, constant=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Matplotlib command to generate the plot, e.g. plt.gray or plt.hsv.
param Number file_dpi (allow_None=False, bounds=(0, None), constant=False, default=100.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Default DPI when rendering to a bitmap. The nominal size * the dpi gives the final image size in pixels. E.g.: 4”x4” image * 80 dpi ==> 320x320 pixel image.
param String title (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional title to be used when displaying the plot interactively.
param String file_format (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=png, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Which image format to use when saving images. The output can be png, ps, pdf, svg, or any other format supported by Matplotlib.
param String filename (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional base of the filename to use when saving images; if None the plot will be displayed interactively. The actual name is constructed from the filename base plus the suffix plus the current simulator time plus the file_format.
param String filename_suffix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional suffix to be used for disambiguation of the filename.
param Boolean display_window (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to open a display window containing the plot when Topographica is running in a non-batch mode.
debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07ac7be3c0>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07ac7be1b0>
inspect_value = <functools.partial object at 0x2b07ac7be050>
instance = <functools.partial object at 0x2b07ac7be0a8>
message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

static plot_type()

set the default colormap to autumn and apply to current image if any. See help(colormaps) for more information

pprint(imports=None, prefix='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07ac7be100>
set_param = <functools.partial object at 0x2b07ac7be418>
state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

class topo.command.pylabplot.normalize_path(**params)

Bases: param.parameterized.ParameterizedFunction

params(prefix=String, name=String)

Convert a UNIX-style path to the current OS’s format, typically for creating a new file or directory.

If the path is not already absolute, it will be made absolute (using the prefix parameter).

Should do the same as Python’s os.path.abspath(), except using prefix rather than os.getcwd).

 Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Mode 

prefix ‘/var/lib/buildbot/slaves/topographic... String V RW

Parameter docstrings: =====================

prefix: Prepended to the specified path, if that path is not  absolute.

param String prefix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=/var/lib/buildbot/slaves/topographica_docs/build/doc, instantiate=False, pickle_default_value=False, precedence=None, readonly=False)
Prepended to the specified path, if that path is not absolute.
debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07ac7cf1b0>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07ac7cf158>
inspect_value = <functools.partial object at 0x2b07ac7cf260>
instance = <functools.partial object at 0x2b07ac7cf2b8>
message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07ac7cf368>
set_param = <functools.partial object at 0x2b07ac7cf3c0>
state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

class topo.command.pylabplot.ParameterizedFunction(**params)

Bases: param.parameterized.Parameterized

params(name=String)

Acts like a Python function, but with arguments that are Parameters.

Implemented as a subclass of Parameterized that, when instantiated, automatically invokes __call__ and returns the result, instead of returning an instance of the class.

To obtain an instance of this class, call instance().

 Object has no parameters.

debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07ac7d32b8>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07ac7d33c0>
inspect_value = <functools.partial object at 0x2b07ac7d3418>
instance = <functools.partial object at 0x2b07ac7d34c8>
message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07ac7d3890>
set_param = <functools.partial object at 0x2b07ac7d38e8>
state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

class topo.command.pylabplot.activityplot(**params)[source]

Bases: topo.command.pylabplot.matrixplot

Plots the activity in a sheet with axis labels in Sheet (not matrix) coordinates.

Same as matrixplot, but only for matrices associated with a Sheet. By default plots the Sheet’s activity, but any other matrix of the same size may be supplied for plotting in these coordinates instead.

param Parameter extent (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Subregion of the matrix to plot, as a tuple (l,b,r,t).
param Callable plot_type (allow_None=False, constant=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Matplotlib command to generate the plot, e.g. plt.gray or plt.hsv.
param Number file_dpi (allow_None=False, bounds=(0, None), constant=False, default=100.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Default DPI when rendering to a bitmap. The nominal size * the dpi gives the final image size in pixels. E.g.: 4”x4” image * 80 dpi ==> 320x320 pixel image.
param String title (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional title to be used when displaying the plot interactively.
param String file_format (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=png, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Which image format to use when saving images. The output can be png, ps, pdf, svg, or any other format supported by Matplotlib.
param String filename (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional base of the filename to use when saving images; if None the plot will be displayed interactively. The actual name is constructed from the filename base plus the suffix plus the current simulator time plus the file_format.
param String filename_suffix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional suffix to be used for disambiguation of the filename.
param Boolean display_window (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to open a display window containing the plot when Topographica is running in a non-batch mode.
debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07ac7d3208>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07ac7d31b0>
inspect_value = <functools.partial object at 0x2b07ac7d32b8>
instance = <functools.partial object at 0x2b07ac7d3310>
message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

static plot_type()

set the default colormap to gray and apply to current image if any. See help(colormaps) for more information

pprint(imports=None, prefix='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07ac7d33c0>
set_param = <functools.partial object at 0x2b07ac7d3418>
state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

class topo.command.pylabplot.matrixplot(**params)[source]

Bases: topo.command.pylabplot.PylabPlotCommand

Simple plotting for any matrix as a bitmap with axes.

Like MatLab’s imagesc, scales the values to fit in the range 0 to 1.0. Intended for interactive debugging or analyzing from the command prompt. See MatPlotLib’s pylab functions to create more elaborate or customized plots; this is just a simple example.

param Parameter extent (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Subregion of the matrix to plot, as a tuple (l,b,r,t).
param Callable plot_type (allow_None=False, constant=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Matplotlib command to generate the plot, e.g. plt.gray or plt.hsv.
param Number file_dpi (allow_None=False, bounds=(0, None), constant=False, default=100.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Default DPI when rendering to a bitmap. The nominal size * the dpi gives the final image size in pixels. E.g.: 4”x4” image * 80 dpi ==> 320x320 pixel image.
param String title (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional title to be used when displaying the plot interactively.
param String file_format (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=png, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Which image format to use when saving images. The output can be png, ps, pdf, svg, or any other format supported by Matplotlib.
param String filename (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional base of the filename to use when saving images; if None the plot will be displayed interactively. The actual name is constructed from the filename base plus the suffix plus the current simulator time plus the file_format.
param String filename_suffix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional suffix to be used for disambiguation of the filename.
param Boolean display_window (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to open a display window containing the plot when Topographica is running in a non-batch mode.
debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07ac7df1b0>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07ac7df208>
inspect_value = <functools.partial object at 0x2b07ac7df2b8>
instance = <functools.partial object at 0x2b07ac7df260>
message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

static plot_type()

set the default colormap to gray and apply to current image if any. See help(colormaps) for more information

pprint(imports=None, prefix='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07ac7df368>
set_param = <functools.partial object at 0x2b07ac7df3c0>
state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

class topo.command.pylabplot.overlaid_plots(**params)[source]

Bases: topo.command.pylabplot.overlaid_plot

Use matplotlib to make a plot combining a bitmap and line-based overlays.

param Boolean normalize (allow_None=False, bounds=(0, 1), constant=False, default=Individually, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Type of normalization, if any, to use. Options include ‘None’, ‘Individually’, and ‘AllTogether’. See topo.plotting.plotgroup.TemplatePlotGroup.normalize for more details.
param List plot_template (allow_None=False, bounds=(0, None), constant=False, default=[{‘Hue’: ‘OrientationPreference’}], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Template for the underlying bitmap plot.
param ClassSelector sheet (allow_None=True, constant=True, default=None, instantiate=True, is_instance=True, pickle_default_value=True, precedence=-1, readonly=False)
The sheet from which sheetViews are to be obtained for plotting.
param Number file_dpi (allow_None=False, bounds=(0, None), constant=False, default=100.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Default DPI when rendering to a bitmap. The nominal size * the dpi gives the final image size in pixels. E.g.: 4”x4” image * 80 dpi ==> 320x320 pixel image.
param String title (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional title to be used when displaying the plot interactively.
param String file_format (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=png, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Which image format to use when saving images. The output can be png, ps, pdf, svg, or any other format supported by Matplotlib.
param List overlay (allow_None=False, bounds=(0, None), constant=False, default=[(‘contours’, ‘OcularPreference’, 0.5, ‘black’), (‘arrows’, ‘DirectionPreference’, ‘DirectionSelectivity’, ‘white’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
List of overlaid plots, where each list item may be a 4-tuple specifying either a contour line or a field of arrows:: (‘contours’,map-name,contour-value,line-color) (‘arrows’,arrow-location-map-name,arrow-size-map-name,arrow-color) Any number or combination of contours and arrows may be supplied.
param String filename (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional base of the filename to use when saving images; if None the plot will be displayed interactively. The actual name is constructed from the filename base plus the suffix plus the current simulator time plus the file_format.
param String filename_suffix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional suffix to be used for disambiguation of the filename.
param Boolean display_window (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to open a display window containing the plot when Topographica is running in a non-batch mode.
debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07ac7df1b0>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07ac7df208>
inspect_value = <functools.partial object at 0x2b07ac7df2b8>
instance = <functools.partial object at 0x2b07ac7df310>
message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07ac7df3c0>
set_param = <functools.partial object at 0x2b07ac7df418>
state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

class topo.command.pylabplot.tuning_curve(**params)[source]

Bases: topo.command.pylabplot.PylabPlotCommand

Plot a tuning curve for a feature, such as orientation, contrast, or size.

The curve datapoints are collected from the curve_dict for the units at the specified coordinates in the specified sheet (where the units and sheet may be set by a GUI, using topo.analysis.featureresponses.UnitCurveCommand.sheet and topo.analysis.featureresponses.UnitCurveCommand.coords, or by hand).

param ObjectSelector sheet (allow_None=None, check_on_set=False, compute_default_fn=None, constant=False, default=None, instantiate=False, objects=[], pickle_default_value=True, precedence=None, readonly=False)
Name of the sheet to use in measurements.
param Number file_dpi (allow_None=False, bounds=(0, None), constant=False, default=100.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Default DPI when rendering to a bitmap. The nominal size * the dpi gives the final image size in pixels. E.g.: 4”x4” image * 80 dpi ==> 320x320 pixel image.
param String title (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional title to be used when displaying the plot interactively.
param String x_axis (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Feature to plot on the x axis of the tuning curve
param String file_format (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=png, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Which image format to use when saving images. The output can be png, ps, pdf, svg, or any other format supported by Matplotlib.

param NumericTuple coord (allow_None=False, constant=True, default=(0, 0), instantiate=True, length=2, pickle_default_value=True, precedence=-1, readonly=False)

param String filename (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional base of the filename to use when saving images; if None the plot will be displayed interactively. The actual name is constructed from the filename base plus the suffix plus the current simulator time plus the file_format.
param Boolean relative_labels (allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Relabel the x-axis with values relative to the preferred.
param List group_by (allow_None=False, bounds=(0, None), constant=False, default=[‘Contrast’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Feature dimensions for which curves are overlaid.
param List coords (allow_None=False, bounds=(0, None), constant=False, default=[(0, 0)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
List of coordinates of units to measure.
param String filename_suffix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional suffix to be used for disambiguation of the filename.
param Boolean display_window (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to open a display window containing the plot when Topographica is running in a non-batch mode.
param Boolean legend (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether or not to include a legend in the plot.
param Boolean center (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Centers the tuning curve around the maximally responding feature.
debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07ac7ea1b0>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07ac7ea2b8>
inspect_value = <functools.partial object at 0x2b07ac7ea208>
instance = <functools.partial object at 0x2b07ac7ea368>
message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07ac7ea3c0>
set_param = <functools.partial object at 0x2b07ac7ea470>
state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

class topo.command.pylabplot.histogramplot(**params)[source]

Bases: topo.command.pylabplot.PylabPlotCommand

Compute and plot the histogram of the supplied data.

See help(plt.hist) for help on the histogram function itself.

If given, colors is an iterable collection of matplotlib.colors (see help (matplotlib.colors) ) specifying the bar colors.

Example use:
histogramplot([1,1,1,2,2,3,4,5],title=’hist’,colors=’rgb’,bins=3,normed=1)
param Number file_dpi (allow_None=False, bounds=(0, None), constant=False, default=100.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Default DPI when rendering to a bitmap. The nominal size * the dpi gives the final image size in pixels. E.g.: 4”x4” image * 80 dpi ==> 320x320 pixel image.
param String title (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional title to be used when displaying the plot interactively.
param String file_format (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=png, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Which image format to use when saving images. The output can be png, ps, pdf, svg, or any other format supported by Matplotlib.
param String filename (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional base of the filename to use when saving images; if None the plot will be displayed interactively. The actual name is constructed from the filename base plus the suffix plus the current simulator time plus the file_format.
param String filename_suffix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional suffix to be used for disambiguation of the filename.
param Boolean display_window (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to open a display window containing the plot when Topographica is running in a non-batch mode.
debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07ac7f2260>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07ac7f21b0>
inspect_value = <functools.partial object at 0x2b07ac7f22b8>
instance = <functools.partial object at 0x2b07ac7f2310>
message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07ac7f23c0>
set_param = <functools.partial object at 0x2b07ac7f2418>
state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

class topo.command.pylabplot.PylabPlotCommand(**params)[source]

Bases: topo.command.Command

Parameterized command for plotting using Matplotlib/Pylab.

param Number file_dpi (allow_None=False, bounds=(0, None), constant=False, default=100.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Default DPI when rendering to a bitmap. The nominal size * the dpi gives the final image size in pixels. E.g.: 4”x4” image * 80 dpi ==> 320x320 pixel image.
param String title (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional title to be used when displaying the plot interactively.
param String file_format (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=png, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Which image format to use when saving images. The output can be png, ps, pdf, svg, or any other format supported by Matplotlib.
param String filename (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional base of the filename to use when saving images; if None the plot will be displayed interactively. The actual name is constructed from the filename base plus the suffix plus the current simulator time plus the file_format.
param String filename_suffix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional suffix to be used for disambiguation of the filename.
param Boolean display_window (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to open a display window containing the plot when Topographica is running in a non-batch mode.
debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07ac7fa208>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07ac7fa1b0>
inspect_value = <functools.partial object at 0x2b07ac7fa2b8>
instance = <functools.partial object at 0x2b07ac7fa310>
message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07ac7fa260>
set_param = <functools.partial object at 0x2b07ac7fa418>
state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.