WeaveCodeObject class¶
(Shortest import: from brian2 import WeaveCodeObject)
-
class
brian2.codegen.runtime.weave_rt.weave_rt.
WeaveCodeObject
(owner, code, variables, variable_indices, template_name, template_source, name='weave_code_object*')[source]¶ Bases:
brian2.codegen.codeobject.CodeObject
Weave code object
The
code
should be aMultiTemplate
object with two macros defined,main
(for the main loop code) andsupport_code
for any support code (e.g. function definitions).Methods
compile
()is_available
()Whether this target for code generation is available. run
()Runs the code in the namespace. update_namespace
()Update the namespace for this timestep. variables_to_namespace
()Details
-
classmethod
is_available
()[source]¶ Whether this target for code generation is available. Should use a minimal example to check whether code generation works in general.
-
run
()[source]¶ Runs the code in the namespace.
Returns: return_value : dict
A dictionary with the keys corresponding to the
output_variables
defined during the call ofCodeGenerator.code_object
.
-
classmethod