from brian2 import Group)
resolve_all(identifiers, run_namespace[, …])
Resolve a list of identifiers.
run_regularly(code[, dt, clock, when, …])
Run abstract code in the group’s namespace.
resolve_all(identifiers, run_namespace, user_identifiers=None, additional_variables=None)¶
Resolve a list of identifiers. Calls
Group._resolve()for each identifier.
identifiers : iterable of str
The names to look up.
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).
user_identifiers : iterable of str, optional
The names in
identifiersthat were provided by the user (i.e. are part of user-specified equations, abstract code, etc.). Will be used to determine when to issue namespace conflict warnings. If not specified, will be assumed to be identical to
additional_variables : dict-like, optional
An additional mapping of names to
Variableobjects that will be checked before
variables : dict of
A mapping from name to
Functionobject for each of the names given in
- If one of the names in
identifiercannot be resolved
run_regularly(code, dt=None, clock=None, when='start', order=0, name=None, codeobj_class=None)¶
Run abstract code in the group’s namespace. The created
CodeRunnerobject will be automatically added to the group, it therefore does not need to be added to the network manually. However, a reference to the object will be returned, which can be used to later remove it from the group or to set it to inactive.
code : str
The abstract code to run.
The time step to use for this custom operation. Cannot be combined with the
The update clock to use for this operation. If neither a clock nor the
dtargument is specified, defaults to the clock of the group.
when : str, optional
When to run within a time step, defaults to the
name : str, optional
A unique name, if non is given the name of the group appended with ‘run_regularly’, ‘run_regularly_1’, etc. will be used. If a name is given explicitly, it will be used as given (i.e. the group name will not be prepended automatically).
codeobj_class : class, optional
CodeObjectclass to run code with. If not specified, defaults to the
A reference to the object that will be run.