Changeset 1036
- Timestamp:
- 12/16/11 14:56:15 (5 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 modified
-
src/common/populations.py (modified) (1 diff)
-
src/space.py (modified) (1 diff)
-
test/benchmarks/ddpc.py (added)
-
test/unsorted/generictests.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/common/populations.py
r1035 r1036 366 366 assert rarr.size == self.size, "%s != %s" % (rarr.size, self.size) 367 367 self.tset(parametername, rarr) 368 369 def _call(self, methodname, arguments):370 """371 Call the method methodname(arguments) for every cell in the population.372 e.g. p.call("set_background","0.1") if the cell class has a method373 set_background().374 """375 raise NotImplementedError()376 377 def _tcall(self, methodname, objarr):378 """379 `Topographic' call. Call the method methodname() for every cell in the380 population. The argument to the method depends on the coordinates of381 the cell. objarr is an array with the same dimensions as the382 Population.383 e.g. p.tcall("memb_init", vinitArray) calls384 p.cell[i][j].memb_init(vInitArray[i][j]) for all i,j.385 """386 raise NotImplementedError()387 388 #@deprecated("initialize('v', rand_distr)")389 def randomInit(self, rand_distr):390 """391 Set initial membrane potentials for all the cells in the population to392 random values.393 """394 warn("The randomInit() method is deprecated, and will be removed in a future release. Use initialize('v', rand_distr) instead.")395 self.initialize('v', rand_distr)396 368 397 369 def initialize(self, variable, value): -
trunk/src/space.py
r957 r1036 188 188 nx = math.sqrt(n*self.aspect_ratio) 189 189 if n%nx != 0: 190 raise Exception("Invalid size ")190 raise Exception("Invalid size: n=%g, nx=%d" % (n, nx)) 191 191 ny = n/nx 192 192 return nx, ny -
trunk/test/unsorted/generictests.py
r812 r1036 458 458 self.assertRaises(errors.NonExistentParameterError, self.p1.set, {'tau_foo': 10.0, 'tau_m': 21.0}) 459 459 460 def test RandomInit(self):460 def test_initialize_v(self): 461 461 rd = random.RandomDistribution(rng=random.NumpyRNG(seed=98765, num_processes=sim.num_processes()), 462 462 distribution='uniform', 463 463 parameters=[-75,-55]) 464 self.p1. randomInit(rd)464 self.p1.initialize('v', rd) 465 465 #self.assertNotEqual(self.p1[0,0,0].v_init, self.p1[0,0,1].v_init) 466 466 self.assertNotEqual(self.p1.local_cells[0].get_initial_value('v'), self.p1.local_cells[1].get_initial_value('v')) … … 592 592 v_thresh = -50.0 593 593 uniformDistr = random.RandomDistribution(rng=rng, distribution='uniform', parameters=[v_reset, v_thresh]) 594 self.pop2. randomInit(uniformDistr)594 self.pop2.initialize('v', uniformDistr) 595 595 cells_to_record = [self.pop2[0], self.pop2[4]] 596 596 self.pop2.record_v(cells_to_record) … … 1077 1077 v_thresh = -50.0 1078 1078 uniformDistr = random.RandomDistribution(rng=rng, distribution='uniform', parameters=[v_reset, v_thresh]) 1079 self.pop. randomInit(uniformDistr)1079 self.pop.initialize('v', uniformDistr) 1080 1080 self.cells_to_record = [self.pop[0], self.pop[4]] 1081 1081 self.pop.record_v(self.cells_to_record)
