How to use the arbor.meter_report function in arbor

To help you get started, we’ve selected a few arbor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github arbor-sim / arbor / python / example / ring.py View on Github external
meters.checkpoint('simulation-init', context)

spike_recorder = arbor.attach_spike_recorder(sim)

pid = arbor.cell_member(0,0) # cell 0, probe 0
# Attach a sampler to the voltage probe on cell 0.
# Sample rate of 1 sample every ms.
sampler = arbor.attach_sampler(sim, 1, pid)

sim.run(100)
print(f'{sim} finished')

meters.checkpoint('simulation-run', context)

print(f'{arbor.meter_report(meters, context)}')

for sp in spike_recorder.spikes:
    print(sp)

print('voltage samples for probe id ', end = '')
print(pid, end = '')
print(':')

time = []
value = []
for sa in sampler.samples(pid):
    print(sa)
    time.append(sa.time)
    value.append(sa.value)

# plot the recorded voltages over time