NumpyCodeGenerator class
(Shortest import: from brian2.codegen.generators 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:
CodeGenerator
Numpy language
Essentially Python but vectorised.
Methods
conditional_write
(line, stmt, variables, ...)read_arrays
(read, write, indices, variables, ...)translate_expression
(expr)Translate the given expression string into a string in the target language, returns a string.
translate_one_statement_sequence
(statements)translate_statement
(statement)Translate a single line
Statement
into the target language, returns a string.ufunc_at_vectorisation
(statement, variables, ...)vectorise_code
(statements, variables, ...[, ...])write_arrays
(statements, read, write, ...)Details
- translate_expression(expr)[source]
Translate the given expression string into a string in the target language, returns a string.
- translate_statement(statement)[source]
Translate a single line
Statement
into the target language, returns a string.