bsb.connectivity package

Subpackages

Submodules

bsb.connectivity.general module

class bsb.connectivity.general.AllToAll(*args, _parent=None, _key=None, **kwargs)[source]

Bases: ConnectionStrategy

All to all connectivity between two neural populations.

affinity: float

Probability for each individual connection to be, default is 1, i.e. all connected.

connect(pre, post)[source]

Central method of each connection strategy. Given a pair of HemitypeCollection (one for each connection side), should connect cell population using the scaffold’s (available as self.scaffold) bsb.core.Scaffold.connect_cells() method.

Parameters:
get_node_name()
class bsb.connectivity.general.Convergence(*args, _parent=None, _key=None, **kwargs)[source]

Bases: ConnectionStrategy

Connect cells based on a convergence distribution, i.e. by connecting each source cell to X target cells.

connect()[source]

Central method of each connection strategy. Given a pair of HemitypeCollection (one for each connection side), should connect cell population using the scaffold’s (available as self.scaffold) bsb.core.Scaffold.connect_cells() method.

Parameters:
convergence: Distribution

Base implementation of all the different configuration attributes.

Call the factory function attr() instead.

get_node_name()
class bsb.connectivity.general.FixedIndegree(*args, _parent=None, _key=None, **kwargs)[source]

Bases: InvertedRoI, ConnectionStrategy

Connect a group of postsynaptic cell types to indegree uniformly random presynaptic cells from all the presynaptic cell types.

connect(pre, post)[source]

Central method of each connection strategy. Given a pair of HemitypeCollection (one for each connection side), should connect cell population using the scaffold’s (available as self.scaffold) bsb.core.Scaffold.connect_cells() method.

Parameters:
get_node_name()
indegree: int

Number of postsynaptic cell to connect to each presynaptic cell.

class bsb.connectivity.general.FixedOutdegree(*args, _parent=None, _key=None, **kwargs)[source]

Bases: ConnectionStrategy

Connect a group of presynaptic cell types to outdegree uniformly random postsynaptic cells from all the postsynaptic cell types.

connect(pre, post)[source]

Central method of each connection strategy. Given a pair of HemitypeCollection (one for each connection side), should connect cell population using the scaffold’s (available as self.scaffold) bsb.core.Scaffold.connect_cells() method.

Parameters:
get_node_name()
outdegree: int

Number of presynaptic cell to connect to each postsynaptic cell.

bsb.connectivity.strategy module

class bsb.connectivity.strategy.ConnectionStrategy(*args, _parent=None, _key=None, **kwargs)[source]

Bases: ABC, HasDependencies

abstractmethod connect(presyn_collection, postsyn_collection)[source]

Central method of each connection strategy. Given a pair of HemitypeCollection (one for each connection side), should connect cell population using the scaffold’s (available as self.scaffold) bsb.core.Scaffold.connect_cells() method.

Parameters:
connect_cells(pre_set, post_set, src_locs, dest_locs, tag=None)[source]

Connect cells from a presynaptic placement set to cells of a postsynaptic placement set, and produce a unique name to describe their connectivity set. The description of the hemitype (source or target cell population) connection location is stored as a list of 3 ids: the cell index (in the placement set), morphology branch index, and the morphology branch section index. If no morphology is attached to the hemitype, then the morphology indexes can be set to -1.

Parameters:
depends_on: list[ConnectionStrategy]

The list of strategies that must run before this one.

get_all_post_chunks()[source]
get_all_pre_chunks()[source]
get_cell_types()[source]
get_deps()[source]
get_node_name()
get_output_names(pre=None, post=None)[source]
get_region_of_interest(chunk)[source]

Returns the list of chunks containing the potential postsynaptic neurons, based on a chunk containing the presynaptic neurons.

Parameters:

chunk (bsb.storage._chunks.Chunk) – Presynaptic chunk

Returns:

List of postsynaptic chunks

Return type:

list[bsb.storage._chunks.Chunk]

name: str

Name used to refer to the connectivity strategy.

output_naming: str | None | dict[str, dict[str, str, None, list[str]]]

Specifies how to name the output ConnectivitySets in which the connections between cell type pairs are stored.

postsynaptic: Hemitype

Postsynaptic (target) neuron population.

presynaptic: Hemitype

Presynaptic (source) neuron population.

queue(pool: JobPool)[source]

Specifies how to queue this connectivity strategy into a job pool.

Can be overridden, the default implementation asks each partition to chunk itself and creates 1 placement job per chunk.

Parameters:

pool (JobPool)

scaffold: Scaffold
strategy

Base implementation of all the different configuration attributes.

Call the factory function attr() instead.

class bsb.connectivity.strategy.Hemitype(*args, _parent=None, _key=None, **kwargs)[source]

Bases: object

Class used to represent one (pre- or postsynaptic) side of a connection rule.

cell_types: list[CellType]

List of cell types to use in connection.

get_all_chunks()[source]

Get the list of all chunks where the cell types were placed.

Returns:

List of Chunks

Return type:

list[bsb.storage._chunks.Chunk]

get_node_name()
labels: list[str]

List of labels to filter the placement set by.

morpho_loader: Callable[[PlacementSet], MorphologySet]

Function to load the morphologies (MorphologySet) from a PlacementSet.

This override can allow temporary dynamic morphology generation during the connectivity phase, from a much smaller, or empty, MorphologySet. It is useful for example when the task would take too much disk space or time otherwise.

morphology_labels: list[str]

List of labels to filter the morphologies by.

scaffold: Scaffold
class bsb.connectivity.strategy.HemitypeCollection(hemitype: Hemitype, roi: list[Chunk])[source]

Bases: object

Class used to iterate over an Hemitype placement sets within a list of chunks, and over its cell types.

Parameters:
property placement

List the placement sets for each cell type, filtered according to the class morphology labels and list of chunks.

Return type:

list[bsb.storage.interfaces.PlacementSet]

Module contents