CythonCodeObject class

(Shortest import: from brian2 import CythonCodeObject)

class brian2.codegen.runtime.cython_rt.cython_rt.CythonCodeObject(owner, code, variables, variable_indices, template_name, template_source, compiler_kwds, name='cython_code_object*')[source]

Bases: brian2.codegen.runtime.numpy_rt.numpy_rt.NumpyCodeObject

Execute code using Cython.

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

compile()[source]
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 of CodeGenerator.code_object.

update_namespace()[source]

Update the namespace for this timestep. Should only deal with variables where the reference changes every timestep, i.e. where the current reference in namespace is not correct.

variables_to_namespace()[source]