NumpyCodeGenerator class

(Shortest import: from brian2 import NumpyCodeGenerator)

class brian2.codegen.generators.numpy_generator.NumpyCodeGenerator(variables, variable_indices, owner, iterate_all, codeobj_class, name, template_name, override_conditional_write=None, allows_scalar_write=False)[source]

Bases: brian2.codegen.generators.base.CodeGenerator

Numpy language

Essentially Python but vectorised.

Methods

conditional_write(line, stmt, variables, ...)
determine_keywords()
read_arrays(read, write, indices, variables, ...)
translate_expression(expr)
translate_one_statement_sequence(statements)
translate_statement(statement)
ufunc_at_vectorisation(statement, variables, ...)
vectorise_code(statements, variables, ...[, ...])
write_arrays(statements, read, write, ...)

Details

conditional_write(line, stmt, variables, conditional_write_vars, created_vars)[source]
determine_keywords()[source]
read_arrays(read, write, indices, variables, variable_indices)[source]
translate_expression(expr)[source]
translate_one_statement_sequence(statements, scalar=False)[source]
translate_statement(statement)[source]
ufunc_at_vectorisation(statement, variables, indices, conditional_write_vars, created_vars, index)[source]
vectorise_code(statements, variables, variable_indices, index='_idx')[source]
write_arrays(statements, read, write, variables, variable_indices)[source]