from brian2 import make_statements)
make_statements(code, variables, dtype)¶
Turn a series of abstract code statements into Statement objects, inferring whether each line is a set/declare operation, whether the variables are constant or not, and handling the cacheing of subexpressions.
code : str
A (multi-line) string of statements.
variables : dict-like
The data type to use for temporary variables
Lists with statements that are to be executed once and statements that are to be executed once for every neuron/synapse/... (or in a vectorised way)
scalar_statementsmay include newly introduced scalar constants that have been identified as loop-invariant and have therefore been pulled out of the vector statements. The resulting statements will also use augmented assignments where possible, i.e. a statement such as
w = w + 1will be replaced by
w += 1.