GeNNCodeObject class

(Shortest import: from brian2genn.codeobject import GeNNCodeObject)

class brian2genn.codeobject.GeNNCodeObject(owner, code, variables, variable_indices, template_name, template_source, compiler_kwds, name='codeobject*')[source]

Bases: brian2.codegen.codeobject.CodeObject

Class of code objects that generate GeNN “code snippets”

Methods

after_run() Runs the finalizing code in the namespace.
before_run() Runs the preparation code in the namespace.
compile()
run() Runs the main code in the namespace.

Details

after_run()[source]

Runs the finalizing code in the namespace. This code will only be executed once per run.

Returns:

return_value : dict

A dictionary with the keys corresponding to the output_variables defined during the call of CodeGenerator.code_object.

before_run()[source]

Runs the preparation code in the namespace. This code will only be executed once per run.

Returns:

return_value : dict

A dictionary with the keys corresponding to the output_variables defined during the call of CodeGenerator.code_object.

compile()[source]
run()[source]

Runs the main code in the namespace.

Returns:

return_value : dict

A dictionary with the keys corresponding to the output_variables defined during the call of CodeGenerator.code_object.