3245eece6e5951f3216d030f7fe3200c4caf3a6f,brian2/groups/neurongroup.py,NeuronGroup,_create_variables,#NeuronGroup#Any#,368

Before Change


        Create the variables dictionary for this `NeuronGroup`, containing
        entries for the equation variables and some standard entries.
        """
        device = get_device()
        // Get the standard variables for all groups
        s = Group._create_variables(self)

        if dtype is None:
            dtype = defaultdict(lambda: brian_prefs["core.default_scalar_dtype"])
        elif isinstance(dtype, np.dtype):
            dtype = defaultdict(lambda: dtype)
        elif not hasattr(dtype, "__getitem__"):
            raise TypeError(("Cannot use type %s as dtype "
                             "specification") % type(dtype))

        // Standard variables always present
        s["_spikespace"] = device.array(owner=self, size=self._N+1,
                                        unit=Unit(1), dtype=np.int32,
                                        constant=False)
        // Add the special variable "i" which can be used to refer to the neuron index
        s["i"] = device.arange(self, self._N, constant=True,
                               read_only=True)
        for eq in self.equations.itervalues():
            if eq.type in (DIFFERENTIAL_EQUATION, PARAMETER):
                constant = ("constant" in eq.flags)
                s[eq.varname] = device.array(self, self._N, eq.unit,

After Change


        self.variables = Variables(self)
        self.variables.add_attribute_variable("t", second, self.clock, "t_")
        self.variables.add_attribute_variable("dt", second, self.clock, "dt_")
        self.variables.add_constant("N", Unit(1), self._N)

        if dtype is None:
            dtype = defaultdict(lambda: brian_prefs["core.default_scalar_dtype"])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: brian-team/brian2
Commit Name: 3245eece6e5951f3216d030f7fe3200c4caf3a6f
Time: 2014-01-15
Author: marcel.stimberg@ens.fr
File Name: brian2/groups/neurongroup.py
Class Name: NeuronGroup
Method Name: _create_variables


Project Name: brian-team/brian2
Commit Name: 3245eece6e5951f3216d030f7fe3200c4caf3a6f
Time: 2014-01-15
Author: marcel.stimberg@ens.fr
File Name: brian2/groups/poissongroup.py
Class Name: PoissonGroup
Method Name: __init__


Project Name: brian-team/brian2
Commit Name: 5e96378ecd3f4c401f4355e2a6065fe6967bf571
Time: 2013-10-04
Author: marcel.stimberg@ens.fr
File Name: brian2/groups/subgroup.py
Class Name: Subgroup
Method Name: __init__