pynn_brainscales.brainscales2.projections.Assembly

class pynn_brainscales.brainscales2.projections.Assembly(*populations, **kwargs)

Bases: object

A group of neurons, may be heterogeneous, in contrast to a Population where all the neurons are of the same type.

Arguments:
populations:

Populations or PopulationViews

kwargs:

May contain a keyword argument ‘label’

__init__(*populations, **kwargs)

Create an Assembly of Populations and/or PopulationViews.

Methods

__init__(*populations, **kwargs)

Create an Assembly of Populations and/or PopulationViews.

all()

Iterator over cell ids on all nodes.

describe([template, engine])

Returns a human-readable description of the assembly.

find_units(variable)

Returns units of the specified variable or parameter, as a string.

get(parameter_names[, gather, simplify])

Get the values of the given parameters for every local cell in the Assembly, or, if gather=True, for all cells in the Assembly.

getSpikes(**kwargs)

Deprecated.

get_annotations(annotation_keys[, simplify])

Get the values of the given annotations for each population in the Assembly.

get_data([variables, gather, clear, annotations])

Return a Neo Block containing the data (spikes, state variables) recorded from the Assembly.

get_gsyn(**kwargs)

Deprecated.

get_population(label)

Return the Population/PopulationView from within the Assembly that has the given label.

get_spike_counts([gather])

Returns the number of spikes for each neuron.

get_v(**kwargs)

Deprecated.

id_to_index(id)

Given the ID(s) of cell(s) in the Assembly, return its (their) index (order in the Assembly).

initialize(**initial_values)

Set the initial values of the state variables of the neurons in this assembly.

inject(current_source)

Connect a current source to all cells in the Assembly.

mean_spike_count([gather])

Returns the mean number of spikes per neuron.

printSpikes(**kwargs)

Deprecated.

print_gsyn(**kwargs)

Deprecated.

print_v(**kwargs)

Deprecated.

record(variables[, to_file, sampling_interval])

Record the specified variable or variables for all cells in the Assembly.

record_gsyn(**kwargs)

Deprecated.

record_v(**kwargs)

Deprecated.

rset(**kwargs)

Deprecated.

sample(n[, rng])

Randomly sample n cells from the Assembly, and return a Assembly object.

save_positions(file)

Save positions to file.

set(**parameters)

Set one or more parameters for every cell in the Assembly.

write_data(io[, variables, gather, clear, …])

Write recorded data to file, using one of the file formats supported by Neo.

Attributes

all_cells

conductance_based

True if the post-synaptic response is modelled as a change in conductance, False if a change in current.

first_id

injectable

last_id

local_cells

position_generator

positions

receptor_types

Return a list of receptor types that are common to all populations within the assembly.

size

all()

Iterator over cell ids on all nodes.

property all_cells
property conductance_based

True if the post-synaptic response is modelled as a change in conductance, False if a change in current.

describe(template='assembly_default.txt', engine='default')

Returns a human-readable description of the assembly.

The output may be customized by specifying a different template togther with an associated template engine (see pyNN.descriptions).

If template is None, then a dictionary containing the template context will be returned.

find_units(variable)

Returns units of the specified variable or parameter, as a string. Works for all the recordable variables and neuron parameters of all standard models.

property first_id
get(parameter_names, gather=False, simplify=True)

Get the values of the given parameters for every local cell in the Assembly, or, if gather=True, for all cells in the Assembly.

getSpikes(**kwargs)

Deprecated. Use get_data('spikes') instead.

get_annotations(annotation_keys, simplify=True)

Get the values of the given annotations for each population in the Assembly.

get_data(variables='all', gather=True, clear=False, annotations=None)

Return a Neo Block containing the data (spikes, state variables) recorded from the Assembly.

variables - either a single variable name or a list of variable names

Variables must have been previously recorded, otherwise an Exception will be raised.

For parallel simulators, if gather is True, all data will be gathered to all nodes and the Neo Block will contain data from all nodes. Otherwise, the Neo Block will contain only data from the cells simulated on the local node.

If clear is True, recorded data will be deleted from the Assembly.

get_gsyn(**kwargs)

Deprecated. Use get_data(['gsyn_exc', 'gsyn_inh']) instead.

get_population(label)

Return the Population/PopulationView from within the Assembly that has the given label. If no such Population exists, raise KeyError.

get_spike_counts(gather=True)

Returns the number of spikes for each neuron.

get_v(**kwargs)

Deprecated. Use get_data('v') instead.

id_to_index(id)

Given the ID(s) of cell(s) in the Assembly, return its (their) index (order in the Assembly):

>>> assert p.id_to_index(p[5]) == 5
>>> assert p.id_to_index(p.index([1, 2, 3])) == [1, 2, 3]
initialize(**initial_values)

Set the initial values of the state variables of the neurons in this assembly.

inject(current_source)

Connect a current source to all cells in the Assembly.

property injectable
property last_id
property local_cells
mean_spike_count(gather=True)

Returns the mean number of spikes per neuron.

property position_generator
property positions
printSpikes(**kwargs)

Deprecated. Use write_data(file, 'spikes') instead.

print_gsyn(**kwargs)

Deprecated. Use write_data(['gsyn_exc', 'gsyn_inh']) instead.

print_v(**kwargs)

Deprecated. Use write_data(file, 'v') instead.

property receptor_types

Return a list of receptor types that are common to all populations within the assembly.

record(variables, to_file=None, sampling_interval=None)

Record the specified variable or variables for all cells in the Assembly.

variables may be either a single variable name or a list of variable names. For a given celltype class, celltype.recordable contains a list of variables that can be recorded for that celltype.

If specified, to_file should be either a filename or a Neo IO instance and write_data() will be automatically called when end() is called.

record_gsyn(**kwargs)

Deprecated. Use record(['gsyn_exc', 'gsyn_inh']) instead.

record_v(**kwargs)

Deprecated. Use record('v') instead.

rset(**kwargs)

Deprecated. Use set(parametername=rand_distr) instead.

sample(n, rng=None)

Randomly sample n cells from the Assembly, and return a Assembly object.

save_positions(file)

Save positions to file. The output format is id x y z

set(**parameters)

Set one or more parameters for every cell in the Assembly.

Values passed to set() may be:
  1. single values

  2. RandomDistribution objects

  3. mapping functions, where a mapping function accepts a single argument (the cell index) and returns a single value.

Here, a “single value” may be either a single number or a list/array of numbers (e.g. for spike times).

property size
write_data(io, variables='all', gather=True, clear=False, annotations=None)

Write recorded data to file, using one of the file formats supported by Neo.

io:

a Neo IO instance

variables:

either a single variable name or a list of variable names. Variables must have been previously recorded, otherwise an Exception will be raised.

For parallel simulators, if gather is True, all data will be gathered to the master node and a single output file created there. Otherwise, a file will be written on each node, containing only data from the cells simulated on that node.

If clear is True, recorded data will be deleted from the Population.