Subexpression class

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

class brian2.core.variables.Subexpression(name, owner, expr, device, dimensions=Dimension(), dtype=None, scalar=False)[source]

Bases: Variable

An object providing information about a named subexpression in a model. Most of the time Variables.add_subexpression should be used instead of instantiating this class directly.

Attributes

device

The Device responsible for memory access

expr

The expression defining the subexpression

identifiers

The identifiers used in the expression

Methods

get_addressable_value(name, group)

Get the value (without units) of this variable in a form that can be indexed in the context of a group.

get_addressable_value_with_unit(name, group)

Get the value (with units) of this variable in a form that can be indexed in the context of a group.

Details

device

The Device responsible for memory access

expr

The expression defining the subexpression

identifiers

The identifiers used in the expression

get_addressable_value(name, group)[source]

Get the value (without units) of this variable in a form that can be indexed in the context of a group. For example, if a postsynaptic variable x is accessed in a synapse S as S.x_post, the synaptic indexing scheme can be used.

get_addressable_value_with_unit(name, group)[source]

Get the value (with units) of this variable in a form that can be indexed in the context of a group. For example, if a postsynaptic variable x is accessed in a synapse S as S.x_post, the synaptic indexing scheme can be used.