本文整理汇总了Python中pyNN.mock.run函数的典型用法代码示例。如果您正苦于以下问题:Python run函数的具体用法?Python run怎么用?Python run使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了run函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_print_v
def test_print_v(self, sim=sim):
p = sim.Population(3, sim.IF_curr_alpha())
p.record_v()
sim.run(10.0)
p.write_data = Mock()
p.print_v("foo.txt")
p.write_data.assert_called_with('foo.txt', 'v', True)
开发者ID:HBPNeurorobotics,项目名称:PyNN,代码行数:7,代码来源:test_population.py
示例2: test_meanSpikeCount
def test_meanSpikeCount(self):
p = sim.Population(14, sim.EIF_cond_exp_isfa_ista())
p.record("spikes")
sim.run(100.0)
p.mean_spike_count = Mock()
p.meanSpikeCount()
p.mean_spike_count.assert_called()
开发者ID:jougs,项目名称:PyNN,代码行数:7,代码来源:test_population.py
示例3: test_getSpikes
def test_getSpikes(self):
p = sim.Population(3, sim.IF_curr_alpha())
p.record("spikes")
sim.run(10.0)
p.get_data = Mock()
p.getSpikes()
p.get_data.assert_called_with("spikes", True)
开发者ID:jougs,项目名称:PyNN,代码行数:7,代码来源:test_population.py
示例4: test_print_gsyn
def test_print_gsyn(self):
p = sim.Population(3, sim.IF_cond_alpha())
p.record_gsyn()
sim.run(10.0)
p.write_data = Mock()
p.print_gsyn("foo.txt")
p.write_data.assert_called_with("foo.txt", ["gsyn_exc", "gsyn_inh"], True)
开发者ID:jougs,项目名称:PyNN,代码行数:7,代码来源:test_population.py
示例5: test_print_gsyn
def test_print_gsyn(self, sim=sim):
p = sim.Population(3, sim.IF_cond_alpha())
p.record_gsyn()
sim.run(10.0)
p.write_data = Mock()
p.print_gsyn("foo.txt")
p.write_data.assert_called_with('foo.txt', ['gsyn_exc', 'gsyn_inh'], True)
开发者ID:HBPNeurorobotics,项目名称:PyNN,代码行数:7,代码来源:test_population.py
示例6: test_get_v
def test_get_v(self, sim=sim):
p = sim.Population(3, sim.IF_curr_alpha())
p.record_v()
sim.run(10.0)
p.get_data = Mock()
p.get_v()
p.get_data.assert_called_with('v', True)
开发者ID:HBPNeurorobotics,项目名称:PyNN,代码行数:7,代码来源:test_population.py
示例7: test_meanSpikeCount
def test_meanSpikeCount(self, sim=sim):
p = sim.Population(14, sim.EIF_cond_exp_isfa_ista())
p.record('spikes')
sim.run(100.0)
p.mean_spike_count = Mock()
p.meanSpikeCount()
self.assertTrue(p.mean_spike_count.called)
开发者ID:HBPNeurorobotics,项目名称:PyNN,代码行数:7,代码来源:test_population.py
示例8: test_get_gsyn
def test_get_gsyn(self, sim=sim):
p = sim.Population(3, sim.IF_cond_alpha())
p.record_gsyn()
sim.run(10.0)
p.get_data = Mock()
p.get_gsyn()
p.get_data.assert_called_with(['gsyn_exc', 'gsyn_inh'], True)
开发者ID:HBPNeurorobotics,项目名称:PyNN,代码行数:7,代码来源:test_population.py
示例9: test_current_time_two_runs
def test_current_time_two_runs(self, sim=sim):
sim.setup(timestep=0.1, **self.extra)
sim.run(10.1)
self.assertAlmostEqual(sim.get_current_time(), 10.1)
sim.run(23.4)
self.assertAlmostEqual(sim.get_current_time(), 33.5)
sim.end()
开发者ID:JoelChavas,项目名称:PyNN,代码行数:7,代码来源:test_simulation_control.py
示例10: test_printSpikes
def test_printSpikes(self, sim=sim):
# TODO: implement assert_deprecated
p = sim.Population(3, sim.IF_curr_alpha())
p.record('spikes')
sim.run(10.0)
p.write_data = Mock()
p.printSpikes("foo.txt")
p.write_data.assert_called_with('foo.txt', 'spikes', True)
开发者ID:HBPNeurorobotics,项目名称:PyNN,代码行数:8,代码来源:test_population.py
示例11: test_get_spike_counts
def test_get_spike_counts(self, sim=sim):
p = sim.Population(3, sim.EIF_cond_exp_isfa_ista())
p.record('spikes')
sim.run(100.0)
self.assertEqual(p.get_spike_counts(),
{p.all_cells[0]: 2,
p.all_cells[1]: 2,
p.all_cells[2]: 2})
开发者ID:HBPNeurorobotics,项目名称:PyNN,代码行数:8,代码来源:test_population.py
示例12: test_record_with_single_variable
def test_record_with_single_variable(self, sim=sim):
p = sim.Population(14, sim.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))
开发者ID:HBPNeurorobotics,项目名称:PyNN,代码行数:9,代码来源:test_population.py
示例13: test_get_spike_counts
def test_get_spike_counts(self):
p = sim.Population(5, sim.EIF_cond_exp_isfa_ista())
pv = p[0, 1, 4]
pv.record('spikes')
sim.run(100.0)
self.assertEqual(p.get_spike_counts(),
{p.all_cells[0]: 2,
p.all_cells[1]: 2,
p.all_cells[4]: 2})
开发者ID:jougs,项目名称:PyNN,代码行数:9,代码来源:test_populationview.py
示例14: test_print_gsyn
def test_print_gsyn(self):
p1 = sim.Population(11, sim.IF_cond_exp())
p2 = sim.Population(11, sim.IF_cond_exp())
a = sim.Assembly(p1, p2, label="test")
a.record_gsyn()
sim.run(10.0)
a.write_data = Mock()
a.print_gsyn("foo.txt")
a.write_data.assert_called_with('foo.txt', ['gsyn_exc', 'gsyn_inh'], True)
开发者ID:bernhardkaplan,项目名称:PyNN,代码行数:9,代码来源:test_assembly.py
示例15: test_mean_spike_count
def test_mean_spike_count(self, sim=sim):
p1 = sim.Population(14, sim.EIF_cond_exp_isfa_ista())
p2 = sim.Population(37, sim.IF_cond_alpha())
a = p1 + p2
p1.record('spikes')
p2.record('spikes')
#a.record('spikes')
sim.run(100.0)
self.assertEqual(a.mean_spike_count(), 2.0) # mock backend always produces two spikes per population
开发者ID:NeuralEnsemble,项目名称:PyNN,代码行数:9,代码来源:test_assembly.py
示例16: test_get_v
def test_get_v(self):
p1 = sim.Population(11, sim.IF_cond_exp())
p2 = sim.Population(11, sim.IF_cond_exp())
a = sim.Assembly(p1, p2, label="test")
a.record_v()
sim.run(10.0)
a.get_data = Mock()
a.get_v()
a.get_data.assert_called_with('v', True)
开发者ID:bernhardkaplan,项目名称:PyNN,代码行数:9,代码来源:test_assembly.py
示例17: test_print_v
def test_print_v(self, sim=sim):
p1 = sim.Population(11, sim.IF_cond_exp())
p2 = sim.Population(11, sim.IF_cond_exp())
a = sim.Assembly(p1, p2, label="test")
a.record_v()
sim.run(10.0)
a.write_data = Mock()
a.print_v("foo.txt")
a.write_data.assert_called_with('foo.txt', 'v', True)
开发者ID:NeuralEnsemble,项目名称:PyNN,代码行数:9,代码来源:test_assembly.py
示例18: test_get_gsyn
def test_get_gsyn(self, sim=sim):
p1 = sim.Population(11, sim.IF_cond_exp())
p2 = sim.Population(11, sim.IF_cond_exp())
a = sim.Assembly(p1, p2, label="test")
a.record_gsyn()
sim.run(10.0)
a.get_data = Mock()
a.get_gsyn()
a.get_data.assert_called_with(['gsyn_exc', 'gsyn_inh'], True)
开发者ID:NeuralEnsemble,项目名称:PyNN,代码行数:9,代码来源:test_assembly.py
示例19: test_getSpikes
def test_getSpikes(self, sim=sim):
p1 = sim.Population(11, sim.IF_cond_exp())
p2 = sim.Population(11, sim.IF_cond_exp())
a = sim.Assembly(p1, p2, label="test")
a.record('spikes')
sim.run(10.0)
a.get_data = Mock()
a.getSpikes()
a.get_data.assert_called_with('spikes', True)
开发者ID:NeuralEnsemble,项目名称:PyNN,代码行数:9,代码来源:test_assembly.py
示例20: test_printSpikes
def test_printSpikes(self, sim=sim):
# TODO: implement assert_deprecated
p1 = sim.Population(11, sim.IF_cond_exp())
p2 = sim.Population(11, sim.IF_cond_exp())
a = sim.Assembly(p1, p2, label="test")
a.record('spikes')
sim.run(10.0)
a.write_data = Mock()
a.printSpikes("foo.txt")
a.write_data.assert_called_with('foo.txt', 'spikes', True)
开发者ID:NeuralEnsemble,项目名称:PyNN,代码行数:10,代码来源:test_assembly.py
注:本文中的pyNN.mock.run函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论