FunctionImplementation class

(Shortest import: from brian2.core.functions import FunctionImplementation)

class brian2.core.functions.FunctionImplementation(name=None, code=None, namespace=None, dependencies=None, dynamic=False)[source]

Bases: object

A simple container object for function implementations.


name : str, optional

The name of the function in the target language. Should only be specified if the function has to be renamed for the target language.

code : language-dependent, optional

A language dependent argument specifying the implementation in the target language, e.g. a code string or a dictionary of code strings.

namespace : dict-like, optional

A dictionary of mappings from names to values that should be added to the namespace of a CodeObject using the function.

dependencies : dict-like, optional

A mapping of names to Function objects, for additional functions needed by this function.

dynamic : bool, optional

Whether this code/namespace is dynamic, i.e. generated for each new context it is used in. If set to True, code and namespace have to be callable with a Group as an argument and are expected to return the final code and namespace. Defaults to False.