get_var_ndim function

(Shortest import: from brian2genn.genn_generator import get_var_ndim)

brian2genn.genn_generator.get_var_ndim(v, default_value=None)[source]

Helper function to get the ndim attribute of a DynamicArrayVariable, falling back to the previous name dimensions if necessary.


v : ArrayVariable

The variable for which to retrieve the number of dimensions.

default_value : optional

A default value if the attribute does not exist


ndim : int

Number of dimensions