Configuration reference¶
Note
The key of a configuration object in its parent will be stored as its name property and is used throughout the package. Some of these values are hardcoded into the package and the names of the standard configuration objects should not be changed.
Root attributes¶
The root node accepts the following attributes:
name: Unused, a name for the configuration file. Is stored in the output files so it can be used for reference.
output: Configuration object for the output
output.HDF5Formatter
.network_architecture: Configuration object for general simulation properties.
layers: A dictionary containing the
models.Layer
configurations.cell_types: A dictionary containing the
models.CellType
configurations.connection_types: A dictionary containing the
connectivity.ConnectionStrategy
configurations.simulations: A dictionary containing the
simulation.SimulationAdapter
configurations.
{
"name": "...",
"output": {
},
"network_architecture": {
},
"layers": {
"some_layer": {
},
"another_layer": {
}
},
"cell_types": {
},
"connection_types": {
},
"simulations": {
}
}
Output attributes¶
Format¶
This attribute is a string that refers to the implementation of the OutputFormatter that should be used:
{
"output": {
"format": "bsb.output.HDF5Formatter"
}
}
If you write your own implementation the string should be discoverable by Python.
Here is an example for MyOutputFormatter
in a package called my_package
:
{
"output": {
"format": "my_package.MyOutputFormatter"
}
}
Your own implementations must inherit from output.OutputFormatter
.
File¶
Determines the path and filename of the output file produced by the output formatter. This path is relative to Python’s current working directory.
{
"output": {
"file": "my_file.hdf5"
}
}
Network architecture attributes¶
simulation_volume_x¶
The size of the X dimension of the simulation volume.
simulation_volume_z¶
The size of the Z dimension of the simulation volume.
{
"network_architecture": {
"simulation_volume_x": 150.0,
"simulation_volume_z": 150.0
}
}
Note
The Y can not be set directly as it is a result of stacking/placing the layers. It’s possible to place cells outside of the simulation volume, and even to place layers outside of the volume, but it is not recommended behavior. The X and Z size are merely the base/anchor and a good indicator for the scale of the simulation, but they aren’t absolute restrictions.
Warning
Do not modify these values directly on the configuration object: It will not rescale
your layers. Use resize
instead.
Layer attributes¶
position¶
(Optional) The XYZ coordinates of the bottom-left corner of the layer. Is overwritten if this layer is part of a stack.
"some_layer": {
position: [100.0, 0.0, 100.0]
}
thickness¶
A fixed value of Y units.
Required unless the layer is scaled to other layers.
"some_layer": {
"thickness": 600.0
}
xz_scale¶
(Optional) The scaling of this layer compared to the simulation volume. By
default a layer’s X and Z scaling are [1.0, 1.0]
and so are equal to the
simulation volume.
"some_layer": {
"xz_scale": [0.5, 2.0]
}
xz_center¶
(Optional) Should this layer be aligned to the corner or the center of the
simulation volume? Defaults to False
.
stack¶
(Optional) Layers can be stacked on top of eachother if you define this attribute and give their stack configurations the same stack_id. The position_in_stack will determine in which order they are stacked, with the lower values placed on the bottom, receiving the lower Y coordinates. Exactly one layer per stack should define a position attribute in their stack configuration to pinpoint the bottom-left corner of the start of the stack.
stack_id¶
Unique identifier of the stack. All layers with the same stack id are grouped together.
position_in_stack¶
Unique identifier for the layer in the stack. Layers with larger positions will be placed on top of layers with lower ids.
position¶
This attribute needs to be specified in exactly one layer’s stack dictionary and determines the starting (bottom-corner) position of the stack.
Example¶
This example defines 2 layers in the same stack:
{
"layers": {
"top_layer": {
"thickness": 300,
"stack": {
"stack_id": 0,
"position_in_stack": 1,
"position": [0., 0., 0.]
}
},
"bottom_layer": {
"thickness": 200,
"stack": {
"stack_id": 0,
"position_in_stack": 0
}
}
}
}
volume_scale¶
(Optional) The scaling factor used to scale this layer with respect to other layers. If this attribute is set, the scale_from_layers attribute is also required.
"some_layer": {
"volume_scale": 10.0,
"scale_from_layers": ["other_layer"]
}
scale_from_layers¶
(Optional) A list of layer names whose volume needs to be added up, and this layer’s volume needs to be scaled to.
Example¶
Layer A has a volume of 2000.0
, Layer B has a volume of 3000.0
.
Layer C specifies a volume_scale of 10.0
and scale_from_layers = ["layer_a",
"layer_b"]
; this will cause it to become a cube (unless volume_dimension_ratio is
specified) with a volume of (2000.0 + 3000.0) * 10.0 = 50000.0
volume_dimension_ratio¶
(Optional) Ratio of the rescaled dimensions. All given numbers are normalized to the Y dimension:
"some_layer": {
"volume_scale": 10.0,
"scale_from_layers": ["other_layer"],
# Cube (default):
"volume_dimension_ratio": [1., 1., 1.],
# High pole:
"volume_dimension_ratio": [1., 20., 1.], # Becomes [0.05, 1., 0.05]
# Flat bed:
"volume_dimension_ratio": [20., 1., 20.]
}
Cell Type Attributes¶
entity¶
If a cell type is marked as an entity with "entity": true
, it will not receive a
position in the simulation volume, but it will still be assigned an ID during placement
that can be used for the connectivity step. This is for example useful for afferent
fibers.
If entity is true
no morphology or plotting needs
to be specified.
relay¶
If a cell type is a relay it immediately relays all of its inputs to its target cells. Also known as a parrot neuron.
placement¶
Configuration node of the placement of this cell type. See Placement Attributes.
morphology¶
Configuration node of the morphologies of this cell type. This is still an experimental API, expect changes. See Morphology attributes.
plotting¶
Configuration node of the plotting attributes of this cell type. See Plotting attributes.
Example¶
Placement Attributes¶
Each configuration node needs to specify a placement.PlacementStrategy
through
class. Depending on the strategy another specific set of attributes is
required. To see how to configure each placement.PlacementStrategy
see the
List of placement strategies.
class¶
A string containing a PlacementStrategy class name, including its module.
"class": "bsb.placement.ParticlePlacement"
Connectivity Attributes¶
The connectivity configuration node contains some basic attributes listed below and a set of strategy specific attributes that you can find in List of connection strategies.
class¶
A string containing a ConnectivityStrategy class name, including its module.
"class": "bsb.placement.VoxelIntersection"
from_types/to_types¶
A list of pre/postsynaptic selectors. Each selector is made up of a type to specify the cell type and a compartments list that specify the involved compartments for morphologically detailed connection strategies.
Deprecated since version 4.0: Each connectivity type will only be allowed to have 1 presynaptic and postsynaptic cell type. from/to_types will subsequently be renamed to from/to_type
"from_types": [
{
"type": "example_cell",
"compartments": [
"axon"
]
}
]
Morphology attributes¶
Plotting attributes¶
color¶
The color representation for this cell type in plots. Can be any valid Plotly color string.
"color": "black"
"color": "#000000"
label¶
The legend label for this cell type in plots.
"label": "My Favourite Cells"