NNGT provides a database to store NEST simulations.
This database requires peewee>3
to work and can be switched on using:
nngt.set_config("use_database", True)
The commands are then used by calling nngt.database
to access the database
tools.
nngt.database.
get_results
(self, table, column=None, value=None)#Return the entries where the attribute column satisfies the required equality.
Parameters: |
|
---|---|
Returns: |
|
nngt.database.
is_clear
(self)#Check that the logs are clear.
nngt.database.
log_simulation_end
(self, network=None, log_activity=True)#Record the simulation completion and simulated times, save the data, then reset.
nngt.database.
log_simulation_start
(self, network, simulator)#Record the simulation start time, all nodes, connections, network, and computer properties, as well as some of simulation’s.
Parameters: |
|
---|
nngt.database.
reset
(self)#Reset log status.
nngt.database.log_simulation_start(net, "nest-2.14")
nest.Simulate(1000.)
nngt.database.log_simulation_end()
The database contains the following tables, associated to their respective fields:
Activity
,Computer
,Connection
,NeuralNetwork
,Neuron
,Simulation
,Synapse
.These tables are the first keyword passed to get_results()
,
you can find the existing columns for each of the tables in the following
classes descriptions:
Store results into a database
nngt.database.db_generation.
Activity
(*args, **kwargs)[source]#Class detailing the network’s simulated activity.
DoesNotExist
#alias of ActivityDoesNotExist
id
= <peewee.IntegerField object>#raster
= <nngt.database.pickle_field.PickledField object>#Raster of the simulated activity.
simulations
#nngt.database.db_generation.
Computer
(*args, **kwargs)[source]#Class containing informations about the conputer.
DoesNotExist
#alias of ComputerDoesNotExist
cores
= <peewee.IntegerField object>#Number of cores returned by psutil.cpu_count()
or -1
id
= <peewee.IntegerField object>#name
= <peewee.TextField object>#Name from platform.node()
or "unknown"
platform
= <peewee.TextField object>#System information from platform.platform()
python
= <peewee.TextField object>#Python version given by platform.python_version()
ram
= <peewee.IntegerField object>#Total memory given by psutil.virtual_memory().total
(long) or
-1
simulations
#nngt.database.db_generation.
Connection
(*args, **kwargs)[source]#Class detailing the existing connections in the network: a couple of pre- and post-synaptic neurons and a synapse.
DoesNotExist
#alias of ConnectionDoesNotExist
id
= <peewee.IntegerField object>#post
= <ForeignKeyField: "connection"."post">#post_id
= <ForeignKeyField: "connection"."post">#pre
= <ForeignKeyField: "connection"."pre">#pre_id
= <ForeignKeyField: "connection"."pre">#simulations
#synapse
= <ForeignKeyField: "connection"."synapse">#synapse_id
= <ForeignKeyField: "connection"."synapse">#nngt.database.db_generation.
NeuralNetwork
(*args, **kwargs)[source]#Class containing informations about the neural network.
DoesNotExist
#alias of NeuralNetworkDoesNotExist
compressed_file
= <nngt.database.db_generation.LongCompressedField object>#Compressed (bz2) string of the graph from str(graph)
; once
uncompressed, can be loaded using Graph.from_file(name,
from_string=True)
.
directed
= <peewee.IntegerField object>#Whether the graph is directed or not
edges
= <peewee.IntegerField object>#Number of edges.
id
= <peewee.IntegerField object>#network_type
= <peewee.TextField object>#Type of the network from Graph.type
nodes
= <peewee.IntegerField object>#Number of nodes.
simulations
#weight_distribution
= <peewee.TextField object>#Name of the weight_distribution used.
weighted
= <peewee.IntegerField object>#Whether the graph is weighted or not.
nngt.database.db_generation.
Neuron
(*args, **kwargs)[source]#Base class that will be modified to contain all the properties of the neurons used during a simulation.
DoesNotExist
#alias of NeuronDoesNotExist
id
= <peewee.IntegerField object>#int_connections
#out_connections
#nngt.database.db_generation.
Simulation
(*args, **kwargs)[source]#Class containing all informations about the simulation properties.
DoesNotExist
#alias of SimulationDoesNotExist
activity
= <ForeignKeyField: "simulation"."activity">#Activity table entry where the simulated activity is described.
activity_id
= <ForeignKeyField: "simulation"."activity">#completion_time
= <peewee.DateTimeField object>#Date and time at which the simulation ended.
computer
= <ForeignKeyField: "simulation"."computer">#Computer table entry where the computer used is defined.
computer_id
= <ForeignKeyField: "simulation"."computer">#connections
= <ForeignKeyField: "simulation"."connections">#Connection table entry where the connections are described.
connections_id
= <ForeignKeyField: "simulation"."connections">#grnd_seed
= <peewee.IntegerField object>#Master seed of the simulation.
id
= <peewee.IntegerField object>#local_seeds
= <nngt.database.pickle_field.PickledField object>#List of the local threads seeds.
network
= <ForeignKeyField: "simulation"."network">#Network table entry where the simulated network is described.
network_id
= <ForeignKeyField: "simulation"."network">#pop_sizes
= <nngt.database.pickle_field.PickledField object>#Pickled list containing the group sizes.
population
= <nngt.database.pickle_field.PickledField object>#Pickled list containing the neural group names.
resolution
= <peewee.FloatField object>#Timestep used to simulate the components of the neural network
simulated_time
= <peewee.FloatField object>#Virtual time that was simulated for the neural network.
simulator
= <peewee.TextField object>#Name of the neural simulator used (NEST, Brian…)
start_time
= <peewee.DateTimeField object>#Date and time at which the simulation started.