DynamicArrayVariable class

(Shortest import: from brian2.core.variables import DynamicArrayVariable)

class brian2.core.variables.DynamicArrayVariable(name, owner, size, device, dimensions=Dimension(), dtype=None, constant=False, needs_reference_update=False, resize_along_first=False, scalar=False, read_only=False, unique=False)[source]

Bases: ArrayVariable

An object providing information about a model variable stored in a dynamic array (used in Synapses). Most of the time Variables.add_dynamic_array should be used instead of instantiating this class directly.

Attributes

dimensions

ndim

The number of dimensions

needs_reference_update

Whether this variable needs an update of the reference to the underlying data whenever it is passed to a code object

resize_along_first

Whether this array will be only resized along the first dimension

Methods

resize(new_size)

Resize the dynamic array.

Details

dimensions
ndim

The number of dimensions

needs_reference_update

Whether this variable needs an update of the reference to the underlying data whenever it is passed to a code object

resize_along_first

Whether this array will be only resized along the first dimension

resize(new_size)[source]

Resize the dynamic array. Calls self.device.resize to do the actual resizing.