pacman.executor.algorithm_classes package

Submodules

pacman.executor.algorithm_classes.abstract_algorithm module

class pacman.executor.algorithm_classes.abstract_algorithm.AbstractAlgorithm(algorithm_id, required_inputs, optional_inputs, outputs)[source]

Bases: object

Represents the metadata for an algorithm

Parameters:
  • algorithm_id (str) – The unique id of the algorithm
  • required_inputs (list of AbstractInput) – The inputs required by the algorithm
  • optional_inputs (list of AbstractInput) – The optional inputs for the algorithm, which will be provided when available
  • outputs (list of Output) – The output types of the algorithm
algorithm_id

The id for this algorithm

call(inputs)[source]

Call the algorithm with the given inputs and return the outputs

Parameters:inputs – A dict of input type -> value
Returns:A dict of output type -> value
optional_inputs

The optional inputs of the algorithm

outputs

The outputs of the algorithm

required_inputs

The required inputs of the algorithm

pacman.executor.algorithm_classes.abstract_python_algorithm module

class pacman.executor.algorithm_classes.abstract_python_algorithm.AbstractPythonAlgorithm(algorithm_id, required_inputs, optional_inputs, outputs, python_module)[source]

Bases: pacman.executor.algorithm_classes.abstract_algorithm.AbstractAlgorithm

An algorithm written in Python

Parameters:
  • algorithm_id (str) – The unique id of the algorithm
  • required_inputs (list of AbstractInput) – The inputs required by the algorithm
  • optional_inputs (list of AbstractInput) – The optional inputs for the algorithm, which will be provided when available
  • outputs (list of Output) – The output types of the algorithm
  • python_module – The module containing the python code to execute
call(inputs)[source]

Call the algorithm with the given inputs and return the outputs

Parameters:inputs – A dict of input type -> value
Returns:A dict of output type -> value
call_python(inputs)[source]

Call the algorithm

Parameters:inputs – A dict of parameter name -> value
Returns:The result of calling the python algorithm

pacman.executor.algorithm_classes.external_algorithm module

class pacman.executor.algorithm_classes.external_algorithm.ExternalAlgorithm(algorithm_id, required_inputs, optional_inputs, outputs, command_line_arguments)[source]

Bases: pacman.executor.algorithm_classes.abstract_algorithm.AbstractAlgorithm

the container for a algorithm which is external to the SpiNNaker software

call(inputs)[source]

Call the algorithm with the given inputs and return the outputs

Parameters:inputs – A dict of input type -> value
Returns:A dict of output type -> value

pacman.executor.algorithm_classes.python_class_algorithm module

class pacman.executor.algorithm_classes.python_class_algorithm.PythonClassAlgorithm(algorithm_id, required_inputs, optional_inputs, outputs, python_module, python_class, python_method=None)[source]

Bases: pacman.executor.algorithm_classes.abstract_python_algorithm.AbstractPythonAlgorithm

An algorithm that is a class

Parameters:
  • algorithm_id (str) – The unique id of the algorithm
  • required_inputs (list of AbstractInput) – The inputs required by the algorithm
  • optional_inputs (list of AbstractInput) – The optional inputs for the algorithm, which will be provided when available
  • outputs (list of Output) – The output types of the algorithm
  • python_module – The module containing the python code to execute
  • python_class – The class of the algorithm
  • python_method – The method of the algorithm, or None if the class is callable
call_python(inputs)[source]

Call the algorithm

Parameters:inputs – A dict of parameter name -> value
Returns:The result of calling the python algorithm

pacman.executor.algorithm_classes.python_function_algorithm module

class pacman.executor.algorithm_classes.python_function_algorithm.PythonFunctionAlgorithm(algorithm_id, required_inputs, optional_inputs, outputs, python_module, python_function)[source]

Bases: pacman.executor.algorithm_classes.abstract_python_algorithm.AbstractPythonAlgorithm

An algorithm that is a function

Parameters:
  • algorithm_id (str) – The unique id of the algorithm
  • required_inputs (list of AbstractInput) – The inputs required by the algorithm
  • optional_inputs (list of AbstractInput) – The optional inputs for the algorithm, which will be provided when available
  • outputs (list of Output) – The output types of the algorithm
  • python_module – The module containing the python code to execute
Python_function:
 

The name of the function to call

call_python(inputs)[source]

Call the algorithm

Parameters:inputs – A dict of parameter name -> value
Returns:The result of calling the python algorithm

Module contents