Graph container classesΒΆ

class nngt.SpatialGraph(nodes=0, name='Graph', weighted=True, directed=True, from_graph=None, shape=None, positions=None, **kwargs)[source]

The detailed class that inherits from Graph and implements additional properties to describe various biological functions and interact with the NEST simulator.

Variables:
  • shapeShape Shape of the neurons environment.
  • positionsnumpy.array Positions of the neurons.
  • graphGraphObject Main attribute of the class instance.
classmethod make_spatial(graph, shape=<nngt.core.graph_datastruct.Shape instance>, positions=None)[source]
position
shape
class nngt.Network(name='Graph', weighted=True, directed=True, from_graph=None, population=None, **kwargs)[source]

The detailed class that inherits from Graph and implements additional properties to describe various biological functions and interact with the NEST simulator.

Variables:
  • populationNeuralPop Object reparting the neurons into groups with specific properties.
  • graphGraphObject Main attribute of the class instance
  • nest_gidnumpy.array Array containing the NEST gid associated to each neuron; it is None until a NEST network has been created.
  • id_from_nest_gid – dict Dictionary mapping each NEST gid to the corresponding neuron index in the nngt.~Network
classmethod ei_network(size, ei_ratio=0.2, en_model='aeif_cond_alpha', en_param={}, es_model='static_synapse', es_param={}, in_model='aeif_cond_alpha', in_param={}, is_model='static_synapse', is_param={})[source]

Generate a network containing a population of two neural groups: inhibitory and excitatory neurons.

Parameters:
  • size (int) – Number of neurons in the network.
  • ei_ratio (double, optional (default: 0.2)) – Ratio of inhibitory neurons: \(\frac{N_i}{N_e+N_i}\).
  • en_model (string, optional (default: ‘aeif_cond_alpha’)) – Nest model for the excitatory neuron.
  • en_param (dict, optional (default: {})) – Dictionary of parameters for the the excitatory neuron.
  • es_model (string, optional (default: ‘static_synapse’)) – NEST model for the excitatory synapse.
  • es_param (dict, optional (default: {})) – Dictionary containing the excitatory synaptic parameters.
  • in_model (string, optional (default: ‘aeif_cond_alpha’)) – Nest model for the inhibitory neuron.
  • in_param (dict, optional (default: {})) – Dictionary of parameters for the the inhibitory neuron.
  • is_model (string, optional (default: ‘static_synapse’)) – NEST model for the inhibitory synapse.
  • is_param (dict, optional (default: {})) – Dictionary containing the inhibitory synaptic parameters.
Returns:

net (Network or subclass) – Network of disconnected excitatory and inhibitory neurons.

static make_network(graph, neural_pop)[source]

Turn a Graph object into a Network, or a SpatialGraph into a SpatialNetwork.

Parameters:

Notes

In-place operation that directly converts the original graph.

nest_gid
neuron_properties(idx_neuron)[source]

Properties of a neuron in the graph.

Parameters:idx_neuron (int) – Index of a neuron in the graph.
Returns:dict of the neuron properties.
classmethod num_networks()[source]

Returns the number of alive instances.

population

NeuralPop that divides the neurons into groups with specific properties.

classmethod uniform_network(size, neuron_model='aeif_cond_alpha', neuron_param={}, syn_model='static_synapse', syn_param={})[source]

Generate a network containing only one type of neurons.

Parameters:
  • size (int) – Number of neurons in the network.
  • neuron_model (string, optional (default: ‘aief_cond_alpha’)) – Name of the NEST neural model to use when simulating the activity.
  • neuron_param (dict, optional (default: {})) – Dictionary containing the neural parameters; the default value will make NEST use the default parameters of the model.
  • syn_model (string, optional (default: ‘static_synapse’)) – NEST synaptic model to use when simulating the activity.
  • syn_param (dict, optional (default: {})) – Dictionary containing the synaptic parameters; the default value will make NEST use the default parameters of the model.
Returns:

net (Network or subclass) – Uniform network of disconnected neurons.

class nngt.SpatialNetwork(population, name='Graph', weighted=True, directed=True, shape=None, from_graph=None, positions=None, **kwargs)[source]

Class that inherits from Network and SpatialGraph to provide a detailed description of a real neural network in space, i.e. with positions and biological properties to interact with NEST.

Variables:
  • shapenngt.core.Shape Shape of the neurons environment.
  • positionsnumpy.array Positions of the neurons.
  • populationNeuralPop Object reparting the neurons into groups with specific properties.
  • graphGraphObject Main attribute of the class instance.
  • nest_gidnumpy.array Array containing the NEST gid associated to each neuron; it is None until a NEST network has been created.
  • id_from_nest_gid – dict Dictionary mapping each NEST gid to the corresponding neuron index in the nngt.~SpatialNetwork