CompoundPye  0.93
Modelling and Simulation Framework for Neural Networks of Arthropod Compound Eyes
 All Classes Namespaces Functions Variables Pages
CompoundPye.src.Parser.creator Namespace Reference

Provides functions that use input parsed with MotionDetector.Parser.sensor_parser and MotionDetector.Parser.circuit_parser or input specified in the GUI to create lists of connected sensors and components. More...

Functions

def get_comp_dict
 Creates a dictionary of possible MotionDetectorModel.Components.component.Component classes to use and where to find them (path to file). More...
 
def get_transf_func_dict
 Creates a dictionary of possible transfer-functions to use and where to find them (path to file). More...
 
def get_sensor_dict
 Creates a dictionary of possible MotionDetectorModel.Sensors.sensor.Sensor classes to use and where to find them (path to file). More...
 
def create_circ_lists_GUI_interface
 Create circuit lists (a list of components and a list of sensors) with information from the GUI. More...
 
def create_circ_lists
 Create circuit lists (a list of components and a list of sensors) with information from a circuit-file and a sensor-file. More...
 
def connect_tangential_components
 Connects tangential components, or rather connects components of all columns to tangential cells. More...
 
def get_components_via_label_and_attributes
 Get all components with given name and fulfilling given parmeter specifications from a list of components. More...
 
def create_sensors
 Create a list of sensors with information from a sensor-file. More...
 
def create_components
 Create a list of components with information from a circuit-file. More...
 
def connect_receiver
 Connect components to columns' sensors according to the list of receiving components. More...
 
def connect_components
 Connect components in one column according to the list of connections. More...
 
def cross_connect_next_neighbours
 Connect components/neurons in neighbouring columns according to the list of connections. More...
 
def cross_connect_next_next_neighbours
 Connect components/neurons in next-next-neighbouring columns according to the list of connections. More...
 
def parse_nn_weight
 Parse the 'weight' parameter of a connection between next-neighbours. More...
 
def get_component_via_label
 Find a component in a list of components via its label. More...
 
def connect_via_labels
 Connect two components with labels l1 and l2 in the given list of components. More...
 
def connect_tangential_via_labels
 Connect tangential cell with label l1 and targets with label l2 in the given list of components. More...
 
def get_comp_class
 Creates a Component object of given string. More...
 
def get_obj_args
 Creates a list of arguments and a dictionary of keyword arguments for a Component object. More...
 
def get_transfer_func
 Returns transfer function with identical name as the given string. More...
 
def get_func_args
 Creates a list of arguments and a dictionary of keyword arguments for a transfer function. More...
 
def get_args
 Parse a string of arguments to a list of arguments and a dictionary of keyword arguments. More...
 
def get_sensor_class
 Creates a Sensor object of given string. More...
 
def get_sensor_args
 Creates a list of arguments and a dictionary of keyword arguments for a Sensor object. More...
 
def get_filter_keyword
 Check if the given string is in the list of possible filter keys, return the appropriate filter key. More...
 
def get_filter_args
 Create a list of parameters and a dictionary of keyword parameters from a string of parameters for a filter function. More...
 

Detailed Description

Provides functions that use input parsed with MotionDetector.Parser.sensor_parser and MotionDetector.Parser.circuit_parser or input specified in the GUI to create lists of connected sensors and components.

Author
Ilyas Kuhlemann ilyas.nosp@m.p.ku.nosp@m.@gmai.nosp@m.l.co.nosp@m.m
Date
08.10.14 The central function to use here is create_circ_lists.

Function Documentation

def CompoundPye.src.Parser.creator.connect_components (   list_of_components,
  connections 
)

Connect components in one column according to the list of connections.

def CompoundPye.src.Parser.creator.connect_receiver (   sensor,
  components,
  receiver_list 
)

Connect components to columns' sensors according to the list of receiving components.

def CompoundPye.src.Parser.creator.connect_tangential_components (   tangential_components,
  non_tangential_components,
  connections_to,
  connections_from 
)

Connects tangential components, or rather connects components of all columns to tangential cells.

Now also includes connections FROM tangential cells to any other cells.

Parameters
tangential_componentsList of tangential components.
non_tangential_componentsList of all other components.
connectionsList of connections to tangential components.
def CompoundPye.src.Parser.creator.connect_tangential_via_labels (   comp_list,
  l1,
  weight,
  l2 
)

Connect tangential cell with label l1 and targets with label l2 in the given list of components.

Parameters
comp_listList of MotionDetectorModel.Components.component.Component objects.
l1Label of the source component.
weightWeight of the connection.
l2Label of the target component.
def CompoundPye.src.Parser.creator.connect_via_labels (   comp_list,
  l1,
  weight,
  l2 
)

Connect two components with labels l1 and l2 in the given list of components.

Parameters
comp_listList of MotionDetectorModel.Components.component.Component objects.
l1Label of the source component.
weightWeight of the connection.
l2Label of the target component.
def CompoundPye.src.Parser.creator.create_circ_lists (   px,
  s_settings,
  s_variables,
  s_defaults,
  sensors,
  arrangement,
  variables,
  components,
  connections,
  receiver,
  neighbour_kw_params = {'manually':False,
  range 
)

Create circuit lists (a list of components and a list of sensors) with information from a circuit-file and a sensor-file.

def CompoundPye.src.Parser.creator.create_circ_lists_GUI_interface (   px,
  s_settings,
  s_variables,
  s_defaults,
  sensors,
  arrangement,
  variables,
  components,
  connections,
  receiver,
  neighbour_kw_params,
  show_nhood_plot 
)

Create circuit lists (a list of components and a list of sensors) with information from the GUI.

Changes some of the input arguments such that the function create_circ_lists can be called from within this function with information from the input arguments. corrected==in correct syntax for create_circ_lists()

def CompoundPye.src.Parser.creator.create_components (   variables,
  components,
  group_str,
  coords 
)

Create a list of components with information from a circuit-file.

def CompoundPye.src.Parser.creator.create_sensors (   px,
  s_settings,
  s_variables,
  s_defaults,
  sensors,
  mode_manual 
)

Create a list of sensors with information from a sensor-file.

def CompoundPye.src.Parser.creator.cross_connect_next_neighbours (   left,
  between,
  right,
  connections,
  manually,
  edge_i_j 
)

Connect components/neurons in neighbouring columns according to the list of connections.

def CompoundPye.src.Parser.creator.cross_connect_next_next_neighbours (   left,
  between,
  right,
  connections 
)

Connect components/neurons in next-next-neighbouring columns according to the list of connections.

def CompoundPye.src.Parser.creator.get_args (   s,
  v 
)

Parse a string of arguments to a list of arguments and a dictionary of keyword arguments.

Parameters
sString of arguments.
vDictionary of variables.
def CompoundPye.src.Parser.creator.get_comp_class (   s)

Creates a Component object of given string.

Parameters
sString representing a Component class
Returns
Component object.
def CompoundPye.src.Parser.creator.get_comp_dict ( )

Creates a dictionary of possible MotionDetectorModel.Components.component.Component classes to use and where to find them (path to file).

Returns
Dictionary with class names as keys and their source files as values.
def CompoundPye.src.Parser.creator.get_component_via_label (   list_of_components,
  label 
)

Find a component in a list of components via its label.

Parameters
list_of_componentsList of MotionDetectorModel.Components.component.Component objects.
labelLabel of the component to look for.
Returns
(Pointer to) the component with specified label.
def CompoundPye.src.Parser.creator.get_components_via_label_and_attributes (   components,
  name,
  parameters 
)

Get all components with given name and fulfilling given parmeter specifications from a list of components.

Parameters
componentsList of components among which to search.
nameLabel of the wanted components.
parametersSpecifies parameters regarding axis and direction for the wanted neurons.
def CompoundPye.src.Parser.creator.get_filter_args (   s,
  variables,
  defaults 
)

Create a list of parameters and a dictionary of keyword parameters from a string of parameters for a filter function.

def CompoundPye.src.Parser.creator.get_filter_keyword (   s,
  defaults 
)

Check if the given string is in the list of possible filter keys, return the appropriate filter key.

def CompoundPye.src.Parser.creator.get_func_args (   s,
  v 
)

Creates a list of arguments and a dictionary of keyword arguments for a transfer function.

Parameters
sString of arguments.
vDictionary of variables.
Returns
List of arguments and a Dictionary of keyword arguments.
def CompoundPye.src.Parser.creator.get_obj_args (   s,
  variables 
)

Creates a list of arguments and a dictionary of keyword arguments for a Component object.

def CompoundPye.src.Parser.creator.get_sensor_args (   s,
  variables,
  default 
)

Creates a list of arguments and a dictionary of keyword arguments for a Sensor object.

Parameters
sString of arguments.
variablesDictionary of variables.
defaultDictionary of defaul values (replaces '-' for given category).
Returns
Tuple: [0] list of parameters, [1] dictionary of keyword parameters.
def CompoundPye.src.Parser.creator.get_sensor_class (   s,
  default 
)

Creates a Sensor object of given string.

Parameters
sString representing a Sensor class.
Returns
Sensor object.
def CompoundPye.src.Parser.creator.get_sensor_dict ( )

Creates a dictionary of possible MotionDetectorModel.Sensors.sensor.Sensor classes to use and where to find them (path to file).

Returns
Dictionary with class names as keys and their source files as values.
def CompoundPye.src.Parser.creator.get_transf_func_dict ( )

Creates a dictionary of possible transfer-functions to use and where to find them (path to file).

Returns
Dictionary with function names as keys and their source files as values.
def CompoundPye.src.Parser.creator.get_transfer_func (   s)

Returns transfer function with identical name as the given string.

Parameters
sString representing a transfer function.
Returns
transfer function.
def CompoundPye.src.Parser.creator.parse_nn_weight (   s)

Parse the 'weight' parameter of a connection between next-neighbours.

Those weight parameters need special treatment, because they can be different coming from a right neighbour than coming from a left neighbour.

Parameters
sWeight as a string.
Returns
Tuple of two floats, first the weight of connections from left, second of connections from right neighbours.