bsb package#
Subpackages#
- bsb.cli package
- bsb.config package
- Subpackages
- Submodules
- bsb.config.refs module
- bsb.config.types module
- Module contents
Configuration
Configuration.after_connectivity
Configuration.after_placement
Configuration.attr_name
Configuration.cell_types
Configuration.components
Configuration.connectivity
Configuration.default()
Configuration.get_node_name()
Configuration.morphologies
Configuration.name
Configuration.network
Configuration.node_name
Configuration.partitions
Configuration.placement
Configuration.regions
Configuration.simulations
Configuration.storage
ConfigurationAttribute
ConfigurationAttribute.flag_dirty()
ConfigurationAttribute.flag_pristine()
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()
after()
attr()
before()
catch_all()
compose_nodes()
copy_template()
dict()
dynamic()
file()
format_content()
from_content()
from_file()
from_json()
from_yaml()
get_config_attributes()
get_config_path()
get_parser()
has_hook()
list()
node()
on()
pluggable()
property()
provide()
ref()
reflist()
root()
run_hook()
slot()
unset()
walk_node_attributes()
walk_nodes()
- 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
PlacementIndications
PlacementIndications.count
PlacementIndications.count_ratio
PlacementIndications.density
PlacementIndications.density_key
PlacementIndications.density_ratio
PlacementIndications.geometry
PlacementIndications.get_node_name()
PlacementIndications.morphologies
PlacementIndications.planar_density
PlacementIndications.radius
PlacementIndications.relative_to
PlacementIndicator
- bsb.placement.particle module
AdaptiveNeighbourhood
LargeParticleSystem
Neighbourhood
Particle
ParticlePlacement
ParticleSystem
ParticleSystem.add_particle()
ParticleSystem.add_particles()
ParticleSystem.deintersect()
ParticleSystem.fill()
ParticleSystem.find_colliding_particles()
ParticleSystem.find_neighbourhood()
ParticleSystem.freeze()
ParticleSystem.get_packing_factor()
ParticleSystem.positions
ParticleSystem.prune()
ParticleSystem.remove_particles()
ParticleSystem.resolve_neighbourhood()
ParticleSystem.solve_collisions()
ParticleVoxel
RandomPlacement
SmallestNeighbourhood
distance()
get_particle_trace()
get_particles_trace()
plot_detailed_system()
plot_particle_system()
sphere_volume()
- bsb.placement.satellite module
- bsb.placement.strategy module
Entities
FixedPositions
PlacementStrategy
PlacementStrategy.after
PlacementStrategy.cell_types
PlacementStrategy.create_after()
PlacementStrategy.distribute
PlacementStrategy.get_after()
PlacementStrategy.get_indicators()
PlacementStrategy.get_node_name()
PlacementStrategy.get_ordered()
PlacementStrategy.guess_cell_count()
PlacementStrategy.has_after()
PlacementStrategy.indicator_class
PlacementStrategy.is_entities()
PlacementStrategy.name
PlacementStrategy.overrides
PlacementStrategy.partitions
PlacementStrategy.place()
PlacementStrategy.place_cells()
PlacementStrategy.queue()
PlacementStrategy.strategy
- Module contents
- bsb.connectivity package
- Subpackages
- Submodules
- bsb.connectivity.general module
- bsb.connectivity.strategy module
ConnectionStrategy
ConnectionStrategy.after
ConnectionStrategy.connect()
ConnectionStrategy.connect_cells()
ConnectionStrategy.create_after()
ConnectionStrategy.get_after()
ConnectionStrategy.get_cell_types()
ConnectionStrategy.get_node_name()
ConnectionStrategy.get_ordered()
ConnectionStrategy.get_region_of_interest()
ConnectionStrategy.has_after()
ConnectionStrategy.name
ConnectionStrategy.postsynaptic
ConnectionStrategy.presynaptic
ConnectionStrategy.queue()
ConnectionStrategy.strategy
Hemitype
HemitypeCollection
- Module contents
- bsb.simulation package
- Submodules
- bsb.simulation.simulation module
ProgressEvent
Simulation
Simulation.add_progress_listener()
Simulation.broadcast()
Simulation.cell_models
Simulation.connection_models
Simulation.devices
Simulation.duration
Simulation.get_connectivity_sets()
Simulation.get_model_of()
Simulation.get_node_name()
Simulation.get_rank()
Simulation.get_size()
Simulation.name
Simulation.post_prepare
Simulation.progress()
Simulation.simulator
Simulation.start_progress()
Simulation.step_progress()
- bsb.simulation.adapter module
- bsb.simulation.cell module
- bsb.simulation.component module
- bsb.simulation.connection module
- bsb.simulation.device module
- bsb.simulation.results module
- bsb.simulation.targetting module
- Module contents
- 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()
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.import_arb()
MorphologyRepository.import_file()
MorphologyRepository.import_swc()
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_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
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()
init_engines()
open_storage()
register_engine()
view_support()
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
.- 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)[source]#
Run reconstruction steps in the scaffold sequence to obtain a full network.
- property configuration: Configuration#
- 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]#
- get_connectivity_set(tag=None, pre=None, post=None) ConnectivitySet [source]#
Return a connectivity set from the output formatter.
- Parameters:
tag (str) – Unique identifier of the connectivity set in the output formatter
- Returns:
A connectivity set
- Return type:
- get_connectivity_sets() List[ConnectivitySet] [source]#
Return all connectivity sets from the output formatter.
- Parameters:
tag (str) – Unique identifier of the connectivity set in the output formatter
- Returns:
All connectivity sets
- get_placement(cell_types=None, skip=None, only=None) List[PlacementStrategy] [source]#
- get_placement_of(*cell_types)[source]#
Find all of the placement strategies that given certain 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.
- get_placement_sets() List[PlacementSet] [source]#
Return all of 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.
- property morphologies: MorphologyRepository#
- property network#
- property partitions#
- place_cells(cell_type, positions, morphologies=None, rotations=None, additional=None, chunk=None)[source]#
Place cells inside of 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#
- require_connectivity_set(pre, post, tag=None) ConnectivitySet [source]#
- 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_simulation(simulation_name: str, quit=False)[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)[source]#
Load
core.Scaffold
from a storage object.- Parameters:
root – Root (usually path) pointing to the storage object.
- 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.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.
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.ArborError(*args, **kwargs)#
Bases:
AdapterError
ArborError 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.CriticalDataWarning[source]#
Bases:
ScaffoldWarning
- 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.DeviceConnectionError(*args, **kwargs)#
Bases:
NeuronError
DeviceConnectionError 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.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.JsonImportError(*args, **kwargs)#
Bases:
JsonParseError
JsonImportError exception
- exception bsb.exceptions.JsonParseError(*args, **kwargs)#
Bases:
ParserError
JsonParseError exception
- exception bsb.exceptions.JsonReferenceError(*args, **kwargs)#
Bases:
JsonParseError
JsonReferenceError exception
- exception bsb.exceptions.KernelLockedError(*args, **kwargs)#
Bases:
NestError
KernelLockedError exception
- exception bsb.exceptions.KernelWarning[source]#
Bases:
SimulationWarning
- exception bsb.exceptions.LayoutError(*args, **kwargs)#
Bases:
TopologyError
LayoutError 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.NestError(*args, **kwargs)#
Bases:
AdapterError
NestError exception
- exception bsb.exceptions.NestKernelError(*args, **kwargs)#
Bases:
NestError
NestKernelError exception
- exception bsb.exceptions.NestModuleError(*args, **kwargs)#
Bases:
NestKernelError
NestModuleError exception
- exception bsb.exceptions.NeuronError(*args, **kwargs)#
Bases:
AdapterError
NeuronError exception
- 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.OrderError(*args, **kwargs)#
Bases:
ScaffoldError
OrderError exception
- exception bsb.exceptions.PackingError(*args, **kwargs)#
Bases:
PlacementError
PackingError exception
- exception bsb.exceptions.PackingWarning[source]#
Bases:
PlacementWarning
- exception bsb.exceptions.ParallelIntegrityError(*args, **kwargs)#
Bases:
AdapterError
ParallelIntegrityError exception
- 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.QuiverFieldWarning[source]#
Bases:
ScaffoldWarning
- exception bsb.exceptions.ReadOnlyOptionError(*args, **kwargs)#
Bases:
OptionError
ReadOnlyOptionError exception
- exception bsb.exceptions.ReceptorSpecificationError(*args, **kwargs)#
Bases:
NestError
ReceptorSpecificationError exception
- exception bsb.exceptions.RedoError(*args, **kwargs)#
Bases:
CompilationError
RedoError exception
- exception bsb.exceptions.ReificationError(*args, **kwargs)#
Bases:
ParameterError
ReificationError exception
- exception bsb.exceptions.RepositoryWarning[source]#
Bases:
ScaffoldWarning
- 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.SimulationWarning[source]#
Bases:
ScaffoldWarning
- exception bsb.exceptions.SourceQualityError(*args, **kwargs)#
Bases:
ExternalSourceError
SourceQualityError exception
- exception bsb.exceptions.StorageError(*args, **kwargs)#
Bases:
ScaffoldError
StorageError exception
- exception bsb.exceptions.SuffixTakenError(*args, **kwargs)#
Bases:
NestError
SuffixTakenError exception
- exception bsb.exceptions.TestError(*args, **kwargs)#
Bases:
ScaffoldError
TestError exception
- exception bsb.exceptions.TopologyError(*args, **kwargs)#
Bases:
ScaffoldError
TopologyError exception
- exception bsb.exceptions.TransmitterError(*args, **kwargs)#
Bases:
NeuronError
TransmitterError 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.UserUserDeprecationWarning[source]#
Bases:
ScaffoldWarning
- exception bsb.exceptions.VoxelSetError(*args, **kwargs)#
Bases:
ScaffoldError
VoxelSetError exception
bsb.exceptions module#
- 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.option 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.
- 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(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_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_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(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(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.AscendingAxonLengths(*args, _parent=None, _key=None, **kwargs)[source]#
Bases:
PostProcessingHook
- class bsb.postprocessing.BidirectionalContact(*args, _parent=None, _key=None, **kwargs)[source]#
Bases:
PostProcessingHook
- class bsb.postprocessing.DCNRotations(*args, _parent=None, _key=None, **kwargs)[source]#
Bases:
PostProcessingHook
Create a matrix of planes tilted between -45° and 45°, storing id and the planar coefficients a, b, c and d for each DCN cell
- class bsb.postprocessing.LabelMicrozones(*args, _parent=None, _key=None, **kwargs)[source]#
Bases:
PostProcessingHook
- get_node_name()#
- class bsb.postprocessing.MissingAxon(*args, _parent=None, _key=None, **kwargs)[source]#
Bases:
PostProcessingHook
- class bsb.postprocessing.PostProcessingHook(*args, _parent=None, _key=None, **kwargs)[source]#
Bases:
object
- get_node_name()#
- class bsb.postprocessing.SpoofDetails(*args, _parent=None, _key=None, **kwargs)[source]#
Bases:
PostProcessingHook
Create fake morphological intersections between already connected non-detailed connection types.
- casts = {'postsynaptic': <class 'str'>, 'presynaptic': <class 'str'>}#
bsb.reporting module#
- bsb.reporting.report(*message, level=2, ongoing=False, token=None, nodes=None, all_nodes=False)[source]#
Send a message to the appropriate output channel.
- bsb.reporting.set_report_file(v)[source]#
Set a file to which the scaffold package should report instead of stdout.
- bsb.reporting.warn(message, category=None, stacklevel=2)[source]#
Send a warning.
- Parameters:
message (str) – Warning message
category – The class of the warning.
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
- 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#