def setUp(self): neuron.Population.nPop = 0 self.net = neuron.Population((3, 3), neuron.IF_curr_alpha) self.net2 = neuron.Population((5, ), 'StandardIF', { 'syn_type': 'current', 'syn_shape': 'exp' })
def setUp(self): neuron.Population.nPop = 0 self.net1 = neuron.Population((10, ), neuron.IF_curr_alpha) self.net2 = neuron.Population((2, 4, 3), neuron.IF_curr_exp) self.net3 = neuron.Population((2, 2, 1), neuron.SpikeSourceArray) self.net4 = neuron.Population((1, 2, 1), neuron.SpikeSourceArray) self.net5 = neuron.Population((3, 3), neuron.IF_cond_alpha)
def setUp(self): self.target = neuron.Population((3, 3), neuron.IF_curr_alpha) self.source = neuron.Population((3, 3), neuron.SpikeSourcePoisson, {'rate': 200}) self.distrib_Numpy = RandomDistribution(rng=NumpyRNG(12345), distribution='uniform', parameters=(0, 1)) self.distrib_Native = RandomDistribution(rng=NativeRNG(12345), distribution='uniform', parameters=(0, 1))
def testSimpleInit(self): """Population.__init__(): the cell list in hoc should have the same length as the population size.""" net = neuron.Population((3, 3), neuron.IF_curr_alpha) n_cells = getattr(h, net.label).count() n_cells_lower = int(getattr(h, net.label).count()) # round-robin distribution assert 9 / neuron.nhost <= n_cells_lower <= 9 / neuron.nhost + 1, "%d not between %d and %d" % ( n_cells_lower, 9 / neuron.nhost, 9 / neuron.nhost + 1)
def testInitWithParams(self): """Population.__init__(): Parameters set on creation should be the same as retrieved with the top-level HocObject""" net = neuron.Population((3, 3), neuron.IF_curr_alpha, {'tau_syn_E': 3.141592654}) cell_list = getattr(h, net.label) for i in range(int(cell_list.count())): tau_syn = cell_list.object(i).esyn.tau self.assertAlmostEqual(tau_syn, 3.141592654, places=5)
def testInitWithNonStandardModel(self): """Population.__init__(): the cell list in hoc should have the same length as the population size.""" net = neuron.Population((3, 3), 'StandardIF', { 'syn_type': 'current', 'syn_shape': 'exp' }) n_cells = getattr(h, net.label).count() n_cells_lower = int(getattr(h, net.label).count()) # round-robin distribution assert 9 / neuron.nhost <= n_cells_lower <= 9 / neuron.nhost + 1, "%d not between %d and %d" % ( n_cells_lower, 9 / neuron.nhost, 9 / neuron.nhost + 1)
def testRecordWithSpikeTimesGreaterThanSimTime(self): """ If a `SpikeSourceArray` is initialized with spike times greater than the simulation time, only those spikes that actually occurred should be written to file or returned by getSpikes(). """ spike_times = numpy.arange(10.0, 200.0, 10.0) spike_source = neuron.Population(1, neuron.SpikeSourceArray, {'spike_times': spike_times}) spike_source.record() neuron.running = False neuron.run(100.0) spikes = spike_source.getSpikes()[:, 1] if neuron.myid == 0: self.assert_(max(spikes) == 100.0, str(spikes))
def setUp(self): neuron.Population.nPop = 0 neuron.Projection.nProj = 0 self.target33 = neuron.Population((3, 3), neuron.IF_curr_alpha) self.target6 = neuron.Population((6, ), neuron.IF_curr_alpha) self.source5 = neuron.Population((5, ), neuron.SpikeSourcePoisson) self.source22 = neuron.Population((2, 2), neuron.SpikeSourcePoisson) self.source33 = neuron.Population((3, 3), neuron.SpikeSourcePoisson) self.expoisson33 = neuron.Population((3, 3), neuron.SpikeSourcePoisson, {'rate': 100})
def setUp(self): neuron.Population.nPop = 0 self.pop1 = neuron.Population((5, ), neuron.IF_curr_alpha, {'tau_m': 10.0}) self.pop2 = neuron.Population((5, 4), neuron.IF_curr_exp, {'v_reset': -60.0})
def setUp(self): neuron.Population.nPop = 0 self.pop1 = neuron.Population((3, 3), neuron.SpikeSourcePoisson, {'rate': 20}) self.pop2 = neuron.Population((3, 3), neuron.IF_curr_alpha)
def testInitWithLabel(self): """Population.__init__(): A label set on initialisation should be retrievable with the Population.label attribute.""" net = neuron.Population((3, 3), neuron.IF_curr_alpha, label='iurghiushrg') assert net.label == 'iurghiushrg'