from brian2.codegen.codeobject import create_runner_codeobj)
- brian2.codegen.codeobject.create_runner_codeobj(group, code, template_name, run_namespace, user_code=None, variable_indices=None, name=None, check_units=True, needed_variables=None, additional_variables=None, template_kwds=None, override_conditional_write=None, codeobj_class=None)[source]¶
CodeObjectfor the execution of code in the context of a
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.
run_namespace : dict-like
An additional namespace that is used for variable lookup (either an explicitly defined namespace or one taken from the local context).
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
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