def test_step_blocks(Simulator, seed):
with nengo.Network(seed=seed) as net:
inp = nengo.Node(np.sin)
ens = nengo.Ensemble(10, 1)
nengo.Connection(inp, ens)
p = nengo.Probe(ens)
with Simulator(net, unroll_simulation=25) as sim1:
sim1.run_steps(50)
with Simulator(net, unroll_simulation=10) as sim2:
sim2.run_steps(50)
assert np.allclose(sim1.data[p], sim2.data[p])
with pytest.warns(RuntimeWarning):
with Simulator(net, unroll_simulation=5) as sim:
sim.run_steps(2)
评论列表
文章目录