Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_synapse(self):
circuit = morphio.Circuit(morphio.test.circuit_config)
synapses = circuit.afferent_synapses([320])
del circuit
synapses = [s for s in synapses]
for synapse in synapses:
assert(synapse.delay() < 10)
self.assertRaises(RuntimeError, lambda: morphio.Circuit("foo"))
a = []
a += list(functor(self.circuit, [100], *args))
a += list(functor(self.circuit, [20, 40], *args))
a += list(functor(self.circuit, [7], *args))
a += list(functor(self.circuit, [87, 89, 88], *args))
a += list(functor(self.circuit, {997, 123, 1}, *args))
b = list(functor(self.circuit, [100, 20, 40, 7, 87, 89, 88] +
list({997, 123, 1}), *args))
return a, b
a, b = get(morphio.Circuit.morphology_types)
assert(a == b)
a, b = get(morphio.Circuit.morphology_uris)
assert(a == b)
a, b = get(morphio.Circuit.load_morphologies,
morphio.Circuit.Coordinates.local)
assert(len(a) == len(b))
for i, j in zip(a, b):
assert(numpy.all(i.points() == j.points()))
lambda: self.circuit.load_morphologies(
[100000], morphio.Circuit.Coordinates.local))
def test_iteration_order(self):
def get(functor, *args):
a = []
a += list(functor(self.circuit, [100], *args))
a += list(functor(self.circuit, [20, 40], *args))
a += list(functor(self.circuit, [7], *args))
a += list(functor(self.circuit, [87, 89, 88], *args))
a += list(functor(self.circuit, {997, 123, 1}, *args))
b = list(functor(self.circuit, [100, 20, 40, 7, 87, 89, 88] +
list({997, 123, 1}), *args))
return a, b
a, b = get(morphio.Circuit.morphology_types)
assert(a == b)
a, b = get(morphio.Circuit.morphology_uris)
assert(a == b)
a, b = get(morphio.Circuit.load_morphologies,
morphio.Circuit.Coordinates.local)
assert(len(a) == len(b))
for i, j in zip(a, b):
assert(numpy.all(i.points() == j.points()))