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, required_input_tokens, optional_input_tokens, generated_output_tokens)[source]¶ Bases:
object
Represents the metadata for an algorithm.
Parameters: - algorithm_id (str) – The unique ID of the algorithm
- required_inputs (list(
AbstractInput
)) – The inputs required by the algorithm - optional_inputs (list(
AbstractInput
)) – The optional inputs for the algorithm, which will be provided when available - outputs (list(
Output
)) – The output types of the algorithm - required_input_tokens (list(
Token
)) – Tokens required to have been generated before this algorithm can start - optional_input_tokens (list(
Token
)) – Tokens required to have been generated before this algorithm can start if and only if at least one algorithm generates the token - generated_output_tokens (list(
Token
)) – Tokens generated by this 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
-
generated_output_tokens
¶ The generated output tokens of the algorithm
-
optional_input_tokens
¶ The optional input tokens of the algorithm
-
optional_inputs
¶ The optional inputs of the algorithm
-
outputs
¶ The outputs of the algorithm
-
required_input_tokens
¶ The required input tokens 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, required_input_tokens, optional_input_tokens, generated_output_tokens, python_module)[source]¶ Bases:
pacman.executor.algorithm_classes.abstract_algorithm.AbstractAlgorithm
An algorithm written in Python.
Parameters: python_module – The module containing the python code to execute
pacman.executor.algorithm_classes.external_algorithm module¶
-
class
pacman.executor.algorithm_classes.external_algorithm.
ExternalAlgorithm
(algorithm_id, required_inputs, optional_inputs, outputs, required_input_tokens, optional_input_tokens, generated_output_tokens, command_line_arguments)[source]¶ Bases:
pacman.executor.algorithm_classes.abstract_algorithm.AbstractAlgorithm
An algorithm which is external to the SpiNNaker software, or rather its wrapper into PACMAN.
pacman.executor.algorithm_classes.python_class_algorithm module¶
-
class
pacman.executor.algorithm_classes.python_class_algorithm.
PythonClassAlgorithm
(algorithm_id, required_inputs, optional_inputs, outputs, required_input_tokens, optional_input_tokens, generated_output_tokens, python_module, python_class, python_method=None)[source]¶ Bases:
pacman.executor.algorithm_classes.abstract_python_algorithm.AbstractPythonAlgorithm
An algorithm that is a class.
Parameters: - python_class – The class of the algorithm
- python_method – The method of the algorithm, or None if the class is callable
pacman.executor.algorithm_classes.python_function_algorithm module¶
-
class
pacman.executor.algorithm_classes.python_function_algorithm.
PythonFunctionAlgorithm
(algorithm_id, required_inputs, optional_inputs, outputs, required_input_tokens, optional_input_tokens, generated_output_tokens, python_module, python_function)[source]¶ Bases:
pacman.executor.algorithm_classes.abstract_python_algorithm.AbstractPythonAlgorithm
An algorithm that is a function.
Parameters: python_function – The name of the function to call
Module contents¶
-
class
pacman.executor.algorithm_classes.
AbstractAlgorithm
(algorithm_id, required_inputs, optional_inputs, outputs, required_input_tokens, optional_input_tokens, generated_output_tokens)[source]¶ Bases:
object
Represents the metadata for an algorithm.
Parameters: - algorithm_id (str) – The unique ID of the algorithm
- required_inputs (list(
AbstractInput
)) – The inputs required by the algorithm - optional_inputs (list(
AbstractInput
)) – The optional inputs for the algorithm, which will be provided when available - outputs (list(
Output
)) – The output types of the algorithm - required_input_tokens (list(
Token
)) – Tokens required to have been generated before this algorithm can start - optional_input_tokens (list(
Token
)) – Tokens required to have been generated before this algorithm can start if and only if at least one algorithm generates the token - generated_output_tokens (list(
Token
)) – Tokens generated by this 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
-
generated_output_tokens
¶ The generated output tokens of the algorithm
-
optional_input_tokens
¶ The optional input tokens of the algorithm
-
optional_inputs
¶ The optional inputs of the algorithm
-
outputs
¶ The outputs of the algorithm
-
required_input_tokens
¶ The required input tokens of the algorithm
-
required_inputs
¶ The required inputs of the algorithm
-
class
pacman.executor.algorithm_classes.
AbstractPythonAlgorithm
(algorithm_id, required_inputs, optional_inputs, outputs, required_input_tokens, optional_input_tokens, generated_output_tokens, python_module)[source]¶ Bases:
pacman.executor.algorithm_classes.abstract_algorithm.AbstractAlgorithm
An algorithm written in Python.
Parameters: python_module – The module containing the python code to execute
-
class
pacman.executor.algorithm_classes.
ExternalAlgorithm
(algorithm_id, required_inputs, optional_inputs, outputs, required_input_tokens, optional_input_tokens, generated_output_tokens, command_line_arguments)[source]¶ Bases:
pacman.executor.algorithm_classes.abstract_algorithm.AbstractAlgorithm
An algorithm which is external to the SpiNNaker software, or rather its wrapper into PACMAN.
-
class
pacman.executor.algorithm_classes.
PythonClassAlgorithm
(algorithm_id, required_inputs, optional_inputs, outputs, required_input_tokens, optional_input_tokens, generated_output_tokens, python_module, python_class, python_method=None)[source]¶ Bases:
pacman.executor.algorithm_classes.abstract_python_algorithm.AbstractPythonAlgorithm
An algorithm that is a class.
Parameters: - python_class – The class of the algorithm
- python_method – The method of the algorithm, or None if the class is callable
-
class
pacman.executor.algorithm_classes.
PythonFunctionAlgorithm
(algorithm_id, required_inputs, optional_inputs, outputs, required_input_tokens, optional_input_tokens, generated_output_tokens, python_module, python_function)[source]¶ Bases:
pacman.executor.algorithm_classes.abstract_python_algorithm.AbstractPythonAlgorithm
An algorithm that is a function.
Parameters: python_function – The name of the function to call