How to use the morphio.Circuit function in morphio

To help you get started, we’ve selected a few morphio 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 BlueBrain / MorphIO / tests / brain / python / synapses.py View on Github external
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)
github BlueBrain / MorphIO / tests / brain / python / circuit.py View on Github external
        self.assertRaises(RuntimeError, lambda: morphio.Circuit("foo"))
github BlueBrain / MorphIO / tests / brain / python / circuit.py View on Github external
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()))
github BlueBrain / MorphIO / tests / brain / python / circuit.py View on Github external
lambda: self.circuit.load_morphologies(
                              [100000], morphio.Circuit.Coordinates.local))
github BlueBrain / MorphIO / tests / brain / python / circuit.py View on Github external
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()))