# 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)

  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

  conditional_write(line, stmt, variables, conditional_write_vars, created_vars)
  read_arrays(read, write, indices, variables, variable_indices)
  translate_expression(expr)

    Translate the given expression string into a string in the target language, returns a string.

  translate_one_statement_sequence(statements, scalar=False)
  translate_statement(statement)

    Translate a single line `Statement` into the target language, returns a string.

  ufunc_at_vectorisation(statement, variables, indices, conditional_write_vars, created_vars, used_variables)
  vectorise_code(statements, variables, variable_indices, index='_idx')
  write_arrays(statements, read, write, variables, variable_indices)