create_runner_codeobj function

(Shortest import: from brian2.codegen.codeobject import create_runner_codeobj)

brian2.codegen.codeobject.create_runner_codeobj(group, code, template_name, user_code=None, variable_indices=None, name=None, check_units=True, needed_variables=None, additional_variables=None, level=0, run_namespace=None, template_kwds=None, override_conditional_write=None, codeobj_class=None)[source]

Create a CodeObject for the execution of code in the context of a Group.


group : Group

The group where the code is to be run

code : str or dict of str

The code to be executed.

template_name : str

The name of the template to use for the code.

user_code : str, optional

The code that had been specified by the user before other code was added automatically. If not specified, will be assumed to be identical to code.

variable_indices : dict-like, optional

A mapping from Variable objects to index names (strings). If none is given, uses the corresponding attribute of group.

name : str, optional

A name for this code object, will use group + '_codeobject*' if none is given.

check_units : bool, optional

Whether to check units in the statement. Defaults to True.

needed_variables: list of str, optional :

A list of variables that are neither present in the abstract code, nor in the USES_VARIABLES statement in the template. This is only rarely necessary, an example being a StateMonitor where the names of the variables are neither known to the template nor included in the abstract code statements.

additional_variables : dict-like, optional

A mapping of names to Variable objects, used in addition to the variables saved in group.

level : int, optional

How far to go up in the stack to find the call frame.

run_namespace : dict-like, optional

An additional namespace that is used for variable lookup (if not defined, the implicit namespace of local variables is used).

template_kwds : dict, optional

A dictionary of additional information that is passed to the template.

override_conditional_write: list of str, optional :

A list of variable names which are used as conditions (e.g. for refractoriness) which should be ignored.

codeobj_class : class, optional

The CodeObject class to run code with. If not specified, defaults to the group‘s codeobj_class attribute.