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:
brian2.codegen.generators.base.CodeGeneratorNumpy language
Essentially Python but vectorised.
Methods
conditional_write(line, stmt, variables, ...)A dictionary of values that is made available to the templated.
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
Statementinto the target language, returns a string.ufunc_at_vectorisation(statement, variables, ...)vectorise_code(statements, variables, ...[, ...])write_arrays(statements, read, write, ...)Details
- determine_keywords()[source]¶
A dictionary of values that is made available to the templated. This is used for example by the
CPPCodeGeneratorto set up all the supporting code
- 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
Statementinto the target language, returns a string.