Beispiel #1
0
 def test_record_with_single_variable(self):
     p = sim.Population(14, EIF_cond_exp_isfa_ista())
     p.record('v')
     sim.run(12.3)
     data = p.get_data(gather=True).segments[0]
     self.assertEqual(len(data.analogsignalarrays), 1)
     n_values = int(round(12.3 / sim.get_time_step())) + 1
     self.assertEqual(data.analogsignalarrays[0].name, 'v')
     self.assertEqual(data.analogsignalarrays[0].shape, (n_values, p.size))
Beispiel #2
0
 def test_record_with_multiple_variables(self):
     p = sim.Population(2, EIF_cond_exp_isfa_ista())
     p.record(('v', 'spikes'))
     sim.run(10.0)
     data = p.get_data(gather=True).segments[0]
     self.assertEqual(len(data.analogsignalarrays), 1)
     n_values = int(round(10.0 / sim.get_time_step())) + 1
     names = set(arr.name for arr in data.analogsignalarrays)
     self.assertEqual(names, set(('v')))
     for arr in data.analogsignalarrays:
         self.assertEqual(arr.shape, (n_values, p.size))
 def test_time_step(self):
     sim.setup(0.123, min_delay=0.246, **extra)
     self.assertEqual(sim.get_time_step(), 0.123)
 def test_time_step(self):
     sim.setup(0.123, min_delay=0.246, **extra)
     self.assertEqual(sim.get_time_step(), 0.123)