bsb.connectivity package¶
Subpackages¶
Submodules¶
bsb.connectivity.general module¶
- class bsb.connectivity.general.AllToAll(*args, _parent=None, _key=None, **kwargs)[source]¶
Bases:
ConnectionStrategyAll 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 asself.scaffold)bsb.core.Scaffold.connect_cells()method.- Parameters:
presyn_collection (bsb.connectivity.strategy.HemitypeCollection) – presynaptic filtered cell population.
postsyn_collection (bsb.connectivity.strategy.HemitypeCollection) – postsynaptic filtered cell population.
- get_node_name()¶
- class bsb.connectivity.general.Convergence(*args, _parent=None, _key=None, **kwargs)[source]¶
Bases:
ConnectionStrategyConnect 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 asself.scaffold)bsb.core.Scaffold.connect_cells()method.- Parameters:
presyn_collection (bsb.connectivity.strategy.HemitypeCollection) – presynaptic filtered cell population.
postsyn_collection (bsb.connectivity.strategy.HemitypeCollection) – postsynaptic filtered cell population.
- 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,ConnectionStrategyConnect a group of postsynaptic cell types to
indegreeuniformly 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 asself.scaffold)bsb.core.Scaffold.connect_cells()method.- Parameters:
presyn_collection (bsb.connectivity.strategy.HemitypeCollection) – presynaptic filtered cell population.
postsyn_collection (bsb.connectivity.strategy.HemitypeCollection) – postsynaptic filtered cell population.
- get_node_name()¶
- class bsb.connectivity.general.FixedOutdegree(*args, _parent=None, _key=None, **kwargs)[source]¶
Bases:
ConnectionStrategyConnect a group of presynaptic cell types to
outdegreeuniformly 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 asself.scaffold)bsb.core.Scaffold.connect_cells()method.- Parameters:
presyn_collection (bsb.connectivity.strategy.HemitypeCollection) – presynaptic filtered cell population.
postsyn_collection (bsb.connectivity.strategy.HemitypeCollection) – postsynaptic filtered cell population.
- get_node_name()¶
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 asself.scaffold)bsb.core.Scaffold.connect_cells()method.- Parameters:
presyn_collection (bsb.connectivity.strategy.HemitypeCollection) – presynaptic filtered cell population.
postsyn_collection (bsb.connectivity.strategy.HemitypeCollection) – postsynaptic filtered cell population.
- 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:
pre_set (bsb.storage.interfaces.PlacementSet) – presynaptic placement set
post_set (bsb.storage.interfaces.PlacementSet) – postsynaptic placement set
src_locs (list[list[int, int, int]]) – list of the presynaptic connection location.
dest_locs (list[list[int, int, int]]) – list of the postsynaptic connection location.
- depends_on: list[ConnectionStrategy]¶
The list of strategies that must run before this one.
- get_node_name()¶
- 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:
- 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.
- class bsb.connectivity.strategy.Hemitype(*args, _parent=None, _key=None, **kwargs)[source]¶
Bases:
objectClass used to represent one (pre- or postsynaptic) side of a connection rule.
- get_all_chunks()[source]¶
Get the list of all chunks where the cell types were placed.
- Returns:
List of Chunks
- Return type:
- get_node_name()¶
- 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.
- class bsb.connectivity.strategy.HemitypeCollection(hemitype: Hemitype, roi: list[Chunk])[source]¶
Bases:
objectClass used to iterate over an
Hemitypeplacement sets within a list of chunks, and over its cell types.- property placement¶
List the placement sets for each cell type, filtered according to the class morphology labels and list of chunks.
- Return type: