bsb package¶
Subpackages¶
- bsb.cli package
- bsb.config package
- Subpackages
- Submodules
- bsb.config.refs module
- bsb.config.types module
PackageRequirement
TypeHandler
WeakInverter
any_()
class_
deg_to_radian
dict()
distribution
evaluation
float()
fraction()
function_
in_()
in_classmap()
int()
key()
list()
list_or_scalar()
method
method_shortcut
mut_excl()
ndarray
none()
number()
object_
or_()
scalar_expand()
shortform()
str()
voxel_size()
- Module contents
Configuration
ConfigurationAttribute
ConfigurationAttribute.flag_dirty()
ConfigurationAttribute.flag_pristine()
ConfigurationAttribute.fset()
ConfigurationAttribute.get_default()
ConfigurationAttribute.get_hint()
ConfigurationAttribute.get_node_name()
ConfigurationAttribute.get_type()
ConfigurationAttribute.is_dirty()
ConfigurationAttribute.is_node_type()
ConfigurationAttribute.should_call_default()
ConfigurationAttribute.tree()
ConfigurationAttribute.tree_of()
Distribution
after()
attr()
before()
catch_all()
compose_nodes()
copy_configuration_template()
dict()
dynamic()
file()
format_configuration_content()
get_config_attributes()
get_config_path()
has_hook()
list()
make_configuration_diagram()
node()
on()
parse_configuration_content()
parse_configuration_file()
pluggable()
property()
provide()
ref()
reflist()
root()
run_hook()
slot()
unset()
walk_node_attributes()
walk_nodes()
- Dev
- bsb.topology package
- Submodules
- bsb.topology.partition module
AllenStructure
AllenStructure.find_structure()
AllenStructure.get_node_name()
AllenStructure.get_structure_idset()
AllenStructure.get_structure_mask()
AllenStructure.get_structure_mask_condition()
AllenStructure.mask_only
AllenStructure.mask_source
AllenStructure.struct_id
AllenStructure.struct_name
AllenStructure.voxel_size
Layer
NrrdVoxels
Partition
Rhomboid
Rhomboid.can_move
Rhomboid.can_rotate
Rhomboid.can_scale
Rhomboid.chunk_to_voxels()
Rhomboid.dimensions
Rhomboid.get_dependencies()
Rhomboid.get_layout()
Rhomboid.get_node_name()
Rhomboid.ldc
Rhomboid.mdc
Rhomboid.orientation
Rhomboid.origin
Rhomboid.rotate()
Rhomboid.scale()
Rhomboid.surface()
Rhomboid.to_chunks()
Rhomboid.translate()
Rhomboid.volume()
Voxels
- bsb.topology.region module
- Module contents
- bsb.morphologies package
- bsb.placement package
- Submodules
- bsb.placement.arrays module
- bsb.placement.distributor module
- bsb.placement.indicator module
- bsb.placement.random module
- bsb.placement.strategy module
Entities
FixedPositions
PlacementStrategy
PlacementStrategy.cell_types
PlacementStrategy.depends_on
PlacementStrategy.distribute
PlacementStrategy.get_deps()
PlacementStrategy.get_indicators()
PlacementStrategy.get_node_name()
PlacementStrategy.guess_cell_count()
PlacementStrategy.indicator_class
PlacementStrategy.is_entities()
PlacementStrategy.name
PlacementStrategy.overrides
PlacementStrategy.partitions
PlacementStrategy.place()
PlacementStrategy.place_cells()
PlacementStrategy.queue()
PlacementStrategy.scaffold
PlacementStrategy.strategy
- Module contents
- bsb.connectivity package
- Subpackages
- Submodules
- bsb.connectivity.general module
- bsb.connectivity.strategy module
ConnectionStrategy
ConnectionStrategy.connect()
ConnectionStrategy.connect_cells()
ConnectionStrategy.depends_on
ConnectionStrategy.get_all_post_chunks()
ConnectionStrategy.get_all_pre_chunks()
ConnectionStrategy.get_cell_types()
ConnectionStrategy.get_deps()
ConnectionStrategy.get_node_name()
ConnectionStrategy.get_output_names()
ConnectionStrategy.get_region_of_interest()
ConnectionStrategy.name
ConnectionStrategy.output_naming
ConnectionStrategy.postsynaptic
ConnectionStrategy.presynaptic
ConnectionStrategy.queue()
ConnectionStrategy.scaffold
ConnectionStrategy.strategy
Hemitype
HemitypeCollection
- Module contents
- bsb.simulation package
- Submodules
- bsb.simulation.simulation module
- bsb.simulation.adapter module
- bsb.simulation.cell module
- bsb.simulation.component module
- bsb.simulation.connection module
- bsb.simulation.device module
- bsb.simulation.parameter module
- bsb.simulation.results module
- bsb.simulation.targetting module
- Module contents
- bsb.services package
- Submodules
- bsb.services.mpi module
- bsb.services.mpilock module
- bsb.services.pool module
ConnectivityJob
FunctionJob
Job
JobErroredError
JobPool
JobPool.add_listener()
JobPool.add_notification()
JobPool.change_status()
JobPool.execute()
JobPool.get_owner()
JobPool.get_required_cache_items()
JobPool.get_submissions_of()
JobPool.get_tmp_folder()
JobPool.is_main()
JobPool.jobs
JobPool.notify()
JobPool.owner
JobPool.parallel
JobPool.ping()
JobPool.queue()
JobPool.queue_connectivity()
JobPool.queue_placement()
JobPool.raise_unhandled()
JobPool.schedule()
JobPool.scheduling
JobPool.status
JobPool.workflow
JobStatus
PlacementJob
PoolJobAddedProgress
PoolJobUpdateProgress
PoolProgress
PoolProgressReason
PoolStatus
PoolStatusProgress
SubmissionContext
Workflow
WorkflowError
dispatcher()
free_stale_pool_cache()
get_node_cache_items()
pool_cache()
- Developer modules
- bsb.storage package
- Subpackages
- Submodules
- bsb.storage.interfaces module
ConnectivityIterator
ConnectivitySet
ConnectivitySet.chunk_connect()
ConnectivitySet.clear()
ConnectivitySet.connect()
ConnectivitySet.create()
ConnectivitySet.exists()
ConnectivitySet.flat_iter_connections()
ConnectivitySet.get_global_chunks()
ConnectivitySet.get_local_chunks()
ConnectivitySet.get_tags()
ConnectivitySet.load_block_connections()
ConnectivitySet.load_connections()
ConnectivitySet.load_local_connections()
ConnectivitySet.nested_iter_connections()
ConnectivitySet.post_type
ConnectivitySet.post_type_name
ConnectivitySet.pre_type
ConnectivitySet.pre_type_name
ConnectivitySet.require()
ConnectivitySet.tag
Engine
Engine.clear_connectivity()
Engine.clear_placement()
Engine.comm
Engine.copy()
Engine.create()
Engine.exists()
Engine.format
Engine.get_chunk_stats()
Engine.move()
Engine.peek_exists()
Engine.read_only()
Engine.readwrite()
Engine.recognizes()
Engine.remove()
Engine.root
Engine.root_slug
Engine.set_comm()
Engine.versions
FileStore
FileStore.all()
FileStore.find_file()
FileStore.find_files()
FileStore.find_id()
FileStore.find_meta()
FileStore.get()
FileStore.get_encoding()
FileStore.get_meta()
FileStore.get_mtime()
FileStore.has()
FileStore.load()
FileStore.load_active_config()
FileStore.remove()
FileStore.store()
FileStore.store_active_config()
GeneratedMorphology
Interface
MorphologyRepository
MorphologyRepository.all()
MorphologyRepository.get_all_meta()
MorphologyRepository.get_meta()
MorphologyRepository.has()
MorphologyRepository.list()
MorphologyRepository.load()
MorphologyRepository.preload()
MorphologyRepository.save()
MorphologyRepository.select()
MorphologyRepository.set_all_meta()
MorphologyRepository.update_all_meta()
NetworkDescription
NoopLock
PlacementSet
PlacementSet.append_additional()
PlacementSet.append_data()
PlacementSet.cell_type
PlacementSet.chunk_context()
PlacementSet.clear()
PlacementSet.count_morphologies()
PlacementSet.create()
PlacementSet.exists()
PlacementSet.get_all_chunks()
PlacementSet.get_chunk_stats()
PlacementSet.get_label_mask()
PlacementSet.get_labelled()
PlacementSet.label()
PlacementSet.load_additional()
PlacementSet.load_box_tree()
PlacementSet.load_boxes()
PlacementSet.load_ids()
PlacementSet.load_morphologies()
PlacementSet.load_positions()
PlacementSet.load_rotations()
PlacementSet.require()
PlacementSet.set_chunk_filter()
PlacementSet.set_label_filter()
PlacementSet.set_morphology_label_filter()
PlacementSet.tag
ReadOnlyManager
StorageNode
StoredFile
StoredMorphology
- Module contents
chunklist()
Chunk
NotSupported
Storage
Storage.assert_support()
Storage.clear_connectivity()
Storage.clear_placement()
Storage.copy()
Storage.create()
Storage.exists()
Storage.files
Storage.format
Storage.get_chunk_stats()
Storage.get_connectivity_set()
Storage.get_connectivity_sets()
Storage.get_placement_set()
Storage.init()
Storage.init_placement()
Storage.is_main_process()
Storage.load()
Storage.load_active_config()
Storage.morphologies
Storage.move()
Storage.preexisted
Storage.read_only()
Storage.remove()
Storage.renew()
Storage.require_connectivity_set()
Storage.require_placement_set()
Storage.root
Storage.root_slug
Storage.store_active_config()
Storage.supports()
create_engine()
discover_engines()
get_engine_node()
get_engines()
open_storage()
view_support()
MorphologyOperationCallable
OperationCallable
CodeDependencyNode
FileDependency
FileDependencyNode
FileScheme
MorphologyDependencyNode
MorphologyDependencyNode.get_morphology_name()
MorphologyDependencyNode.get_node_name()
MorphologyDependencyNode.load_object()
MorphologyDependencyNode.name
MorphologyDependencyNode.parser
MorphologyDependencyNode.pipeline
MorphologyDependencyNode.queue()
MorphologyDependencyNode.store_content()
MorphologyDependencyNode.store_object()
MorphologyOperation
NeuroMorphoScheme
NrrdDependencyNode
Operation
UriScheme
UrlScheme
Submodules¶
bsb.core module¶
- class bsb.core.Scaffold(config=None, storage=None, clear=False, comm=None)[source]¶
Bases:
object
This is the main object of the bsb package, it represents a network and puts together all the pieces that make up the model description such as the
Configuration
with the technical side like theStorage
.Bootstraps a network object.
- Parameters:
config (
Configuration
) – The configuration to use for this network. If it is omitted the default configuration is used.storage (
Storage
) – The storage to use to read and write data for this network. If it is omitted the configuration’sStorage
node is used to construct one.clear (bool) – Start with a new network, clearing any previously stored information
comm (mpi4py.MPI.Comm) – MPI communicator that shares control over the Storage.
- Returns:
A network object
- Return type:
- property after_connectivity¶
- property after_placement¶
- attr = 'simulations'¶
- property cell_types¶
- compile(skip_placement=False, skip_connectivity=False, skip_after_placement=False, skip_after_connectivity=False, only=None, skip=None, clear=False, append=False, redo=False, force=False, fail_fast=True)[source]¶
Run reconstruction steps in the scaffold sequence to obtain a full network.
- property configuration: Configuration¶
- connect_cells(pre_set, post_set, src_locs, dest_locs, name)[source]¶
Connect cells from a presynaptic placement set to cells of a postsynaptic placement set, and into a 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.
name (str) – Name to give to the ConnectivitySet
- property connectivity¶
- create_entities(cell_type, count)[source]¶
Create entities in the simulation space.
Entities are different from cells because they have no positional data and don’t influence the placement step. They do have a representation in the connection and simulation step.
- get_connectivity(anywhere=None, presynaptic=None, postsynaptic=None, skip=None, only=None) List[ConnectivitySet] [source]¶
- Return type:
- get_connectivity_set(tag=None, pre=None, post=None) ConnectivitySet [source]¶
Return a connectivity set from its name according to the output formatter. The name can be specified directly with tag or with deduced from pre and post if there is only one connectivity set matching this pair.
- Parameters:
- Returns:
A connectivity set
- Return type:
- get_connectivity_sets() List[ConnectivitySet] [source]¶
Return all connectivity sets from the output formatter.
- Returns:
All connectivity sets
- Return type:
List[
ConnectivitySet
]
- get_placement(cell_types=None, skip=None, only=None) List[PlacementStrategy] [source]¶
- Return type:
- get_placement_of(*cell_types)[source]¶
Find all the placement strategies that involve the given cell types.
- get_placement_set(type, chunks=None, labels=None, morphology_labels=None) PlacementSet [source]¶
Return a cell type’s placement set from the output formatter.
- Parameters:
- Returns:
A placement set
- Return type:
- get_placement_sets() List[PlacementSet] [source]¶
Return all the placement sets present in the network.
- Return type:
List[PlacementSet]
- get_simulation(sim_name: str) Simulation [source]¶
Retrieve the default single-instance adapter for a simulation.
- Parameters:
sim_name (str)
- Return type:
- property morphologies: MorphologyRepository¶
- property network¶
- property partitions¶
- place_cells(cell_type, positions, morphologies=None, rotations=None, additional=None, chunk=None)[source]¶
Place cells inside the scaffold
# Add one granule cell at position 0, 0, 0 cell_type = scaffold.get_cell_type("granule_cell") scaffold.place_cells(cell_type, cell_type.layer_instance, [[0., 0., 0.]])
- Parameters:
cell_type (CellType) – The type of the cells to place.
positions (Any np.concatenate type of shape (N, 3).) – A collection of xyz positions to place the cells on.
- property placement¶
- property regions¶
- register_pool_cached_item(id, cleanup)[source]¶
Registers a cleanup function for items cached during a parallel workflow. Internal use only.
- Parameters:
id – Id of the cached item. Should be unique but identical across MPI nodes
cleanup – A callable that cleans up the cached item.
- require_connectivity_set(pre, post, tag=None) ConnectivitySet [source]¶
- Return type:
- resize(x=None, y=None, z=None)[source]¶
Updates the topology boundary indicators. Use before placement, updates only the abstract topology tree, does not rescale, prune or otherwise alter already existing placement data.
- run_after_connectivity(hooks=None, fail_fast=None, pipelines=True)[source]¶
Run after placement hooks.
- run_connectivity(strategies=None, fail_fast=True, pipelines=True)[source]¶
Run connection strategies.
- run_simulation(simulation_name: str)[source]¶
Run a simulation starting from the default single-instance adapter.
- Parameters:
simulation_name (str) – Name of the simulation in the configuration.
- property simulations¶
- property storage_cfg¶
- bsb.core.from_storage(root, comm=None)[source]¶
Load
core.Scaffold
from a storage object.- Parameters:
root – Root (usually path) pointing to the storage object.
comm (mpi4py.MPI.Comm) – MPI communicator that shares control over the Storage.
- Returns:
A network scaffold
- Return type:
bsb.cell_types module¶
Module for the CellType configuration node and its dependencies.
- class bsb.cell_types.CellType(*args, _parent=None, _key=None, **kwargs)[source]¶
Bases:
object
Information on a population of cells.
- clear_connections()[source]¶
Clear all the connectivity data associated with this cell type. Any connectivity set that this cell type is a part of will be entirely removed.
- clear_placement()[source]¶
Clear all the placement data associated with this cell type. Connectivity data will remain, but be invalid.
- entity¶
Whether this cell type is an entity type. Entity types don’t have representations in space, but can still be connected and simulated.
- get_morphologies()[source]¶
Return the list of morphologies of this cell type.
- Return type:
List[StoredMorphology]
- get_node_name()¶
- get_placement_set(*args, **kwargs)[source]¶
Retrieve this cell type’s placement data
- Parameters:
chunks (List[bsb.storage._chunks.Chunk]) – When given, restricts the placement data to these chunks.
- property morphologies¶
- name¶
Name of the cell type, equivalent to the key it occurs under in the configuration.
- plotting¶
Plotting information about the cell type, such as color and labels.
- spatial¶
Spatial information about the cell type such as radius and density, and geometric or morphological information.
- class bsb.cell_types.PlacementIndications(*args, _parent=None, _key=None, **kwargs)[source]¶
Bases:
object
- count: int¶
Base implementation of all the different configuration attributes. Call the factory function
attr()
instead.
- count_ratio: float¶
Base implementation of all the different configuration attributes. Call the factory function
attr()
instead.
- density: float¶
Base implementation of all the different configuration attributes. Call the factory function
attr()
instead.
- density_key: str¶
Base implementation of all the different configuration attributes. Call the factory function
attr()
instead.
- density_ratio: float¶
Base implementation of all the different configuration attributes. Call the factory function
attr()
instead.
- get_node_name()¶
- local_count_ratio: float¶
Base implementation of all the different configuration attributes. Call the factory function
attr()
instead.
- morphologies: cfglist[MorphologySelector]¶
- planar_density: float¶
Base implementation of all the different configuration attributes. Call the factory function
attr()
instead.
bsb.exceptions module¶
- exception bsb.exceptions.AdapterError(*args, **kwargs)¶
Bases:
ScaffoldError
AdapterError exception
- exception bsb.exceptions.AllenApiError(*args, **kwargs)¶
Bases:
GatewayError
AllenApiError exception
- exception bsb.exceptions.AttributeMissingError(*args, **kwargs)¶
Bases:
StorageError
AttributeMissingError exception
- exception bsb.exceptions.BootError(*args, **kwargs)¶
Bases:
ConfigurationError
BootError exception
- exception bsb.exceptions.CLIError(*args, **kwargs)¶
Bases:
ScaffoldError
CLIError exception
- exception bsb.exceptions.CastConfigurationError(*args, **kwargs)¶
Bases:
ConfigurationError
CastConfigurationError exception
- exception bsb.exceptions.CastError(*args, **kwargs)¶
Bases:
ConfigurationError
CastError exception
- exception bsb.exceptions.CfgReferenceError(*args, **kwargs)¶
Bases:
ConfigurationError
CfgReferenceError exception
- exception bsb.exceptions.ChunkError(*args, **kwargs)¶
Bases:
PlacementError
ChunkError exception
- exception bsb.exceptions.CircularMorphologyError(*args, **kwargs)¶
Bases:
MorphologyError
CircularMorphologyError exception
- exception bsb.exceptions.ClassError(*args, **kwargs)¶
Bases:
ScaffoldError
ClassError exception
- exception bsb.exceptions.ClassMapMissingError(*args, **kwargs)¶
Bases:
DynamicClassError
ClassMapMissingError exception
- exception bsb.exceptions.CodeImportError(*args, **kwargs)¶
Bases:
ScaffoldError
CodeImportError exception
- exception bsb.exceptions.CompartmentError(*args, **kwargs)¶
Bases:
MorphologyError
CompartmentError exception
- exception bsb.exceptions.CompilationError(*args, **kwargs)¶
Bases:
ScaffoldError
CompilationError exception
- exception bsb.exceptions.ConfigTemplateNotFoundError(*args, **kwargs)¶
Bases:
CLIError
ConfigTemplateNotFoundError exception
- exception bsb.exceptions.ConfigurationError(*args, **kwargs)¶
Bases:
ScaffoldError
ConfigurationError exception
- exception bsb.exceptions.ConfigurationFormatError(*args, **kwargs)¶
Bases:
ConfigurationError
ConfigurationFormatError exception
- exception bsb.exceptions.ConfigurationWarning[source]¶
Bases:
ScaffoldWarning
- exception bsb.exceptions.ConnectivityError(*args, **kwargs)¶
Bases:
ScaffoldError
ConnectivityError exception
- exception bsb.exceptions.ConnectivityWarning[source]¶
Bases:
ScaffoldWarning
- exception bsb.exceptions.ContinuityError(*args, **kwargs)¶
Bases:
PlacementError
ContinuityError exception
- exception bsb.exceptions.DataNotFoundError(*args, **kwargs)¶
Bases:
StorageError
DataNotFoundError exception
- exception bsb.exceptions.DataNotProvidedError(*args, **kwargs)¶
Bases:
ScaffoldError
DataNotProvidedError exception
- exception bsb.exceptions.DatasetExistsError(*args, **kwargs)¶
Bases:
StorageError
DatasetExistsError exception
- exception bsb.exceptions.DatasetNotFoundError(*args, **kwargs)¶
Bases:
StorageError
DatasetNotFoundError exception
- exception bsb.exceptions.DependencyError(*args, **kwargs)¶
Bases:
ScaffoldError
DependencyError exception
- exception bsb.exceptions.DistributionCastError(*args, **kwargs)¶
Bases:
CastError
DistributionCastError exception
- exception bsb.exceptions.DistributorError(*args, **kwargs)¶
Bases:
CompilationError
DistributorError exception
- exception bsb.exceptions.DynamicClassError(*args, **kwargs)¶
Bases:
ConfigurationError
DynamicClassError exception
- exception bsb.exceptions.DynamicClassInheritanceError(*args, **kwargs)¶
Bases:
DynamicClassError
DynamicClassInheritanceError exception
- exception bsb.exceptions.DynamicObjectNotFoundError(*args, **kwargs)¶
Bases:
DynamicClassError
DynamicObjectNotFoundError exception
- exception bsb.exceptions.EmptyBranchError(*args, **kwargs)¶
Bases:
MorphologyError
EmptyBranchError exception
- exception bsb.exceptions.EmptySelectionError(*args, **kwargs)¶
Bases:
MorphologyError
EmptySelectionError exception
- exception bsb.exceptions.EmptyVoxelSetError(*args, **kwargs)¶
Bases:
VoxelSetError
EmptyVoxelSetError exception
- exception bsb.exceptions.ExternalSourceError(*args, **kwargs)¶
Bases:
ConnectivityError
ExternalSourceError exception
- exception bsb.exceptions.FileImportError(*args, **kwargs)¶
Bases:
ParserError
FileImportError exception
- exception bsb.exceptions.FileReferenceError(*args, **kwargs)¶
Bases:
ParserError
FileReferenceError exception
- exception bsb.exceptions.GatewayError(*args, **kwargs)¶
Bases:
ScaffoldError
GatewayError exception
- exception bsb.exceptions.IncompleteExternalMapError(*args, **kwargs)¶
Bases:
ExternalSourceError
IncompleteExternalMapError exception
- exception bsb.exceptions.IncompleteMorphologyError(*args, **kwargs)¶
Bases:
MorphologyError
IncompleteMorphologyError exception
- exception bsb.exceptions.IndicatorError(*args, **kwargs)¶
Bases:
ConfigurationError
IndicatorError exception
- exception bsb.exceptions.IntersectionDataNotFoundError(*args, **kwargs)¶
Bases:
DatasetNotFoundError
IntersectionDataNotFoundError exception
- exception bsb.exceptions.InvalidReferenceError(*args, **kwargs)¶
Bases:
TypeHandlingError
InvalidReferenceError exception
- exception bsb.exceptions.JobCancelledError(*args, **kwargs)¶
Bases:
JobPoolError
JobCancelledError exception
- exception bsb.exceptions.JobPoolContextError(*args, **kwargs)¶
Bases:
JobPoolError
JobPoolContextError exception
- exception bsb.exceptions.JobPoolError(*args, **kwargs)¶
Bases:
ScaffoldError
JobPoolError exception
- exception bsb.exceptions.JobSchedulingError(*args, **kwargs)¶
Bases:
JobPoolError
JobSchedulingError exception
- exception bsb.exceptions.LayoutError(*args, **kwargs)¶
Bases:
TopologyError
LayoutError exception
- exception bsb.exceptions.MissingActiveConfigError(*args, **kwargs)¶
Bases:
StorageError
MissingActiveConfigError exception
- exception bsb.exceptions.MissingMorphologyError(*args, **kwargs)¶
Bases:
MorphologyError
MissingMorphologyError exception
- exception bsb.exceptions.MissingSourceError(*args, **kwargs)¶
Bases:
ExternalSourceError
MissingSourceError exception
- exception bsb.exceptions.MorphologyDataError(*args, **kwargs)¶
Bases:
MorphologyError
MorphologyDataError exception
- exception bsb.exceptions.MorphologyError(*args, **kwargs)¶
Bases:
ScaffoldError
MorphologyError exception
- exception bsb.exceptions.MorphologyRepositoryError(*args, **kwargs)¶
Bases:
MorphologyError
MorphologyRepositoryError exception
- exception bsb.exceptions.MorphologyWarning[source]¶
Bases:
ScaffoldWarning
- exception bsb.exceptions.NoReferenceAttributeSignal(*args, **kwargs)¶
Bases:
CfgReferenceError
NoReferenceAttributeSignal exception
- exception bsb.exceptions.NodeNotFoundError(*args, **kwargs)¶
Bases:
ScaffoldError
NodeNotFoundError exception
- exception bsb.exceptions.NoneReferenceError(*args, **kwargs)¶
Bases:
TypeHandlingError
NoneReferenceError exception
- exception bsb.exceptions.OptionError(*args, **kwargs)¶
Bases:
ScaffoldError
OptionError exception
- exception bsb.exceptions.PackageRequirementWarning[source]¶
Bases:
ScaffoldWarning
- exception bsb.exceptions.PackingError(*args, **kwargs)¶
Bases:
PlacementError
PackingError exception
- exception bsb.exceptions.PackingWarning[source]¶
Bases:
PlacementWarning
- exception bsb.exceptions.ParameterError(*args, **kwargs)¶
Bases:
SimulationError
ParameterError exception
- exception bsb.exceptions.ParserError(*args, **kwargs)¶
Bases:
ScaffoldError
ParserError exception
- exception bsb.exceptions.PlacementError(*args, **kwargs)¶
Bases:
ScaffoldError
PlacementError exception
- exception bsb.exceptions.PlacementRelationError(*args, **kwargs)¶
Bases:
PlacementError
PlacementRelationError exception
- exception bsb.exceptions.PlacementWarning[source]¶
Bases:
ScaffoldWarning
- exception bsb.exceptions.PluginError(*args, **kwargs)¶
Bases:
ScaffoldError
PluginError exception
- exception bsb.exceptions.ReadOnlyOptionError(*args, **kwargs)¶
Bases:
OptionError
ReadOnlyOptionError exception
- exception bsb.exceptions.RedoError(*args, **kwargs)¶
Bases:
CompilationError
RedoError exception
- exception bsb.exceptions.ReificationError(*args, **kwargs)¶
Bases:
ParameterError
ReificationError exception
- exception bsb.exceptions.RequirementError(*args, **kwargs)¶
Bases:
ConfigurationError
RequirementError exception
- exception bsb.exceptions.ScaffoldError(*args, **kwargs)¶
Bases:
DetailedException
ScaffoldError exception
- exception bsb.exceptions.ScaffoldWarning[source]¶
Bases:
UserWarning
- exception bsb.exceptions.SelectorError(*args, **kwargs)¶
Bases:
ScaffoldError
SelectorError exception
- exception bsb.exceptions.SimulationError(*args, **kwargs)¶
Bases:
ScaffoldError
SimulationError exception
- exception bsb.exceptions.SourceQualityError(*args, **kwargs)¶
Bases:
ExternalSourceError
SourceQualityError exception
- exception bsb.exceptions.StorageError(*args, **kwargs)¶
Bases:
ScaffoldError
StorageError exception
- exception bsb.exceptions.TopologyError(*args, **kwargs)¶
Bases:
ScaffoldError
TopologyError exception
- exception bsb.exceptions.TreeError(*args, **kwargs)¶
Bases:
ScaffoldError
TreeError exception
- exception bsb.exceptions.TypeHandlingError(*args, **kwargs)¶
Bases:
ScaffoldError
TypeHandlingError exception
- exception bsb.exceptions.UnfitClassCastError(*args, **kwargs)¶
Bases:
CastError
UnfitClassCastError exception
- exception bsb.exceptions.UnknownConfigAttrError(*args, **kwargs)¶
Bases:
ConfigurationError
UnknownConfigAttrError exception
- exception bsb.exceptions.UnknownGIDError(*args, **kwargs)¶
Bases:
ConnectivityError
UnknownGIDError exception
- exception bsb.exceptions.UnknownStorageEngineError(*args, **kwargs)¶
Bases:
StorageError
UnknownStorageEngineError exception
- exception bsb.exceptions.UnmanagedPartitionError(*args, **kwargs)¶
Bases:
TopologyError
UnmanagedPartitionError exception
- exception bsb.exceptions.UnresolvedClassCastError(*args, **kwargs)¶
Bases:
CastError
UnresolvedClassCastError exception
- exception bsb.exceptions.VoxelSetError(*args, **kwargs)¶
Bases:
ScaffoldError
VoxelSetError exception
bsb.exceptions module¶
- class bsb.mixins.HasDependencies[source]¶
Mixin class to mark that this node may depend on other nodes.
- class bsb.mixins.InvertedRoI[source]¶
This mixin inverts the perspective of the
get_region_of_interest
interface and lets you find presynaptic regions of interest for a postsynaptic chunk.Usage:
..code-block:: python
- class MyConnStrat(InvertedRoI, ConnectionStrategy):
- def get_region_of_interest(post_chunk):
return [pre_chunk1, pre_chunk2]
bsb.option module¶
This module contains the classes required to construct options.
- class bsb.option.BsbOption(positional=False)[source]¶
Bases:
object
Base option class. Can be subclassed to create new options.
- get(prio=None)[source]¶
Get the option’s value. Cascades the script, cli, env & default descriptors together.
- Returns:
option value
- get_cli_tags()[source]¶
Return the
argparse
positional arguments from the tags.- Returns:
-x
or--xxx
for each CLI tag.- Return type:
- classmethod register()[source]¶
Register this option class into the
bsb.options
module.
- unregister()[source]¶
Remove this option class from the
bsb.options
module, not part of the public API as removing options is undefined behavior but useful for testing.
- class bsb.option.CLIOptionDescriptor(*tags)[source]¶
Bases:
OptionDescriptor
Descriptor that retrieves its value from the given CLI command arguments.
- slug = 'cli'¶
- class bsb.option.EnvOptionDescriptor(*args, flag=False)[source]¶
Bases:
OptionDescriptor
Descriptor that retrieves its value from the environment variables.
- slug = 'env'¶
- class bsb.option.OptionDescriptor(*tags)[source]¶
Bases:
object
Base option property descriptor. Can be inherited from to create a cascading property such as the default CLI, env & script descriptors.
- class bsb.option.ProjectOptionDescriptor(*tags)[source]¶
Bases:
OptionDescriptor
Descriptor that retrieves and stores values in the pyproject.toml file. Traverses up the filesystem tree until one is found.
- slug = 'project'¶
- class bsb.option.ScriptOptionDescriptor(*tags)[source]¶
Bases:
OptionDescriptor
Descriptor that retrieves and sets its value from/to the
bsb.options
module.- slug = 'script'¶
bsb.options module¶
This module contains the global options.
You can set options at the script
level (which superceeds all other levels such as
environment variables or project settings).
import bsb.options
from bsb import BsbOption
class MyOption(BsbOption, cli=("my_setting",), env=("MY_SETTING",), script=("my_setting", "my_alias")):
def get_default(self):
return 4
# Register the option into the `bsb.options` module
MyOption.register()
assert bsb.options.my_setting == 4
bsb.options.my_alias = 6
assert bsb.options.my_setting == 6
Your MyOption
will also be available on all CLI commands as --my_setting
and will
be read from the MY_SETTING
environment variable.
- class bsb.options.ProfilingOption(positional=False)[source]¶
Bases:
BsbOption
Enables profiling.
- cli¶
Descriptor that retrieves its value from the given CLI command arguments.
- description = None¶
- env¶
Descriptor that retrieves its value from the environment variables.
- inverted_flag = False¶
- is_flag = True¶
- name = 'profiling'¶
- positional = False¶
- project¶
Descriptor that retrieves and stores values in the pyproject.toml file. Traverses up the filesystem tree until one is found.
- readonly = False¶
- script¶
Descriptor that retrieves and sets its value from/to the
bsb.options
module.
- use_action = False¶
- use_extend = False¶
- class bsb.options.VerbosityOption(positional=False)[source]¶
Bases:
BsbOption
Set the verbosity of the package. Verbosity 0 is completely silent, 1 is default, 2 is verbose, 3 is progress and 4 is debug.
- cli¶
Descriptor that retrieves its value from the given CLI command arguments.
- description = None¶
- env¶
Descriptor that retrieves its value from the environment variables.
- inverted_flag = False¶
- is_flag = False¶
- name = 'verbosity'¶
- positional = False¶
- project¶
Descriptor that retrieves and stores values in the pyproject.toml file. Traverses up the filesystem tree until one is found.
- readonly = False¶
- script¶
Descriptor that retrieves and sets its value from/to the
bsb.options
module.
- use_action = False¶
- use_extend = False¶
- bsb.options.get_module_option(tag)[source]¶
Get the value of a module option. Does the same thing as
getattr(options, tag)
- Parameters:
tag (str) – Name the option is registered with in the module.
- bsb.options.get_option_classes()[source]¶
Return all of the classes that are used to create singleton options from. Useful to access the option descriptors rather than the option values.
- Returns:
The classes of all the installed options by name.
- Return type:
- bsb.options.get_option_descriptor(name)[source]¶
Return an option
- Parameters:
name (str) – Name of the option to look for.
- Returns:
The option singleton of that name.
- Return type:
- bsb.options.get_project_option(tag)[source]¶
Find a project option
- Parameters:
tag (str) – dot-separated path of the option. e.g.
networks.config_link
.- Returns:
Project option instance
- Return type:
- bsb.options.read_option(tag=None)[source]¶
Read an option value from the project settings. Returns all project settings if tag is omitted.
- Parameters:
tag (str) – Dot-separated path of the project option
- Returns:
Value for the project option
- Return type:
Any
- bsb.options.register_option(name, option)[source]¶
Register an option as a global BSB option. Options that are installed by the plugin system are automatically registered on import of the BSB.
- Parameters:
name (str) – Name for the option, used to store and retrieve its singleton.
option (
option.BsbOption
) – Option instance, to be used as a singleton.
- bsb.options.set_module_option(tag, value)[source]¶
Set the value of a module option. Does the same thing as
setattr(options, tag, value)
.- Parameters:
tag (str) – Name the option is registered with in the module.
value (Any) – New module value for the option
- bsb.options.store_option(tag, value)[source]¶
Store an option value permanently in the project settings.
- Parameters:
tag (str) – Dot-separated path of the project option
value (Any) – New value for the project option
- bsb.options.unregister_option(option)[source]¶
Unregister a globally registered option. Also removes its script and project parts.
- Parameters:
option (
option.BsbOption
) – Option singleton, to be removed.
bsb.plugins module¶
Plugins module. Uses pkg_resources
to detect installed plugins and loads them as
categories.
bsb.postprocessing module¶
- class bsb.postprocessing.AfterConnectivityHook(*args, _parent=None, _key=None, **kwargs)[source]¶
Bases:
ABC
- get_node_name()¶
- class bsb.postprocessing.AfterPlacementHook(*args, _parent=None, _key=None, **kwargs)[source]¶
Bases:
ABC
- get_node_name()¶
- class bsb.postprocessing.BidirectionalContact(*args, _parent=None, _key=None, **kwargs)[source]¶
Bases:
AfterConnectivityHook
- class bsb.postprocessing.Relay(*args, _parent=None, _key=None, **kwargs)[source]¶
Bases:
AfterConnectivityHook
Replaces connections on a cell with the relayed connections to the connection targets of that cell. Not implemented yet.
- cell_types¶
- get_node_name()¶
- class bsb.postprocessing.SpoofDetails(*args, _parent=None, _key=None, **kwargs)[source]¶
Bases:
AfterConnectivityHook
Create fake morphological intersections between already connected non-detailed connection types.
- casts = {'postsynaptic': <class 'str'>, 'presynaptic': <class 'str'>}¶
bsb.reporting module¶
bsb.trees module¶
Module for binary space partitioning, to facilitate optimal runtime complexity for n-point problems.
- class bsb.trees.BoxTree(boxes)[source]¶
Tree for fast lookup of repeat queries of axis aligned rhomboids.
bsb.voxels module¶
- class bsb.voxels.VoxelData(data, keys=None)[source]¶
Bases:
ndarray
Chunk identifier, consisting of chunk coordinates and size.
- property keys¶
Returns the keys, or column labels, associated to each data column.
- class bsb.voxels.VoxelSet(voxels, size, data=None, data_keys=None, irregular=False)[source]¶
Bases:
object
Constructs a voxel set from the given voxel indices or coordinates.
- Parameters:
voxels (numpy.ndarray) – The spatial coordinates, or grid indices of each voxel. Nx3 matrix
size (numpy.ndarray) – The global or individual size of the voxels. If it has 2 dimensions it needs to have the same length as voxels, and will be used as individual voxels.
data
Warning
If
numpy.ndarray
are passed, they will not be copied in order to save memory and time. You may accidentally change a voxelset if you later change the same array.- property bounds¶
The minimum and maximum coordinates of this set.
- Return type:
- property data¶
The size of the voxels. When it is 0D or 1D it counts as the size for all voxels, if it is 2D it is 1 an individual size per voxel.
- Return type:
Union[numpy.ndarray, None]
- property data_keys¶
- property of_equal_size¶
- property raw¶
- property size¶
The size of the voxels. When it is 0D or 1D it counts as the size for all voxels, if it is 2D it is 1 an individual size per voxel.
- Return type:
- property volume¶
Module contents¶
bsb-core is the backbone package contain the essential code of the BSB: A component framework for multiscale bottom-up neural modelling.
bsb-core needs to be installed alongside a bundle of desired bsb plugins, some of which are essential for bsb-core to function. First time users are recommended to install the bsb package instead.