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

write_provenance_header(provenance_file)[source]

Writes the header info for this algorithm So things like name, module, class, function and command_line_arguments

But not anything about input and outputs as this is done elsewhere :param provenance_file: File to write to :type provenance_file: file

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
write_provenance_header(provenance_file)[source]

Writes the header info for this algorithm So things like name, module, class, function and command_line_arguments

But not anything about input and outputs as this is done elsewhere :param provenance_file: File to write to :type provenance_file: file

pacman.executor.algorithm_classes.python_class_algorithm module

pacman.executor.algorithm_classes.python_function_algorithm module

Module contents