nest.tests package

Submodules

nest.tests.compatibility module

nest.tests.test_aeif_lsodar module

class nest.tests.test_aeif_lsodar.AEIFTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Check the coherence between reference solution and NEST implementation.

assert_pass_tolerance(rel_diff, di_tol)[source]

Test that relative differences are indeed smaller than the tolerance.

compute_difference(multimeters, params, reference, recordables)[source]

Compute the relative differences between the values recorded by the multimeter and those of the reference (recorded at same times).

multimeters : dict of tuples
Dictionary containing the model name as key and the GID of the associated multimeter as value.
params : dict
Parameters used for the models.
reference : dict
Reference arrays (one per entry in recordables).
recordables : list of strings
List of recordables that will be compared.
rel_diff : dict of dict of doubles
Relative differences between recorded data and reference (one dict per model, containing one value per entry in recordables).
setUp()[source]

Clean up and initialize NEST before each test.

test_closeness_nest_lsodar()[source]
test_iaf_dc_input()[source]
test_iaf_spike_input()[source]
nest.tests.test_aeif_lsodar.run()[source]
nest.tests.test_aeif_lsodar.suite()[source]

nest.tests.test_all module

nest.tests.test_all.suite()[source]

nest.tests.test_connect_all_patterns module

class nest.tests.test_connect_all_patterns.TestConnectAllPatterns(methodName='runTest')[source]

Bases: unittest.case.TestCase

testWithMPI()[source]

nest.tests.test_connect_all_to_all module

class nest.tests.test_connect_all_to_all.TestAllToAll(methodName='runTest')[source]

Bases: nest.tests.test_connect_parameters.TestParams

N1 = 6
N1_array = 500
N2 = 7
N2_array = 10
conn_dict = {'rule': 'all_to_all'}
rule = 'all_to_all'
testConnectivity()[source]
testInputArray()[source]
testInputArrayRPort()[source]
testInputArrayToStdpSynapse()[source]
testInputArrayWithoutAutapses()[source]
testRPortDistribution()[source]
nest.tests.test_connect_all_to_all.run()[source]
nest.tests.test_connect_all_to_all.suite()[source]

nest.tests.test_connect_array_fixed_indegree module

Tests of connection with rule fixed_indegree and parameter arrays in syn_spec

class nest.tests.test_connect_array_fixed_indegree.ConnectArrayFixedIndegreeTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Tests of connections with fixed indegree and parameter arrays

test_Connect_Array_Fixed_Indegree()[source]

Tests of connections with fixed indegree and parameter arrays

nest.tests.test_connect_array_fixed_indegree.run()[source]
nest.tests.test_connect_array_fixed_indegree.suite()[source]

nest.tests.test_connect_array_fixed_outdegree module

Tests of connection with rule fixed_outdegree and parameter arrays in syn_spec

class nest.tests.test_connect_array_fixed_outdegree.ConnectArrayFixedOutdegreeTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Tests of connections with fixed outdegree and parameter arrays

test_Connect_Array_Fixed_Outdegree()[source]

Tests of connections with fixed outdegree and parameter arrays

nest.tests.test_connect_array_fixed_outdegree.run()[source]
nest.tests.test_connect_array_fixed_outdegree.suite()[source]

nest.tests.test_connect_distributions module

class nest.tests.test_connect_distributions.TestDists(methodName='runTest')[source]

Bases: unittest.case.TestCase

Ndist1 = 40
Ndist2 = 40
conn_dict = {'rule': 'all_to_all'}
label = 'weight'
model = 'static_synapse'
pval = 0.05
rule = 'all_to_all'
setUp()[source]

Hook method for setting up the test fixture before exercising it.

setUpNetwork(conn_params=None, syn_dict=None)[source]
syn_dict = {'model': 'static_synapse'}
testBinomialClippedDist()[source]
testBinomialDist()[source]
testExponentialClippedDist()[source]
testExponentialDist()[source]
testGammaClippedDist()[source]
testGammaDist()[source]
testGslBinomialDist()[source]
testLognormalClippedDist()[source]
testLognormalDist()[source]
testNormalClippedDist()[source]
testNormalDist()[source]
testPoissonClippedDist()[source]
testPoissonDist()[source]
testUniformDist()[source]
testUniformIntDist()[source]

nest.tests.test_connect_fixed_indegree module

class nest.tests.test_connect_fixed_indegree.TestFixedInDegree(methodName='runTest')[source]

Bases: nest.tests.test_connect_parameters.TestParams

C = 10
N1 = 50
N2 = 70
N_s = 10
N_t = 10
Nin = 10
conn_dict = {'indegree': 10, 'rule': 'fixed_indegree'}
rule = 'fixed_indegree'
stat_dict = {'alpha2': 0.05, 'n_runs': 50}
testAutapsesFalse()[source]
testAutapsesTrue()[source]
testErrorMessages()[source]
testInDegree()[source]
testMultapsesFalse()[source]
testMultapsesTrue()[source]
testStatistics()[source]
nest.tests.test_connect_fixed_indegree.run()[source]
nest.tests.test_connect_fixed_indegree.suite()[source]

nest.tests.test_connect_fixed_outdegree module

class nest.tests.test_connect_fixed_outdegree.TestFixedOutDegree(methodName='runTest')[source]

Bases: nest.tests.test_connect_parameters.TestParams

C = 10
N1 = 50
N2 = 70
N_s = 10
N_t = 10
Nout = 10
conn_dict = {'outdegree': 10, 'rule': 'fixed_outdegree'}
rule = 'fixed_outdegree'
stat_dict = {'alpha2': 0.05, 'n_runs': 100}
testAutapsesFalse()[source]
testAutapsesTrue()[source]
testErrorMessages()[source]
testMultapsesFalse()[source]
testMultapsesTrue()[source]
testOutDegree()[source]
testStatistics()[source]
nest.tests.test_connect_fixed_outdegree.run()[source]
nest.tests.test_connect_fixed_outdegree.suite()[source]

nest.tests.test_connect_fixed_total_number module

class nest.tests.test_connect_fixed_total_number.TestFixedTotalNumber(methodName='runTest')[source]

Bases: nest.tests.test_connect_parameters.TestParams

N = 100
N1 = 50
N2 = 70
N_s = 20
N_t = 20
Nconn = 100
conn_dict = {'N': 100, 'rule': 'fixed_total_number'}
rule = 'fixed_total_number'
stat_dict = {'alpha2': 0.05, 'n_runs': 150}
testAutapsesFalse()[source]
testAutapsesTrue()[source]
testErrorMessages()[source]
testStatistics()[source]
testTotalNumberOfConnections()[source]
nest.tests.test_connect_fixed_total_number.run()[source]
nest.tests.test_connect_fixed_total_number.suite()[source]

nest.tests.test_connect_helpers module

nest.tests.test_connect_helpers.adaptive_check(stat_dict, degrees, expected)[source]

Create a single network using fixed in/outdegrees and run a chi-squared GOF test on the connection distribution. If the result is extreme (high or low), run a two-level test.

test : Instance of RCC_tester or RDC_tester class. n_runs: If chi-square test fails, test is repeated n_runs times,

and the KS test is used to analyze results.
boolean value. True if test was passed, False otherwise.
nest.tests.test_connect_helpers.all_equal(x)[source]

Tests if all elements in a list are equal. Returns True or False

nest.tests.test_connect_helpers.check_ks(pop1, pop2, label, alpha, params)[source]
nest.tests.test_connect_helpers.check_synapse(params, values, syn_params, TestCase)[source]
nest.tests.test_connect_helpers.chi_squared_check(degrees, expected, distribution=None)[source]

Create a single network and compare the resulting degree distribution with the expected distribution using Pearson’s chi-squared GOF test.

seed : PRNG seed value. control: Boolean value. If True, _generate_multinomial_degrees will

be used instead of _get_degrees.
chi-squared statistic. p-value from chi-squared test.
nest.tests.test_connect_helpers.counter(x, fan, source_pop, target_pop)[source]

Count similar elements in list.

x: Any list.
list containing counts of similar elements.
nest.tests.test_connect_helpers.gather_data(data_array)[source]

Gathers data from all mpi processes by collecting all element in a list if data is a list and summing all elements to one numpy-array if data is one numpy-array. Returns gathered data if rank of current mpi node is zero and None otherwise.

nest.tests.test_connect_helpers.get_clipped_cdf(params)[source]
nest.tests.test_connect_helpers.get_connectivity_matrix(pop1, pop2)[source]

Returns a connectivity matrix describing all connections from pop1 to pop2 such that M_ij describes the connection between the jth neuron in pop1 to the ith neuron in pop2.

nest.tests.test_connect_helpers.get_degrees(fan, pop1, pop2)[source]
nest.tests.test_connect_helpers.get_expected_degrees_bernoulli(p, fan, len_source_pop, len_target_pop)[source]

Calculate expected degree distribution.

Degrees with expected number of observations below e_min are combined into larger bins.

2D array. The four columns contain degree, expected number of observation, actual number observations, and the number of bins combined.
nest.tests.test_connect_helpers.get_expected_degrees_fixedDegrees(N, fan, len_source_pop, len_target_pop)[source]
nest.tests.test_connect_helpers.get_expected_degrees_totalNumber(N, fan, len_source_pop, len_target_pop)[source]
nest.tests.test_connect_helpers.get_expected_freqs(params, x, N)[source]
nest.tests.test_connect_helpers.get_weighted_connectivity_matrix(pop1, pop2, label)[source]

Returns a weighted connectivity matrix describing all connections from pop1 to pop2 such that M_ij describes the connection between the jth neuron in pop1 to the ith neuron in pop2. Only works without multapses.

nest.tests.test_connect_helpers.is_array(data)[source]

Returns True if data is a list or numpy-array and False otherwise.

nest.tests.test_connect_helpers.mpi_assert(data_original, data_test, TestCase)[source]

Compares data_original and data_test using assertTrue from the TestCase.

nest.tests.test_connect_helpers.mpi_barrier()[source]
nest.tests.test_connect_helpers.reset_seed(seed, nr_threads)[source]

Reset the simulator and seed the PRNGs.

seed: PRNG seed value.
nest.tests.test_connect_helpers.two_level_check(n_runs, degrees, expected, verbose=True)[source]

Create a network and run chi-squared GOF test n_runs times. Test whether resulting p-values are uniformly distributed on [0, 1] using the Kolmogorov-Smirnov GOF test.

n_runs : Number of times to repeat chi-squared test. start_seed: First PRNG seed value. control : Boolean value. If True, _generate_multinomial_degrees

will be used instead of _get_degrees.

verbose : Boolean value, determining whether to print progress.

KS statistic. p-value from KS test.

nest.tests.test_connect_one_to_one module

class nest.tests.test_connect_one_to_one.TestOneToOne(methodName='runTest')[source]

Bases: nest.tests.test_connect_parameters.TestParams

N = 6
N1 = 6
N2 = 6
N_array = 1000
conn_dict = {'rule': 'one_to_one'}
rule = 'one_to_one'
testConnectivity()[source]
testInputArray()[source]
testInputArrayRPort()[source]
testInputArrayToStdpSynapse()[source]
testSymmetricFlag()[source]
nest.tests.test_connect_one_to_one.run()[source]
nest.tests.test_connect_one_to_one.suite()[source]

nest.tests.test_connect_pairwise_bernoulli module

class nest.tests.test_connect_pairwise_bernoulli.TestPairwiseBernoulli(methodName='runTest')[source]

Bases: nest.tests.test_connect_parameters.TestParams

N_s = 50
N_t = 50
conn_dict = {'p': 0.5, 'rule': 'pairwise_bernoulli'}
p = 0.5
rule = 'pairwise_bernoulli'
stat_dict = {'alpha2': 0.05, 'n_runs': 20}
testAutapsesFalse()[source]
testAutapsesTrue()[source]
testStatistics()[source]
nest.tests.test_connect_pairwise_bernoulli.run()[source]
nest.tests.test_connect_pairwise_bernoulli.suite()[source]

nest.tests.test_connect_parameters module

Tests of non pattern specific parameter. The tests for all rules will run these tests separately.

class nest.tests.test_connect_parameters.TestParams(methodName='runTest')[source]

Bases: unittest.case.TestCase

N1 = 6
N2 = 6
conn_dict = {'rule': 'one_to_one'}
d0 = 1.0
dt = 0.1
nr_threads = 2
pval = 0.05
r0 = 0
rule = 'one_to_one'
setUp()[source]

Hook method for setting up the test fixture before exercising it.

setUpNetwork(conn_dict=None, syn_dict=None, N1=None, N2=None)[source]
setUpNetworkOnePop(conn_dict=None, syn_dict=None, N=None)[source]
syn0 = 'static_synapse'
testAutapsesFalse()[source]
testAutapsesTrue()[source]
testDefaultParams()[source]
testDelayAllSynapses()[source]
testDelaySetting()[source]
testHtSynapse()[source]
testQuantalStpSynapse()[source]
testRPortAllSynapses()[source]
testRPortSetting()[source]
testStdpDopamineSynapse()[source]
testStdpFacetshwSynapseHom()[source]
testStdpPlSynapseHom()[source]
testStdpSynapse()[source]
testStdpSynapseHom()[source]
testSynapseSetting()[source]
testTsodyks2Synapse()[source]
testTsodyksSynapse()[source]
testWeightAllSynapses()[source]
testWeightSetting()[source]
w0 = 1.0

nest.tests.test_connect_symmetric_pairwise_bernoulli module

class nest.tests.test_connect_symmetric_pairwise_bernoulli.TestSymmetricPairwiseBernoulli(methodName='runTest')[source]

Bases: nest.tests.test_connect_parameters.TestParams

N_s = 60
N_t = 60
conn_dict = {'autapses': False, 'make_symmetric': True, 'multapses': True, 'p': 0.5, 'rule': 'symmetric_pairwise_bernoulli'}
p = 0.5
rule = 'symmetric_pairwise_bernoulli'
stat_dict = {'alpha2': 0.05, 'n_runs': 20}
testAutapsesFalse()[source]
testAutapsesTrue()[source]
testMakeSymmetric()[source]
testMultapses()[source]
testStatistics()[source]
nest.tests.test_connect_symmetric_pairwise_bernoulli.run()[source]
nest.tests.test_connect_symmetric_pairwise_bernoulli.suite()[source]

nest.tests.test_create module

Creation tests

class nest.tests.test_create.CreateTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Creation tests

test_CopyModel()[source]

CopyModel

test_ModelCreate()[source]

Model Creation

test_ModelCreateN()[source]

Model Creation with N

test_ModelCreateNdict()[source]

Model Creation with N and dict

test_ModelDicts()[source]

IAF Creation with N and dicts

nest.tests.test_create.run()[source]
nest.tests.test_create.suite()[source]

nest.tests.test_csa module

CSA tests

class nest.tests.test_csa.CSATestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

CSA tests

test_CSA_OneToOne_intvectors()[source]

One-to-one connectivity using CGConnect with id intvectors

test_CSA_OneToOne_params()[source]

One-to-one connectivity using CGConnect with paramters

test_CSA_OneToOne_synmodel()[source]

One-to-one connectivity using CGConnect with synmodel

test_CSA_OneToOne_tuples()[source]

One-to-one connectivity using CGConnect with id tuples

test_CSA_error_unknown_nodes()[source]

Error handling of CGConnect in case of unknown nodes

test_CSA_error_unknown_synapse()[source]

Error handling of CGConnect in case of unknown synapse model

nest.tests.test_csa.run()[source]
nest.tests.test_csa.suite()[source]

nest.tests.test_current_recording_generators module

Test if currents from generators are being recorded properly

class nest.tests.test_current_recording_generators.CurrentRecordingGeneratorTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Test if currents from generators are recorded properly. Specifically: 1) Length of current vector should be equal to length of membrane

potential vector
  1. Value of current should be equal to zero when device is inactive
  2. Check if value of current recorded as expected during active period
setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_GetRecordables()[source]

Check get recordables

test_RecordedCurrentVectors()[source]

Check the length and contents of recorded current vectors

nest.tests.test_current_recording_generators.run()[source]
nest.tests.test_current_recording_generators.suite()[source]

nest.tests.test_dataconnect module

DataConnect

class nest.tests.test_dataconnect.DataConnectTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Find connections and test if values can be set.

test_DataConnect()[source]

DataConnect

nest.tests.test_dataconnect.run()[source]
nest.tests.test_dataconnect.suite()[source]

nest.tests.test_erfc_neuron module

Test implementation of erfc-neuron.

class nest.tests.test_erfc_neuron.ErfcNeuronTheoryTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Compare results to theoretical predictions

build_and_connect_nodes(sigma, theta)[source]

sets up an erfc neuron and spin detector.

setUp()[source]

defines parameters of simulation

test_activation_function()[source]

simulates erfc neuron for different parameter sets and compares activity to theoretical value.

nest.tests.test_erfc_neuron.activation_function_theory(sigma, theta)[source]

returns the probability for a binary neuron to be in the up state, given the parameters sigma and theta.

nest.tests.test_erfc_neuron.get_mean_activity(detector, T)[source]

returns the mean activity of a single binary neuron connected to a spin detector.

nest.tests.test_erfc_neuron.run()[source]
nest.tests.test_erfc_neuron.suite()[source]

nest.tests.test_errors module

Tests for error handling

class nest.tests.test_errors.ErrorTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Tests if errors are handled correctly

test_DivisionByZero()[source]

Division by zero

test_Raise()[source]

Error raising

test_StackUnderFlow()[source]

Stack underflow

test_UnknownModel()[source]

Unknown model name

test_UnknownNode()[source]

Unknown node

nest.tests.test_errors.run()[source]
nest.tests.test_errors.suite()[source]

nest.tests.test_events module

Test of events

class nest.tests.test_events.EventsTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Tests of the Connect API

test_EventsSpikes()[source]

Spike Events

test_EventsVoltage()[source]

Voltage Events

test_Events_1()[source]

Recorder Events

nest.tests.test_events.suite()[source]

nest.tests.test_facetshw_stdp module

class nest.tests.test_facetshw_stdp.FacetsTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

This script is testing the accumulation of spike pairs and the weight update mechanism as implemented in the FACETS hardware.

Author: Thomas Pfeil Date of first version: 21.01.2013

test_facetshw_stdp()[source]
nest.tests.test_facetshw_stdp.run()[source]
nest.tests.test_facetshw_stdp.suite()[source]

nest.tests.test_getconnections module

GetConnections

class nest.tests.test_getconnections.GetConnectionsTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Find connections and test if values can be set.

test_GetConnections()[source]

GetConnections

nest.tests.test_getconnections.run()[source]
nest.tests.test_getconnections.suite()[source]

nest.tests.test_helper_functions module

class nest.tests.test_helper_functions.TestHelperFunctions(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_get_verbosity()[source]
test_set_verbosity()[source]
test_stack_checker()[source]
nest.tests.test_helper_functions.suite()[source]

nest.tests.test_labeled_synapses module

Test setting and getting labels on synapses.

class nest.tests.test_labeled_synapses.LabeledSynapsesTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Test labeled synapses

default_network(syn_model)[source]
test_GetLabeledSynapses()[source]

Get labeled synapses with GetConnections.

test_SetLabelToNotLabeledSynapse()[source]

Try set a label to an ‘un-label-able’ synapse.

test_SetLabelToSynapseOnConnect()[source]

Set a label to a labeled synapse on connect.

test_SetLabelToSynapseSetDefaults()[source]

Set a label to a labeled synapse on SetDefaults.

test_SetLabelToSynapseSetStatus()[source]

Set a label to a labeled synapse on SetStatus.

nest.tests.test_labeled_synapses.run()[source]
nest.tests.test_labeled_synapses.suite()[source]

nest.tests.test_mc_neuron module

class nest.tests.test_mc_neuron.TestMCNeuron(methodName='runTest')[source]

Bases: unittest.case.TestCase

I0 = 5000
I1 = 5020
I_e = 150.0
V_reset = -65.0
V_th = -60.0
Vm_dist_test = array([-70.0003797 , -70.00037554, -70.00037143, -70.00036737, -70.00036335, -70.00035938, -70.00035545, -70.00035157, -70.00034773, -70.00034393, -70.00033573, -70.00030289, -70.00022565, -70.00008895, -69.99988167, -69.99959601, -69.99922696, -69.9987718 , -69.9982297 , -69.99760137])
Vm_prox_test = array([-70.00041394, -70.00041065, -70.00040738, -70.00040414, -70.00040093, -70.00039774, -70.00039457, -70.00039143, -70.00038832, -70.00038523, -69.98857137, -69.95638129, -69.90815375, -69.84758846, -69.77782368, -69.70150641, -69.62085572, -69.53771917, -69.45362308, -69.36981694])
Vm_soma_test = array([-70.00033871, -70.00033626, -70.00033383, -70.00033141, -70.00032901, -70.00032662, -70.00032426, -70.00032191, -70.00031957, -70.00031725, -70.00030162, -70.00021189, -69.99998874, -69.99958683, -69.99897263, -69.99812256, -69.99702137, -69.99566068, -69.99403779, -69.99215463])
distal = {'C_m': 90.0}
g_sp = 5.0
gex_dist_test = array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])
gex_prox_test = array([0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0.24596033, 0.44510821, 0.60412585, 0.72884756, 0.82436068, 0.89509487, 0.94490122, 0.97712226, 0.99465388, 1.00000005])
gex_soma_test = array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])
proximal = {'tau_syn_ex': 1.0, 'tau_syn_in': 5.0}
rec_dic_dc_distal = {'amplitude': 100.0, 'start': 50.0, 'stop': 100.0}
rec_dic_dc_proximal = {'amplitude': -50.0, 'start': 150.0, 'stop': 200.0}
rec_dic_dc_soma = {'amplitude': 50.0, 'start': 250.0, 'stop': 300.0}
rec_sp_dist_ex = [400.0, 420.0]
rec_sp_dist_in = [410.0, 430.0]
rec_sp_prox_ex = [500.0, 520.0]
rec_sp_prox_in = [510.0, 530.0]
rec_sp_soma_ex = [600.0, 620.0]
rec_sp_soma_in = [610.0, 630.0]
setUp()[source]

Hook method for setting up the test fixture before exercising it.

setUpNetwork()[source]
setUpNodes()[source]
soma = {'g_L': 12.0}
t0 = 700
t_ref = 10.0
t_stim = 300
tau_syn_ex = 1.0
tau_syn_in = 5.0
testNeuron()[source]

nest.tests.test_networks module

Network tests

class nest.tests.test_networks.NetworkTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Network tests

test_BeginEndSubnet()[source]

Begin/End Subnet

test_CurrentSubnet()[source]

Current Subnet

test_GetChildren()[source]

GetChildren

test_GetLeaves()[source]

GetLeaves

test_GetNetwork()[source]

GetNetwork

test_GetNodes()[source]

GetNodes

nest.tests.test_networks.run()[source]
nest.tests.test_networks.suite()[source]

nest.tests.test_onetooneconnect module

UnitTests for the PyNEST connect API.

class nest.tests.test_onetooneconnect.OneToOneConnectTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Tests of Connect with OneToOne pattern

test_ConnectPrePost()[source]

Connect pre to post

test_ConnectPrePostParams()[source]

Connect pre to post with a params dict

test_ConnectPrePostWD()[source]

Connect pre to post with a weight and delay

test_IllegalConnection()[source]

Wrong Connections

test_UnexpectedEvent()[source]

Unexpected Event

nest.tests.test_onetooneconnect.run()[source]
nest.tests.test_onetooneconnect.suite()[source]

nest.tests.test_parrot_neuron module

class nest.tests.test_parrot_neuron.ParrotNeuronPoissonTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Check parrot_neuron spike repetition properties

test_ParrotNeuronIncomingMultiplicity()[source]

Check parrot_neuron heeds multiplicity information in incoming spikes.

This test relies on the fact that poisson_generator transmits multiple spikes during a time step using multiplicity, and that these spikes are delivered directly, i.e., without multiplicity- unrolling in send_remote().

We create a high-rate poisson_generator. If parrot_neuron ignored multiplicity, it would only transmit one spike per time step. We chain two parrot_neurons to check against any loss.

class nest.tests.test_parrot_neuron.ParrotNeuronSTDPTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Check STDP protocol between two parrot_neurons connected by a stdp_synapse. Exact pre- and post-synaptic spike times are set by spike_generators connected to each parrot neuron. Additional spikes sent through the stdp_synapse are explicitly ignored in the postsynaptic parrot_neuron by setting the stdp_synapse to connect to port 1.

run_protocol(dt)[source]

Set up a network with pre-post spike pairings with t_post - t_pre = dt

test_ParrotNeuronSTDPProtocolDepression()[source]

Check post-pre spike pairings between parrot_neurons decrement weights.

test_ParrotNeuronSTDPProtocolPotentiation()[source]

Check pre-post spike pairings between parrot_neurons increments weights.

class nest.tests.test_parrot_neuron.ParrotNeuronTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Check parrot_neuron spike repetition properties

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_ParrotNeuronIgnoreSpike()[source]

Check parrot_neuron ignores spikes on port 1

test_ParrotNeuronOutgoingMultiplicity()[source]

Check parrot_neuron correctly repeats multiple spikes

The parrot_neuron receives two spikes in a single time step. We check that both spikes are forwarded to the spike_detector.

test_ParrotNeuronRepeatSpike()[source]

Check parrot_neuron repeats spikes on port 0

nest.tests.test_parrot_neuron.run()[source]
nest.tests.test_parrot_neuron.suite()[source]

nest.tests.test_parrot_neuron_ps module

class nest.tests.test_parrot_neuron_ps.ParrotNeuronPSPoissonTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Check parrot_neuron spike repetition properties

test_ParrotNeuronIncomingMultiplicity()[source]

Check parrot_neuron heeds multiplicity information in incoming spikes.

This test relies on the fact that poisson_generator transmits multiple spikes during a time step using multiplicity, and that these spikes are delivered directly, i.e., without multiplicity- unrolling in send_remote().

We create a high-rate poisson_generator. If parrot_neuron ignored multiplicity, it would only transmit one spike per time step. We chain two parrot_neurons to check against any loss.

Note: Even though we test parrot_neuron_ps, we drive it with the plain poisson_generator, since only that generator uses multiplicity.

class nest.tests.test_parrot_neuron_ps.ParrotNeuronPSSTDPTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Check STDP protocol between two parrot_neurons_ps connected by a stdp_synapse. Exact pre- and post-synaptic spike times are set by spike_generators connected to each parrot neuron. Additional spikes sent through the stdp_synapse are explicitly ignored in the postsynaptic parrot_neuron_ps by setting the stdp_synapse to connect to port 1.

run_protocol(dt)[source]

Set up a network with pre-post spike pairings with t_post - t_pre = dt

test_ParrotNeuronSTDPProtocolDepression()[source]

Check post-pre spike pairings between parrot_neurons decrement weights.

test_ParrotNeuronSTDPProtocolPotentiation()[source]

Check pre-post spike pairings between parrot_neurons increments weights.

class nest.tests.test_parrot_neuron_ps.ParrotNeuronPSTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Check parrot_neuron spike repetition properties

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_ParrotNeuronIgnoreSpike()[source]

Check parrot_neuron ignores spikes on port 1

test_ParrotNeuronOutgoingMultiplicity()[source]

Check parrot_neuron correctly repeats multiple spikes

The parrot_neuron receives two spikes in a single time step. We check that both spikes are forwarded to the spike_detector.

test_ParrotNeuronRepeatSpike()[source]

Check parrot_neuron repeats spikes on port 0

nest.tests.test_parrot_neuron_ps.run()[source]
nest.tests.test_parrot_neuron_ps.suite()[source]

nest.tests.test_pp_psc_delta module

class nest.tests.test_pp_psc_delta.PpPscDeltaTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Tests for pp_psc_delta

test_adapting_threshold()[source]

Check if threshold adaptation works by looking for negative serial correlation of ISI.

test_random_dead_time()[source]

Check if random dead-time moments are respected.

test_rate_and_fixed_dead_time()[source]

Check for reasonable firing rate and if fixed dead-time is respected

nest.tests.test_pp_psc_delta.run()[source]
nest.tests.test_pp_psc_delta.suite()[source]

nest.tests.test_pp_psc_delta_stdp module

class nest.tests.test_pp_psc_delta_stdp.PpPscDeltaSTDPTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Regressiontest to reproduce failure of pp_psc_delta to show spike timing dependent plasticity (STDP), as opposed to iaf_psc_delta. The problem is probably related to the setting of ‘archiver_length’.

Moritz Deger, moritz.deger@epfl.ch, Aug 14, 2015

test_pp_psc_delta_stdp()[source]
nest.tests.test_pp_psc_delta_stdp.suite()[source]

nest.tests.test_quantal_stp_synapse module

class nest.tests.test_quantal_stp_synapse.QuantalSTPSynapseTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Compare quantal_stp_synapse with its deterministic equivalent.

test_QuantalSTPSynapse()[source]

Compare quantal_stp_synapse with its deterministic equivalent

nest.tests.test_quantal_stp_synapse.run()[source]
nest.tests.test_quantal_stp_synapse.suite()[source]

nest.tests.test_rate_copy_model module

class nest.tests.test_rate_copy_model.RateCopyModelTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Test whether a rate connection created by copy model behaves identical to the original version

test_rate_copy_model()[source]
nest.tests.test_rate_copy_model.run()[source]
nest.tests.test_rate_copy_model.suite()[source]

nest.tests.test_rate_instantaneous_and_delayed module

class nest.tests.test_rate_instantaneous_and_delayed.RateInstantaneousAndDelayedTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Test whether delayed rate connections have same properties as instantaneous connections but with the correct delay

test_rate_instantaneous_and_delayed()[source]
nest.tests.test_rate_instantaneous_and_delayed.run()[source]
nest.tests.test_rate_instantaneous_and_delayed.suite()[source]

nest.tests.test_rate_neuron module

class nest.tests.test_rate_neuron.RateNeuronTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Check rate_neuron

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_RateNeuronMean()[source]

Check the mean value of the rate_neurons

test_RateNeuronNoise()[source]

Check noise of the rate_neurons

test_RateNeuronVariance()[source]

Check the variance of the rate of the rate_neuron for input noise

nest.tests.test_rate_neuron.run()[source]
nest.tests.test_rate_neuron.suite()[source]

nest.tests.test_rate_neuron_communication module

nest.tests.test_rate_neuron_communication.H(x)[source]
class nest.tests.test_rate_neuron_communication.RateNeuronCommunicationTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Check rate_neuron

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_ParrotRateNeuron()[source]

Check the parrot rate neuron with sigm non-linearity

test_RateNeuronDelay()[source]

Check the delay of the connection

test_RateNeuronNL()[source]

Check the non-linearity of the neuron

test_RateNeuronWeight()[source]

Check the weight of the connection

test_RectifyOutput()[source]

Check the rectification of the output

nest.tests.test_rate_neuron_communication.run()[source]
nest.tests.test_rate_neuron_communication.suite()[source]

nest.tests.test_refractory module

class nest.tests.test_refractory.RefractoryTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Check the correct implementation of refractory time in all neuronal models.

compute_reftime(model, sd, vm, neuron)[source]

Compute the refractory time of the neuron.

model : str
Name of the neuronal model.
sd : tuple
GID of the spike detector.
vm : tuple
GID of the voltmeter.
neuron : tuple
GID of the recorded neuron.
t_ref_sim : double
Value of the simulated refractory period.
test_refractory_time(**kwargs)[source]
nest.tests.test_refractory.foreach_neuron(func)[source]

Decorator that automatically does the test for all neurons.

nest.tests.test_refractory.run()[source]
nest.tests.test_refractory.suite()[source]

nest.tests.test_siegert_neuron module

class nest.tests.test_siegert_neuron.SiegertNeuronTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Test siegert_neuron

Compares the rate of a Poisson-driven iaf_psc_delta neuron with the prediction from the siegert neuron.

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_RatePrediction()[source]

Check the rate prediction of the siegert neuron

nest.tests.test_siegert_neuron.run()[source]
nest.tests.test_siegert_neuron.suite()[source]

nest.tests.test_split_simulation module

class nest.tests.test_split_simulation.TestSplit(*args, **kwargs)[source]

Bases: unittest.case.TestCase

runner(time, f)[source]
runs()[source]
setup()[source]
simulate()[source]
steps = 100
test_split_match()[source]
time = 100

nest.tests.test_stack module

Stack tests

class nest.tests.test_stack.StackTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Stack tests

test_Count()[source]

Object count

test_PushPop()[source]

Object push and pop

test_PushPop_NumPy()[source]
test_PushPop_no_NumPy()[source]
nest.tests.test_stack.run()[source]
nest.tests.test_stack.suite()[source]

nest.tests.test_status module

Test if Set/GetStatus work properly

class nest.tests.test_status.StatusTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Tests of Set/GetStatus

test_GetDefaults()[source]

GetDefaults

test_GetKernelStatus()[source]

GetKernelStatus

test_GetStatus()[source]

GetStatus

test_SetDefaults()[source]

SetDefaults

test_SetKernelStatus()[source]

SetKernelStatus

test_SetStatus()[source]

SetStatus with dict

test_SetStatusList()[source]

SetStatus with list

test_SetStatusParam()[source]

SetStatus with parameter

test_SetStatusV_th_smaller_V_reset()[source]

SetStatus of reversal and threshold potential check if error is raised if V_reset > V_th

test_SetStatusVth_E_L()[source]

SetStatus of reversal and threshold potential

nest.tests.test_status.run()[source]
nest.tests.test_status.suite()[source]

nest.tests.test_stdp_multiplicity module

class nest.tests.test_stdp_multiplicity.StdpSpikeMultiplicity(methodName='runTest')[source]

Bases: unittest.case.TestCase

Test correct handling of spike multiplicity in STDP.

This test originated from work on issue #77.

Concerning the definition of STDP for multiplicity > 1, consider the following (see also @flinz on #82): A plastic synapse is created between two parrot neurons. As reference case, we use two precise spiking parrot neurons driven by spike trains n*h - k*delta with delta < h, and 1 < k < K such that K delta < h, i.e., we get K spikes in each time step (h is resolution). If we transmit the same spike trains via plain parrot neurons, they will be handled as spikes with multiplicity K. Then, in the limit delta -> 0, the weight changes observed in the synapse between the precise parrots shall converge to the weight changes observed between the plain parrots.

We test the resulting weights as follows:

  1. Weights obtained using parrot_neuron must be identical independent of delta, since in this case all spikes are at the end of the step, i.e., all spikes have identical times independent of delta.

  2. We choose delta values that are decrease by factors of 2. The plasticity rules depend on spike-time differences through

    exp(dT / tau)

    where dT is the time between pre- and postsynaptic spikes. We construct pre- and postsynaptic spike times so that

    dT = pre_post_shift + m * delta

    with m * delta < resolution << pre_post_shift. The time-dependence of the plasticity rule is therefore to good approximation linear in delta.

    We can thus test as follows: Let w_pl be the weight obtained with the plain parrot, and w_ps_j the weight obtained with the precise parrot for delta_j = delta0 / 2^j. Then,

    ( w_ps_{j+1} - w_pl ) / ( w_ps_j - w_pl ) ~ 0.5 for all j

    i.e., the difference between plain and precise weights halves each time delta is halved.

run_protocol(pre_post_shift)[source]

Create network and simulate for each delta value.

Returns a dict with the synaptic weight at end of simulation for plain and precise parrots, one weight per delta value.

All values for the plain parrot case should be identical, and the values for the precise parrot case should converge to that value for delta -> 0.

All delta values must fulfill

multiplicity * delta < resolution / 2

so that in the plain case off-grid spike times are rounded up to the end of the step and thus belong to the same step as the corresponding precise spikes.

Parameters:pre_post_shift – Delay between pre- and postsynaptic trains
Returns:{‘parrot’: [<weights>], ‘parrot_ps’: [<weights>]}
test_ParrotNeuronSTDPProtocolDepression()[source]

Check weight convergence on depression.

test_ParrotNeuronSTDPProtocolPotentiation()[source]

Check weight convergence on potentiation.

nest.tests.test_stdp_multiplicity.run()[source]
nest.tests.test_stdp_multiplicity.suite()[source]

nest.tests.test_stdp_triplet_synapse module

class nest.tests.test_stdp_triplet_synapse.STDPTripletConnectionTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Check stdp_triplet_connection model properties.

assertAlmostEqualDetailed(expected, given, message)[source]

Improve assetAlmostEqual with detailed message.

decay(time, Kplus, Kplus_triplet, Kminus, Kminus_triplet)[source]

Decay variables.

depress(w, Kminus, Kplus_triplet)[source]

Depress weight.

facilitate(w, Kplus, Kminus_triplet)[source]

Facilitate weight.

generateSpikes(neuron, times)[source]

Trigger spike to given neuron at specified times.

setUp()[source]

Hook method for setting up the test fixture before exercising it.

status(which)[source]

Get synapse parameter status.

test_badPropertiesSetupsThrowExceptions()[source]

Check that exceptions are thrown when setting bad parameters.

test_maxWeightStaturatesWeight()[source]

Check that setting maximum weight property keep weight limited.

test_preVarsDecayAfterPostSpike()[source]

Check that pre-synaptic variables (Kplus, Kplus_triplet) decay after each post-synaptic spike.

test_preVarsDecayAfterPreSpike()[source]

Check that pre-synaptic variables (Kplus, Kplus_triplet) decay after each pre-synaptic spike.

test_preVarsIncreaseWithPreSpike()[source]

Check that pre-synaptic variables (Kplus, Kplus_triplet) increase after each pre-synaptic spike.

test_varsZeroAtStart()[source]

Check that pre and post-synaptic variables are zero at start.

test_weightChangeWhenPrePostPreSpikes()[source]

Check that weight changes whenever a pre-post-pre spike triplet happen.

test_weightChangeWhenPrePostSpikes()[source]

Check that weight changes whenever a pre-post spike pair happen.

class nest.tests.test_stdp_triplet_synapse.STDPTripletInhTestCase(methodName='runTest')[source]

Bases: nest.tests.test_stdp_triplet_synapse.STDPTripletConnectionTestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

nest.tests.test_stdp_triplet_synapse.run()[source]
nest.tests.test_stdp_triplet_synapse.suite()[source]
nest.tests.test_stdp_triplet_synapse.suite_inh()[source]

nest.tests.test_threads module

UnitTests for multithreaded pynest

class nest.tests.test_threads.ThreadTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Tests for multi-threading

nest_multithreaded()[source]

Return True, if we have a thread-enabled NEST, False otherwise

test_Threads()[source]

Multiple threads

test_ThreadsGetConnections()[source]

GetConnections with threads

test_ThreadsGetEvents()[source]

Gathering events across threads

nest.tests.test_threads.run()[source]
nest.tests.test_threads.suite()[source]

nest.tests.test_use_gid_in_filename module

Test if use_gid_in_filename works properly as a parameter of recording devices

class nest.tests.test_use_gid_in_filename.UseGidInFilenameTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Tests of use_gid_in_filename

test_NoGid()[source]

Without GID

test_WithGid()[source]

With GID

nest.tests.test_use_gid_in_filename.run()[source]
nest.tests.test_use_gid_in_filename.suite()[source]

nest.tests.test_vogels_sprekeler_synapse module

class nest.tests.test_vogels_sprekeler_synapse.VogelsSprekelerConnectionTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Check vogels_sprekeler_synapse model properties.

assertAlmostEqualDetailed(expected, given, message)[source]

Improve assetAlmostEqual with detailed message.

decay(time, Kvalue)[source]

Decay variables.

depress(w)[source]

Depress weight.

facilitate(w, Kplus)[source]

Facilitate weight.

generateSpikes(neuron, times)[source]

Trigger spike to given neuron at specified times.

setUp()[source]

Set up the test.

status(which)[source]

Get synapse parameter status.

test_badPropertiesSetupsThrowExceptions()[source]

Check that exceptions are thrown when setting bad parameters.

test_maxWeightStaturatesWeight()[source]

Check that setting maximum weight property keep weight limited.

test_preVarsDecayAfterPostSpike()[source]

Check that pre-synaptic variables Kplus decay after each post-synaptic spike.

test_preVarsDecayAfterPreSpike()[source]

Check that pre-synaptic variables Kplus decay after each pre-synaptic spike.

test_preVarsIncreaseWithPreSpike()[source]

Check that pre-synaptic variable, Kplus increase after each pre-synaptic spike.

test_varsZeroAtStart()[source]

Check that pre and post-synaptic variables are zero at start.

test_weightChangeWhenPrePostSpikes()[source]

Check that weight changes whenever a pre-post spike pair happen.

nest.tests.test_vogels_sprekeler_synapse.run()[source]
nest.tests.test_vogels_sprekeler_synapse.suite()[source]

nest.tests.test_weight_recorder module

Test of events

class nest.tests.test_weight_recorder.WeightRecorderTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Tests for the Weight Recorder

is_subset(a, b, places=6, msg=None)[source]
testDefinedSenders()[source]

Weight Recorder Defined Subset Of Senders

testDefinedTargets()[source]

Weight Recorder Defined Subset Of Targets

testDefinedTargetsAndSenders()[source]

Weight Recorder Defined Subset Of Targets and Senders

testMultapses()[source]

Weight Recorder Multapses

testMultipleThreads()[source]

Weight Recorder Multi Threaded

testRPorts()[source]

Weight Recorder rports

testSingleThread()[source]

Weight Recorder Single Threaded

nest.tests.test_weight_recorder.suite()[source]

Module contents