- Timestamp:
- 12/22/11 10:59:00 (5 months ago)
- Location:
- trunk/test
- Files:
-
- 2 modified
-
system/scenarios.py (modified) (17 diffs)
-
unittests/test_neuron.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/system/scenarios.py
r1038 r1044 18 18 19 19 20 @register( )20 @register(exclude=["nemo"]) 21 21 def scenario1(sim): 22 22 """ … … 39 39 tstop = 1000.0 40 40 delay = 0.2 41 dt = 0.1 41 42 weights = { 42 43 'excitatory': 4.0e-3, … … 45 46 } 46 47 47 sim.setup(timestep= 0.1, threads=n_threads)48 sim.setup(timestep=dt, min_delay=dt, threads=n_threads) 48 49 all_cells = sim.Population(n_exc+n_inh, sim.IF_cond_exp, cell_params, label="All cells") 49 50 cells = { … … 83 84 84 85 85 @register( )86 @register(exclude=["nemo"]) 86 87 def scenario1a(sim): 87 88 """ … … 104 105 pconn_input = 0.01 105 106 tstop = 1000.0 106 delay = 0.3107 delay = 1 107 108 w_exc = 3.0e-3 108 109 w_inh = 45.0e-3 109 110 w_input = 0.12 111 dt = 0.1 110 112 111 sim.setup(timestep= 0.1, threads=n_threads)113 sim.setup(timestep=dt, min_delay=dt, threads=n_threads) 112 114 excitatory_cells = sim.create(sim.IF_cond_alpha, cell_params, n=n_exc) 113 115 inhibitory_cells = sim.create(sim.IF_cond_alpha, cell_params, n=n_inh) … … 134 136 135 137 136 @register(exclude=["moose" ])138 @register(exclude=["moose", "nemo"]) 137 139 def scenario2(sim): 138 140 """ … … 162 164 neurons.initialize('v', 0.0) 163 165 I = numpy.arange(I0, I0+1.0, 1.0/n) 164 currents = [sim.DCSource( start=t_start, stop=t_start+duration, amplitude=amp)166 currents = [sim.DCSource({"start" : t_start, "stop" : t_start+duration, "amplitude" :amp}) 165 167 for amp in I] 166 168 for j, (neuron, current) in enumerate(zip(neurons, currents)): … … 188 190 189 191 190 @register(exclude=["moose", " brian"])192 @register(exclude=["moose", "nemo", "brian"]) 191 193 def scenario3(sim): 192 194 """ … … 277 279 278 280 279 @register( )281 @register(exclude=["nemo"]) 280 282 def ticket166(sim): 281 283 """ … … 292 294 pylab.rcParams['interactive'] = interactive 293 295 294 sim.setup(timestep=dt )296 sim.setup(timestep=dt, min_delay=dt) 295 297 296 298 spikesources = sim.Population(2, sim.SpikeSourceArray) … … 335 337 """ 336 338 repeats = 3 337 sim.setup() 338 p = sim.Population(1, sim.IF_cond_exp, {"i_offset": 0.1}) 339 dt = 1 340 sim.setup(timestep=dt, min_delay=dt) 341 p = sim.Population(1, sim.IF_curr_exp, {"i_offset": 0.1}) 339 342 p.record_v() 340 343 … … 351 354 352 355 353 @register(exclude=['brian', 'pcsim' ])356 @register(exclude=['brian', 'pcsim', 'nemo']) 354 357 def test_reset_recording(sim): 355 358 """ … … 384 387 n = 3 385 388 data = [] 389 dt = 1 386 390 387 391 for i in range(n): 388 sim.setup( )389 p = sim.Population(1, sim.IF_c ond_exp, {"i_offset": 0.1})392 sim.setup(timestep=dt, min_delay=dt) 393 p = sim.Population(1, sim.IF_curr_exp, {"i_offset": 0.1}) 390 394 p.record_v() 391 395 sim.run(10.0) … … 398 402 assert_arrays_equal(rec, data[0]) 399 403 400 @register(exclude=['pcsim', 'moose' ])404 @register(exclude=['pcsim', 'moose', 'nemo']) 401 405 def test_EIF_cond_alpha_isfa_ista(sim): 402 406 sim.setup(timestep=0.01, min_delay=0.1, max_delay=4.0) … … 410 414 sim.end() 411 415 412 @register(exclude=['pcsim' ])416 @register(exclude=['pcsim', 'nemo']) 413 417 def test_HH_cond_exp(sim): 414 418 sim.setup(timestep=0.001, min_delay=0.1) … … 437 441 438 442 439 @register(exclude=['pcsim', 'moose' ])443 @register(exclude=['pcsim', 'moose', 'nemo']) 440 444 def test_record_vm_and_gsyn_from_assembly(sim): 441 445 from pyNN.utility import init_logging 442 446 init_logging(logfile=None, debug=True) 443 dt = 0.1447 dt = 0.1 444 448 tstop = 100.0 445 sim.setup(timestep=dt )449 sim.setup(timestep=dt, min_delay=dt) 446 450 cells = sim.Population(5, sim.IF_cond_exp) + sim.Population(6, sim.EIF_cond_exp_isfa_ista) 447 451 inputs = sim.Population(5, sim.SpikeSourcePoisson, {'rate': 50.0}) … … 481 485 sim.end() 482 486 483 @register() 487 @register(exclude=["pcsim", "nemo"]) 488 def test_changing_electrode(sim): 489 """ 490 Check that changing the values of the electrodes on the fly is taken into account 491 """ 492 repeats = 2 493 dt = 0.1 494 simtime = 100 495 sim.setup(timestep=dt, min_delay=dt) 496 p = sim.Population(1, sim.IF_curr_exp) 497 c = sim.DCSource({'amplitude' : 0}) 498 c.inject_into(p) 499 p.record_v() 500 501 data = [] 502 for i in range(repeats): 503 sim.run(100.0) 504 c.amplitude += 0.1 505 data.append(p.get_v()) 506 507 sim.end() 508 509 assert data[0][:, 2][simtime/dt] < data[0][:, 2][-1] 510 511 512 513 @register(exclude=['nemo']) 484 514 def ticket195(sim): 485 515 """ -
trunk/test/unittests/test_neuron.py
r1042 r1044 42 42 class MockDCSource(object): 43 43 parameter_names = ['amplitude', 'start', 'stop'] 44 parameters = {'amplitude' : 0, 'start' : 0, 'stop' : 1e12}45 44 def __init__(self, parameters): 46 45 self._devices = []
