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():