CodeObject class¶
(Shortest import: from brian2.codegen.codeobject import CodeObject)
-
class
brian2.codegen.codeobject.CodeObject(owner, code, variables, variable_indices, template_name, template_source, compiler_kwds, name='codeobject*')[source]¶ Bases:
brian2.core.names.NameableExecutable code object.
The
codecan either be a string or abrian2.codegen.templates.MultiTemplate.After initialisation, the code is compiled with the given namespace using
code.compile(namespace).Calling
code(key1=val1, key2=val2)executes the code with the given variables inserted into the namespace.Attributes
class_nameA short name for this type of CodeObjectgenerator_classThe CodeGeneratorclass used by thisCodeObjectMethods
__call__(**kwds)Call self as a function. 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. Details
-
class_name¶ A short name for this type of
CodeObject
-
generator_class¶ The
CodeGeneratorclass used by thisCodeObject
-
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.
-