from brian2.codegen.codeobject import create_runner_codeobj)
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)¶
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
variable_indices : dict-like, optional
A mapping from
Variableobjects to index names (strings). If none is given, uses the corresponding attribute of
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
needed_variables: list of str, optional :
A list of variables that are neither present in the abstract code, nor in the
USES_VARIABLESstatement in the template. This is only rarely necessary, an example being a
StateMonitorwhere 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
Variableobjects, used in addition to the variables saved in
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
CodeObjectclass to run code with. If not specified, defaults to the