Created
February 20, 2016 20:40
-
-
Save mwatts15/178aa09d2e90db7f1dd1 to your computer and use it in GitHub Desktop.
See openworm/PyOpenWorm issue #90
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PyOpenWorm as P | |
import numpy | |
import six | |
from time import time | |
def all_neuron_connection(): | |
n = P.Neuron(name="AVAL") | |
list(n.connection.get()) | |
list(n.connection.get()) | |
list(n.connection.get()) | |
data = numpy.empty(302) | |
n = P.Neuron() | |
i = 0 | |
for nn in n.load(): | |
x = 0 | |
t0 = time() | |
for c in nn.connection.get(): | |
x += 1 | |
t1 = time() | |
data[i] = t1-t0 | |
i += 1 | |
return data | |
def network_synapses(): | |
t0 = time() | |
for net in P.Worm().neuron_network.get(): | |
list(net.synapses()) | |
t1 = time() | |
return t1-t0 | |
def p(*args, **argm): | |
six.print_(*args, **argm) | |
def display(data): | |
p("stddev", numpy.std(data)) | |
p("mean", numpy.mean(data)) | |
p("median", numpy.median(data)) | |
p("min", numpy.amin(data)) | |
p("max", numpy.amax(data)) | |
p("range", numpy.amax(data) - numpy.amin(data)) | |
if __name__ == '__main__': | |
P.connect('PyOpenWorm/default.conf', do_logging=False) | |
p('all_neuron_connection') | |
display(all_neuron_connection()) | |
p('network_synapses', network_synapses()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment