Topographica plotting subsystem.
Two-dimensional plots are generated by generic classes for visualizing Sheets in any model. The plots are often viewed in a GUI, but they can potentially also be rendered to bitmapped images to save as files, or to display on other types of interfaces such as web servers.
The usual way that a plot is specified is using a PlotGroupTemplate, which specifies a group of related plots. A PlotGroupTemplate is a list of PlotTemplates. Each PlotTemplate will normally produce up to one plot per Sheet in the network, though in special cases it can produce more. The definitions for each of these templates can be done in advance of defining any particular model, and rarely require any editing for any particular model.
For more information, see the various modules in this package.
Topographica Bitmap Class.
Encapsulates the PIL Image class so that an input matrix can be displayed as a bitmap image without needing to know about PIL proper.
There are three different base image Classes which inherit Bitmap:
PaletteBitmap - 1 2D Matrix, 1 1D Color Map HSVBitmap - 3 2D Matrices, Color (H), Confidence (S), Strength (V) RGBBitmap - 3 2D Matrices, Red, Green, Blue Channels.
All maps are assumed to be on a nominal range of 0.0 to 1.0. Matrices are passed in as part of the constructor and the image is generaed. For more information, see the documentation for each of the Bitmap classes.
The encapsulated PIL Image is accessible through the .bitmap attribute.
Bases: param.parameterized.Parameterized
Wrapper class for the PIL Image class.
The main purpose for this base class is to provide a consistent interface for defining bitmaps constructed in various different ways. The resulting bitmap is a PIL Image object that can be accessed using the normal PIL interface.
If subclasses use the _arrayToImage() function provided, any pixels larger than the maximum that can be displayed will be counted before they are clipped; these are stored in the clipped_pixels attribute.
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: topo.plotting.bitmap.Bitmap
Bitmap constructed using a single 2D array.
The image is monochrome by default, but more colorful images can be constructed by specifying a Palette.
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Renaming of Image.show() for the Bitmap.bitmap attribute.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Return a resized Image object, given the input ‘factor’ parameter. 1.0 is the same size, 2.0 is doubling the height and width, 0.5 is 1/2 the original size. The original Image is not changed.
Bases: topo.plotting.bitmap.Bitmap
Bitmap constructed from 3 2D arrays, for hue, saturation, and value.
The hue matrix determines the pixel colors. The saturation matrix determines how strongly the pixels are saturated for each hue, i.e. how colorful the pixels appear. The value matrix determines how bright each pixel is.
An RGB image is constructed from the HSV matrices using hsv_to_rgb; the resulting image is of the same type that is constructed by RGBBitmap, and can be used in the same way.
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Renaming of Image.show() for the Bitmap.bitmap attribute.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Return a resized Image object, given the input ‘factor’ parameter. 1.0 is the same size, 2.0 is doubling the height and width, 0.5 is 1/2 the original size. The original Image is not changed.
Bases: topo.plotting.bitmap.Bitmap
Bitmap constructed from three 2D arrays, for red, green, and blue.
Each matrix is used as the corresponding channel of an RGB image.
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Renaming of Image.show() for the Bitmap.bitmap attribute.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Return a resized Image object, given the input ‘factor’ parameter. 1.0 is the same size, 2.0 is doubling the height and width, 0.5 is 1/2 the original size. The original Image is not changed.
Bases: topo.plotting.bitmap.Bitmap
A bitmap composed of tiles containing other bitmaps.
Bitmaps are scaled to fit in the given tile size, and tiled right-to-left, top-to-bottom into the given number of rows and columns.
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Renaming of Image.show() for the Bitmap.bitmap attribute.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Return a resized Image object, given the input ‘factor’ parameter. 1.0 is the same size, 2.0 is doubling the height and width, 0.5 is 1/2 the original size. The original Image is not changed.
Bases: topo.plotting.bitmap.Bitmap
Bitmap with primitives drawn for each unit The input matrix has a list of primitives and relative arguments for each unit.
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Renaming of Image.show() for the Bitmap.bitmap attribute.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Return a resized Image object, given the input ‘factor’ parameter. 1.0 is the same size, 2.0 is doubling the height and width, 0.5 is 1/2 the original size. The original Image is not changed.
Plot class.
Bases: topo.plotting.plot.TemplatePlot
Bitmap plot with oriented lines draws for every units, representing the most preferred orientations. Constructs a matrix of drawing directives displaying oriented lines in each unit, colored according to the order or preference, and selectivity This plot expects channels named “OrX” “SelX”, with “X” the number ranking the preferred orientations.
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Return a label for this plot.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Change the size of this image by the specified numerical factor.
The original image is kept as-is in _orig_bitmap; the scaled image is stored in bitmap. The scale_factor argument is taken as relative to the current scaling of the bitmap. For instance, calling scale(1.5) followed by scale(2.0) will yield a final scale of 3.0, not 2.0.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Specify the numerical value of the scaling factor for this image.
The original image is kept as-is in _orig_bitmap; the scaled image is stored in bitmap. The scale_factor argument is taken as relative to the original size of the bitmap. For instance, calling scale(1.5) followed by scale(2.0) will yield a final scale of 2.0, not 3.0.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: topo.plotting.plot.TemplatePlot
Bitmap plot based on a Strength matrix, with optional colorization.
Not yet implemented.
When implemented, construct an RGB plot from a Strength channel, optionally colorized using a specified Palette.
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Return a label for this plot.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Change the size of this image by the specified numerical factor.
The original image is kept as-is in _orig_bitmap; the scaled image is stored in bitmap. The scale_factor argument is taken as relative to the current scaling of the bitmap. For instance, calling scale(1.5) followed by scale(2.0) will yield a final scale of 3.0, not 2.0.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Specify the numerical value of the scaling factor for this image.
The original image is kept as-is in _orig_bitmap; the scaled image is stored in bitmap. The scale_factor argument is taken as relative to the original size of the bitmap. For instance, calling scale(1.5) followed by scale(2.0) will yield a final scale of 2.0, not 3.0.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: param.parameterized.Parameterized
Simple Plot object constructed from a specified PIL image.
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Change the size of this image by the specified numerical factor.
The original image is kept as-is in _orig_bitmap; the scaled image is stored in bitmap. The scale_factor argument is taken as relative to the current scaling of the bitmap. For instance, calling scale(1.5) followed by scale(2.0) will yield a final scale of 3.0, not 2.0.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Specify the numerical value of the scaling factor for this image.
The original image is kept as-is in _orig_bitmap; the scaled image is stored in bitmap. The scale_factor argument is taken as relative to the original size of the bitmap. For instance, calling scale(1.5) followed by scale(2.0) will yield a final scale of 2.0, not 3.0.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: topo.plotting.plot.TemplatePlot
Bitmap plot based on Red, Green, and Blue matrices.
Construct an RGB (red, green, and blue) plot from the Red, Green, and Blue channels.
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Return a label for this plot.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Change the size of this image by the specified numerical factor.
The original image is kept as-is in _orig_bitmap; the scaled image is stored in bitmap. The scale_factor argument is taken as relative to the current scaling of the bitmap. For instance, calling scale(1.5) followed by scale(2.0) will yield a final scale of 3.0, not 2.0.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Specify the numerical value of the scaling factor for this image.
The original image is kept as-is in _orig_bitmap; the scaled image is stored in bitmap. The scale_factor argument is taken as relative to the original size of the bitmap. For instance, calling scale(1.5) followed by scale(2.0) will yield a final scale of 2.0, not 3.0.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: topo.plotting.plot.TemplatePlot
Bitmap plot based on Strength, Hue, and Confidence matrices.
Constructs an HSV (hue, saturation, and value) plot by choosing the appropriate matrix for each channel.
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Return a label for this plot.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Change the size of this image by the specified numerical factor.
The original image is kept as-is in _orig_bitmap; the scaled image is stored in bitmap. The scale_factor argument is taken as relative to the current scaling of the bitmap. For instance, calling scale(1.5) followed by scale(2.0) will yield a final scale of 3.0, not 2.0.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Specify the numerical value of the scaling factor for this image.
The original image is kept as-is in _orig_bitmap; the scaled image is stored in bitmap. The scale_factor argument is taken as relative to the original size of the bitmap. For instance, calling scale(1.5) followed by scale(2.0) will yield a final scale of 2.0, not 3.0.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: topo.plotting.plot.Plot
A bitmap-based plot as specified by a plot template (or plot channels).
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Return a label for this plot.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Change the size of this image by the specified numerical factor.
The original image is kept as-is in _orig_bitmap; the scaled image is stored in bitmap. The scale_factor argument is taken as relative to the current scaling of the bitmap. For instance, calling scale(1.5) followed by scale(2.0) will yield a final scale of 3.0, not 2.0.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Specify the numerical value of the scaling factor for this image.
The original image is kept as-is in _orig_bitmap; the scaled image is stored in bitmap. The scale_factor argument is taken as relative to the original size of the bitmap. For instance, calling scale(1.5) followed by scale(2.0) will yield a final scale of 2.0, not 3.0.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
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.
File saving routines for plots.
Typically called using save_plotgroup in commands/analysis.py, but these objects can also be instantiated explicitly, to save a series of plots.
Bases: topo.plotting.plotfilesaver.PlotGroupSaver
Allows a CFProjectionPlotGroup to be saved as a bitmap file, concatenating all the CF plots into a single image.
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
Calculate a specific filename from the filename_format.
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.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the most recently saved state.
See state_push() for more details.
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.
Strip inappropriate characters from a filename.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: param.parameterized.Parameterized
Allows a PlotGroup to be saved as a set of bitmap files on disk.
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Make a contact sheet (image grid) from a 2D array of PIL images:
imgs 2D array of images
marl The left margin in pixels
mart The top margin in pixels
marr The right margin in pixels
marb The bottom margin in pixels
padding The padding between images in pixels
Returns a PIL image object.
Hierarchy of PlotGroup classes, i.e. output-device-independent sets of plots.
Includes PlotGroups for standard plots of anything in a Sheet database, plus weight plots for one unit, and projections.
Bases: topo.plotting.plotgroup.ProjectionPlotGroup
Visualize one CFProjection.
Construct a static image Plot (e.g. a color key for an Orientation Preference map).
Calculate the grid layout of the plots from their precedences and row_precedences. Returns a list of triples (row, col, plot).
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
Evenly space out the units within the sheet bounding box, so that it doesn’t matter which corner the measurements start from. A 4 unit grid needs 5 segments. List is in left-to-right, from top-to-bottom.
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.
Return the plots in grid format, i.e., a list of rows, each of which is a list of plots. The rows are right padded with None as necessary.
Create and scale the plots, after first executing the PlotGroup’s pre_plot_hooks (if update is True) and plot_hooks.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Enlarge or reduce the bitmaps as needed for display.
The calculated sizes will be multiplied by the given zoom_factor, if it is not None.
If the scaled sizes would be outside of the allowed range, no scaling is done, and False is returned. (One might conceivably instead want the scaling to reach the actual minimum or maximum allowed, but if we did this, then repeated enlargements and reductions would not be reversible, unless we were very tricky about how we did it.)
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
alias of CFSheet
Restore the most recently saved state.
See state_push() for more details.
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.
Determine which plot will be the largest, based on the settings for minimum plot heights, the specified zoom factor (if not None), etc.
A minimum size (and potentially a maximum size) are enforced, as described below.
If the scaled sizes would be outside of the allowed range, False is returned.
For matrix coordinate plots (sheet_coords=False), the minimum size is calculated as the native size of the largest bitmap to be plotted. Other plots are then usually scaled up to (but not greater than) this size, so that all plots are approximately the same size, and no plot is missing any pixel.
For Sheet coordinate plots, the minimum plotting density that will avoid losing pixels is determined by the maximum density from any sheet. If all plots are then drawn at that density (as they must be for them to be in Sheet coordinates), the largest plot will then be the one with the largest sheet bounds, and the size of that plot will be the maximum density times the largest sheet bounds.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: topo.plotting.plotgroup.UnitPlotGroup
Visualize ConnectionField for each of a CFSheet’s CFProjections.
Construct a static image Plot (e.g. a color key for an Orientation Preference map).
Calculate the grid layout of the plots from their precedences and row_precedences. Returns a list of triples (row, col, plot).
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Return the plots in grid format, i.e., a list of rows, each of which is a list of plots. The rows are right padded with None as necessary.
Create and scale the plots, after first executing the PlotGroup’s pre_plot_hooks (if update is True) and plot_hooks.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Enlarge or reduce the bitmaps as needed for display.
The calculated sizes will be multiplied by the given zoom_factor, if it is not None.
If the scaled sizes would be outside of the allowed range, no scaling is done, and False is returned. (One might conceivably instead want the scaling to reach the actual minimum or maximum allowed, but if we did this, then repeated enlargements and reductions would not be reversible, unless we were very tricky about how we did it.)
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
alias of CFSheet
Restore the most recently saved state.
See state_push() for more details.
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.
Determine which plot will be the largest, based on the settings for minimum plot heights, the specified zoom factor (if not None), etc.
A minimum size (and potentially a maximum size) are enforced, as described below.
If the scaled sizes would be outside of the allowed range, False is returned.
For matrix coordinate plots (sheet_coords=False), the minimum size is calculated as the native size of the largest bitmap to be plotted. Other plots are then usually scaled up to (but not greater than) this size, so that all plots are approximately the same size, and no plot is missing any pixel.
For Sheet coordinate plots, the minimum plotting density that will avoid losing pixels is determined by the maximum density from any sheet. If all plots are then drawn at that density (as they must be for them to be in Sheet coordinates), the largest plot will then be the one with the largest sheet bounds, and the size of that plot will be the maximum density times the largest sheet bounds.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: topo.plotting.plotgroup.ProjectionSheetPlotGroup
A ProjectionSheetPlotGroup capable of generating coordinates on a 2D grid.
Construct a static image Plot (e.g. a color key for an Orientation Preference map).
Calculate the grid layout of the plots from their precedences and row_precedences. Returns a list of triples (row, col, plot).
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
Evenly space out the units within the sheet bounding box, so that it doesn’t matter which corner the measurements start from. A 4 unit grid needs 5 segments. List is in left-to-right, from top-to-bottom.
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.
Return the plots in grid format, i.e., a list of rows, each of which is a list of plots. The rows are right padded with None as necessary.
Create and scale the plots, after first executing the PlotGroup’s pre_plot_hooks (if update is True) and plot_hooks.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Enlarge or reduce the bitmaps as needed for display.
The calculated sizes will be multiplied by the given zoom_factor, if it is not None.
If the scaled sizes would be outside of the allowed range, no scaling is done, and False is returned. (One might conceivably instead want the scaling to reach the actual minimum or maximum allowed, but if we did this, then repeated enlargements and reductions would not be reversible, unless we were very tricky about how we did it.)
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
alias of ProjectionSheet
Restore the most recently saved state.
See state_push() for more details.
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.
Determine which plot will be the largest, based on the settings for minimum plot heights, the specified zoom factor (if not None), etc.
A minimum size (and potentially a maximum size) are enforced, as described below.
If the scaled sizes would be outside of the allowed range, False is returned.
For matrix coordinate plots (sheet_coords=False), the minimum size is calculated as the native size of the largest bitmap to be plotted. Other plots are then usually scaled up to (but not greater than) this size, so that all plots are approximately the same size, and no plot is missing any pixel.
For Sheet coordinate plots, the minimum plotting density that will avoid losing pixels is determined by the maximum density from any sheet. If all plots are then drawn at that density (as they must be for them to be in Sheet coordinates), the largest plot will then be the one with the largest sheet bounds, and the size of that plot will be the maximum density times the largest sheet bounds.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: param.parameterized.Parameterized
Container that has one or more Plots and also knows how to arrange the plots and other special parameters.
Calculate the grid layout of the plots from their precedences and row_precedences. Returns a list of triples (row, col, plot).
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Return the plots in grid format, i.e., a list of rows, each of which is a list of plots. The rows are right padded with None as necessary.
Create and scale the plots, after first executing the PlotGroup’s pre_plot_hooks (if update is True) and plot_hooks.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Scale the images by the given zoom factor, if appropriate; default is to do nothing.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: topo.plotting.plotgroup.ProjectionSheetPlotGroup
Visualize the activity of all Projections into a ProjectionSheet.
Construct a static image Plot (e.g. a color key for an Orientation Preference map).
Calculate the grid layout of the plots from their precedences and row_precedences. Returns a list of triples (row, col, plot).
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Return the plots in grid format, i.e., a list of rows, each of which is a list of plots. The rows are right padded with None as necessary.
Create and scale the plots, after first executing the PlotGroup’s pre_plot_hooks (if update is True) and plot_hooks.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Enlarge or reduce the bitmaps as needed for display.
The calculated sizes will be multiplied by the given zoom_factor, if it is not None.
If the scaled sizes would be outside of the allowed range, no scaling is done, and False is returned. (One might conceivably instead want the scaling to reach the actual minimum or maximum allowed, but if we did this, then repeated enlargements and reductions would not be reversible, unless we were very tricky about how we did it.)
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
alias of ProjectionSheet
Restore the most recently saved state.
See state_push() for more details.
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.
Determine which plot will be the largest, based on the settings for minimum plot heights, the specified zoom factor (if not None), etc.
A minimum size (and potentially a maximum size) are enforced, as described below.
If the scaled sizes would be outside of the allowed range, False is returned.
For matrix coordinate plots (sheet_coords=False), the minimum size is calculated as the native size of the largest bitmap to be plotted. Other plots are then usually scaled up to (but not greater than) this size, so that all plots are approximately the same size, and no plot is missing any pixel.
For Sheet coordinate plots, the minimum plotting density that will avoid losing pixels is determined by the maximum density from any sheet. If all plots are then drawn at that density (as they must be for them to be in Sheet coordinates), the largest plot will then be the one with the largest sheet bounds, and the size of that plot will be the maximum density times the largest sheet bounds.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: topo.plotting.plotgroup.TemplatePlotGroup
Abstract PlotGroup for visualizations of the Projections of one ProjectionSheet.
Construct a static image Plot (e.g. a color key for an Orientation Preference map).
Calculate the grid layout of the plots from their precedences and row_precedences. Returns a list of triples (row, col, plot).
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Return the plots in grid format, i.e., a list of rows, each of which is a list of plots. The rows are right padded with None as necessary.
Create and scale the plots, after first executing the PlotGroup’s pre_plot_hooks (if update is True) and plot_hooks.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Enlarge or reduce the bitmaps as needed for display.
The calculated sizes will be multiplied by the given zoom_factor, if it is not None.
If the scaled sizes would be outside of the allowed range, no scaling is done, and False is returned. (One might conceivably instead want the scaling to reach the actual minimum or maximum allowed, but if we did this, then repeated enlargements and reductions would not be reversible, unless we were very tricky about how we did it.)
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
alias of ProjectionSheet
Restore the most recently saved state.
See state_push() for more details.
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.
Determine which plot will be the largest, based on the settings for minimum plot heights, the specified zoom factor (if not None), etc.
A minimum size (and potentially a maximum size) are enforced, as described below.
If the scaled sizes would be outside of the allowed range, False is returned.
For matrix coordinate plots (sheet_coords=False), the minimum size is calculated as the native size of the largest bitmap to be plotted. Other plots are then usually scaled up to (but not greater than) this size, so that all plots are approximately the same size, and no plot is missing any pixel.
For Sheet coordinate plots, the minimum plotting density that will avoid losing pixels is determined by the maximum density from any sheet. If all plots are then drawn at that density (as they must be for them to be in Sheet coordinates), the largest plot will then be the one with the largest sheet bounds, and the size of that plot will be the maximum density times the largest sheet bounds.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: param.parameterized.Parameterized
Convenience functions for handling subplots (such as colorized Activity plots). Only needed for avoiding typing, as plots can be declared with their own specific subplots without using these functions.
param Parameter _last_args (allow_None=False, constant=False, default=(), instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Define Hue and Confidence subplots for each of the plotgroups_to_subplot. Typically used to make activity or weight plots show a preference value as the hue, and a selectivity as the confidence.
The specified hue, if any, should be the name of a Image, such as OrientationPreference. The specified confidence, if any, should be the name of a (usually) different Image, such as OrientationSelectivity.
The prefix option is a shortcut making the usual case easier to type; it sets hue to prefix+”Preference” and confidence to prefix+”Selectivity”.
If force=False, subplots are changed only if no subplot is currently defined. Force=False is useful for setting up subplots automatically when maps are measured, without overwriting any subplots set up specifically by the user.
Currently works only for plotgroups that have a plot with the same name as the plotgroup, though this could be changed easily.
Examples:
Subplotting.set_subplots("Orientation")
- Set the default subplots to OrientationPreference and
OrientationSelectivity
Subplotting.set_subplots(hue="OrientationPreference")
- Set the default hue subplot to OrientationPreference with no
selectivity
Subplotting.set_subplots()
- Remove subplots from all the plotgroups_to_subplot.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: topo.plotting.plotgroup.SheetPlotGroup
Container that allows creation of different types of plots in a way that is independent of particular models or Sheets.
A TemplatePlotGroup is constructed from a plot_templates list, an optional command to run to generate the data, and other optional parameters.
The plot_templates list should contain tuples (plot_name, plot_template). Each plot_template is a list of (name, value) pairs, where each name specifies a plotting channel (such as Hue or Confidence), and the value is the name of a Image (such as Activity or OrientationPreference).
Various types of plots support different channels. An SHC plot supports Strength, Hue, and Confidence channels (with Strength usually being visualized as luminance, Hue as a color value, and Confidence as the saturation of the color). An RGB plot supports Red, Green, and Blue channels. Other plot types will be added eventually.
For instance, one could define an Orientation-colored Activity plot as:
plotgroups['Activity'] =
TemplatePlotGroup(name='Activity', category='Basic',
pre_plot_hooks=[measure_activity],
plot_templates=[('Activity',
{'Strength': 'Activity', 'Hue': 'OrientationPreference', 'Confidence': None})])
This specifies that the final TemplatePlotGroup will contain up to one Plot named Activity per Sheet, although there could be no plots at all if no Sheet has a Image named Activity once ‘measure_activity()’ has been run. The Plot will be colored by OrientationPreference if such a Image exists for that Sheet, and the value (luminance) channel will be determined by the Image Activity. This plot will be listed in the category ‘Basic’ anywhere such categories are relevant (e.g. in the GUI).
Here’s a more complicated example specifying two different plots in the same PlotGroup:
TemplatePlotGroup(name='Orientation Preference', category='Basic'
pre_plot_hooks=[measure_or_pref.instance()],
plot_templates=
[('Orientation Preference',
{'Strength': None, 'Hue': 'OrientationPreference'}),
('Orientation Selectivity',
{'Strength': 'OrientationSelectivity'})])
Here the TemplatePlotGroup will contain up to two Plots per Sheet, depending on which Sheets have OrientationPreference and OrientationSelectivity SheetViews.
The function create_plotgroup provides a convenient way to define plots using TemplatePlotGroups; search for create_plotgroup elsewhere in the code to see examples.
Construct a static image Plot (e.g. a color key for an Orientation Preference map).
Calculate the grid layout of the plots from their precedences and row_precedences. Returns a list of triples (row, col, plot).
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Return the plots in grid format, i.e., a list of rows, each of which is a list of plots. The rows are right padded with None as necessary.
Create and scale the plots, after first executing the PlotGroup’s pre_plot_hooks (if update is True) and plot_hooks.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Enlarge or reduce the bitmaps as needed for display.
The calculated sizes will be multiplied by the given zoom_factor, if it is not None.
If the scaled sizes would be outside of the allowed range, no scaling is done, and False is returned. (One might conceivably instead want the scaling to reach the actual minimum or maximum allowed, but if we did this, then repeated enlargements and reductions would not be reversible, unless we were very tricky about how we did it.)
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the most recently saved state.
See state_push() for more details.
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.
Determine which plot will be the largest, based on the settings for minimum plot heights, the specified zoom factor (if not None), etc.
A minimum size (and potentially a maximum size) are enforced, as described below.
If the scaled sizes would be outside of the allowed range, False is returned.
For matrix coordinate plots (sheet_coords=False), the minimum size is calculated as the native size of the largest bitmap to be plotted. Other plots are then usually scaled up to (but not greater than) this size, so that all plots are approximately the same size, and no plot is missing any pixel.
For Sheet coordinate plots, the minimum plotting density that will avoid losing pixels is determined by the maximum density from any sheet. If all plots are then drawn at that density (as they must be for them to be in Sheet coordinates), the largest plot will then be the one with the largest sheet bounds, and the size of that plot will be the maximum density times the largest sheet bounds.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: topo.plotting.plotgroup.TemplatePlotGroup
Display with small segments the two most preferred orientations for each units in the sheet. Only orientation with significative selectivity are shown. Darker segments correspond to orientations with more selective response.
Construct a static image Plot (e.g. a color key for an Orientation Preference map).
Calculate the grid layout of the plots from their precedences and row_precedences. Returns a list of triples (row, col, plot).
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Return the plots in grid format, i.e., a list of rows, each of which is a list of plots. The rows are right padded with None as necessary.
Create and scale the plots, after first executing the PlotGroup’s pre_plot_hooks (if update is True) and plot_hooks.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Enlarge or reduce the bitmaps as needed for display.
The calculated sizes will be multiplied by the given zoom_factor, if it is not None.
If the scaled sizes would be outside of the allowed range, no scaling is done, and False is returned. (One might conceivably instead want the scaling to reach the actual minimum or maximum allowed, but if we did this, then repeated enlargements and reductions would not be reversible, unless we were very tricky about how we did it.)
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the most recently saved state.
See state_push() for more details.
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.
Determine which plot will be the largest, based on the settings for minimum plot heights, the specified zoom factor (if not None), etc.
A minimum size (and potentially a maximum size) are enforced, as described below.
If the scaled sizes would be outside of the allowed range, False is returned.
For matrix coordinate plots (sheet_coords=False), the minimum size is calculated as the native size of the largest bitmap to be plotted. Other plots are then usually scaled up to (but not greater than) this size, so that all plots are approximately the same size, and no plot is missing any pixel.
For Sheet coordinate plots, the minimum plotting density that will avoid losing pixels is determined by the maximum density from any sheet. If all plots are then drawn at that density (as they must be for them to be in Sheet coordinates), the largest plot will then be the one with the largest sheet bounds, and the size of that plot will be the maximum density times the largest sheet bounds.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: topo.plotting.plotgroup.ProjectionSheetPlotGroup
Visualize anything related to a unit.
Construct a static image Plot (e.g. a color key for an Orientation Preference map).
Calculate the grid layout of the plots from their precedences and row_precedences. Returns a list of triples (row, col, plot).
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Return the plots in grid format, i.e., a list of rows, each of which is a list of plots. The rows are right padded with None as necessary.
Create and scale the plots, after first executing the PlotGroup’s pre_plot_hooks (if update is True) and plot_hooks.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Enlarge or reduce the bitmaps as needed for display.
The calculated sizes will be multiplied by the given zoom_factor, if it is not None.
If the scaled sizes would be outside of the allowed range, no scaling is done, and False is returned. (One might conceivably instead want the scaling to reach the actual minimum or maximum allowed, but if we did this, then repeated enlargements and reductions would not be reversible, unless we were very tricky about how we did it.)
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
alias of ProjectionSheet
Restore the most recently saved state.
See state_push() for more details.
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.
Determine which plot will be the largest, based on the settings for minimum plot heights, the specified zoom factor (if not None), etc.
A minimum size (and potentially a maximum size) are enforced, as described below.
If the scaled sizes would be outside of the allowed range, False is returned.
For matrix coordinate plots (sheet_coords=False), the minimum size is calculated as the native size of the largest bitmap to be plotted. Other plots are then usually scaled up to (but not greater than) this size, so that all plots are approximately the same size, and no plot is missing any pixel.
For Sheet coordinate plots, the minimum plotting density that will avoid losing pixels is determined by the maximum density from any sheet. If all plots are then drawn at that density (as they must be for them to be in Sheet coordinates), the largest plot will then be the one with the largest sheet bounds, and the size of that plot will be the maximum density times the largest sheet bounds.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Create a new PlotGroup and add it to the plotgroups list.
Convenience function to make it simpler to use the name of the PlotGroup as the key in the plotgroups list.
template_plot_type: Whether the plots are bitmap images or curves (‘curve’).
Returns the first GeneratorSheet defined, for use as a default value.
Returns the first sheet for which measure_maps is True (if any), or else the first sheet, for use as a default value.
Global repository of PlotGroups, to which users can add their own as needed.
Bases: param.parameterized.ParameterizedFunction
Convenience command for saving a set of plots to disk. Examples:
save_plotgroup(“Activity”) save_plotgroup(“Orientation Preference”) save_plotgroup(“Projection”,projection=topo.sim[‘V1’].projections(‘Afferent’))
Some plotgroups accept optional parameters, which can be passed like projection above.
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
Helper function for save_plotgroup.
Comparison operator for deciding whether make_plots(update==False) is safe for one plotgroup if the other has already been updated.
Treats plotgroups as the same if the specified list of attributes (if present) match in both plotgroups.
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.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.