Population

Population#

class braintools.conn.Population(size, *, name, positions=None)#

A named group of neurons.

Parameters:
  • size (int | Tuple[int, ...]) – Number of neurons, or the shape of a neuron grid (flattened in C order when indexing neurons).

  • name (str) – Non-empty name, unique within a Network.

  • positions (array_like or Quantity, optional) – Neuron positions of shape (num, d) (or (num,) for a 1-D layout), passed to the connectivity generators of the projections.

Raises:
  • TypeError – If size is not an int or a tuple of ints, or name is not a str.

  • ValueError – If a size entry is not positive, name is empty, or positions does not have num rows.

See also

Projection, Network

Examples

>>> import numpy as np
>>> import brainunit as u
>>> from braintools.conn import Population
>>> grid = Population((10, 20), name='V1', positions=np.zeros((200, 2)) * u.um)
>>> grid.num
200
>>> grid
Population(name='V1', size=(10, 20))
property num: int#

Total number of neurons.