jaxley.connect.fully_connect

Navigation

jaxley.connect.fully_connect#

fully_connect(pre_cell_view, post_cell_view, synapse_type, random_post_comp=False)[source]#

Fully (densely) connect cells of a network with synapses.

Connections are from branch 0 location 0 of the pre-synaptic cell to branch 0 location 0 of the post-synaptic cell unless random_post_comp=True.

Parameters:
  • pre_cell_view (View) – View of the presynaptic cell.

  • post_cell_view (View) – View of the postsynaptic cell.

  • synapse_type (Synapse) – The synapse to append.

  • random_post_comp (bool) – If True, randomly samples the postsynaptic compartments.

Example usage#

The following example insert 12 synapses (3 x 4).

from jaxley.connect import fully_connect

net = jx.Network([cell for _ in range(10)])
fully_connect(
    net.cell([0, 1, 2]),
    net.cell([3, 4, 5, 6]),
    IonotropicSynapse(),
)
print(net.edges)