bsb.simulation package

Submodules

bsb.simulation.simulation module

class bsb.simulation.simulation.ProgressEvent(progression, duration, time)[source]

Bases: object

class bsb.simulation.simulation.Simulation(*args, _parent=None, _key=None, **kwargs)[source]

Bases: object

cell_models: cfgdict[CellModel]
connection_models: cfgdict[ConnectionModel]
devices: cfgdict[DeviceModel]
duration: float

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

get_connectivity_sets() Mapping[ConnectionModel, ConnectivitySet][source]
Return type:

Mapping[ConnectionModel, ConnectivitySet]

get_model_of(type: CellType | ConnectionStrategy) CellModel | ConnectionModel | None[source]
Parameters:

type (CellType | ConnectionStrategy)

Return type:

CellModel | ConnectionModel | None

get_node_name()
name: str

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

post_prepare: cfglist[Callable[[Simulation, Any], None]]
scaffold: Scaffold
simulator: str

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

bsb.simulation.adapter module

class bsb.simulation.adapter.AdapterProgress(duration)[source]

Bases: object

complete()[source]
steps(step=1)[source]
tick(step)[source]

Report simulation progress.

class bsb.simulation.adapter.SimulationData(simulation: Simulation, result=None)[source]

Bases: object

Parameters:

simulation (Simulation)

class bsb.simulation.adapter.SimulatorAdapter[source]

Bases: ABC

add_progress_listener(listener)[source]
collect(simulation, simdata, simresult, comm=None)[source]

Collect the output of a simulation that completed

abstract prepare(simulation, comm=None)[source]

Reset the simulation backend and prepare for the given simulation.

Parameters:
  • simulation (Simulation) – The simulation configuration to prepare.

  • comm – The mpi4py MPI communicator to use. Only nodes in the communicator will participate in the simulation. The first node will idle as the main node.

abstract run(*simulations, comm=None)[source]

Fire up the prepared adapter.

simulate(*simulations, post_prepare=None, comm=None)[source]

Simulate the given simulations.

bsb.simulation.cell module

class bsb.simulation.cell.CellModel(*args, _parent=None, _key=None, **kwargs)[source]

Bases: SimulationComponent

Cell models are simulator specific representations of a cell type.

cell_type: CellType

The cell type that this model represents

get_node_name()
get_placement_set(chunks=None)[source]
parameters: cfglist[Parameter]

The parameters of the model.

bsb.simulation.component module

class bsb.simulation.component.SimulationComponent(*args, _parent=None, _key=None, **kwargs)[source]

Bases: ABC

get_node_name()
name: str

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

property simulation

bsb.simulation.connection module

class bsb.simulation.connection.ConnectionModel(*args, _parent=None, _key=None, **kwargs)[source]

Bases: SimulationComponent

get_connectivity_set()[source]
get_node_name()
tag: str

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

bsb.simulation.device module

class bsb.simulation.device.DeviceModel(*args, _parent=None, _key=None, **kwargs)[source]

Bases: SimulationComponent

get_node_name()
implement(adapter, simulation, simdata)[source]

bsb.simulation.parameter module

class bsb.simulation.parameter.Parameter(*args, _parent=None, _key=None, **kwargs)[source]

Bases: object

get_node_name()
type

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

value: ParameterValue

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

class bsb.simulation.parameter.ParameterValue(*args, _parent=None, _key=None, **kwargs)[source]

Bases: object

get_node_name()
type

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

bsb.simulation.results module

class bsb.simulation.results.SimulationRecorder[source]

Bases: object

flush(segment: neo.core.Segment)[source]
Parameters:

segment (neo.core.Segment)

class bsb.simulation.results.SimulationResult(simulation)[source]

Bases: object

add(recorder)[source]
property analogsignals
create_recorder(flush: Callable[[neo.core.Segment], None])[source]
Parameters:

flush (Callable[[neo.core.Segment], None])

flush()[source]
property spiketrains
write(filename, mode)[source]

bsb.simulation.targetting module

class bsb.simulation.targetting.BranchLocTargetting(*args, _parent=None, _key=None, **kwargs)[source]

Bases: LabelTargetting

get_locations(cell)[source]
get_node_name()
x

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

class bsb.simulation.targetting.ByIdTargetting(*args, _parent=None, _key=None, **kwargs)[source]

Bases: FractionFilter, CellTargetting

Targets all given identifiers.

get_node_name()
get_targets(adapter, simulation, simdata)[source]
ids: dict[str, list[int]]

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

class bsb.simulation.targetting.ByLabelTargetting(*args, _parent=None, _key=None, **kwargs)[source]

Bases: CellModelFilter, FractionFilter, CellTargetting

Targets all given labels.

get_node_name()
get_targets(adapter, simulation, simdata)[source]
labels: list[str]

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

class bsb.simulation.targetting.CellModelFilter[source]

Bases: object

cell_models: list[CellModel]
get_targets(adapter, simulation, simdata)[source]
class bsb.simulation.targetting.CellModelTargetting(*args, _parent=None, _key=None, **kwargs)[source]

Bases: CellModelFilter, FractionFilter, CellTargetting

Targets all cells of certain cell models.

cell_models: list[CellModel]
get_node_name()
get_targets(adapter, simulation, simdata)[source]
class bsb.simulation.targetting.CellTargetting(*args, _parent=None, _key=None, **kwargs)[source]

Bases: Targetting

get_node_name()
get_targets(adapter, simulation, simdata)[source]
type: Literal['cell', 'connection']
class bsb.simulation.targetting.ConnectionTargetting(*args, _parent=None, _key=None, **kwargs)[source]

Bases: Targetting

get_node_name()
get_targets(adapter, simulation, simdata)[source]
type: Literal['cell', 'connection']
class bsb.simulation.targetting.CylindricalTargetting(*args, _parent=None, _key=None, **kwargs)[source]

Bases: CellModelFilter, FractionFilter, CellTargetting

Targets all cells in a cylinder along specified axis.

axis: Literal['x', 'y', 'z']

Main axis of the cylinder

get_node_name()
get_targets(adapter, simulation, simdata)[source]

Target all or certain cells within a cylinder of specified radius.

origin: ndarray[float]

Coordinates of the base of the cylinder for each non main axis

radius: float

Radius of the cylinder

class bsb.simulation.targetting.FractionFilter[source]

Bases: object

count

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

static filter(f)[source]
fraction

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

satisfy_fractions(targets)[source]
class bsb.simulation.targetting.LabelTargetting(*args, _parent=None, _key=None, **kwargs)[source]

Bases: LocationTargetting

get_locations(cell)[source]
get_node_name()
labels
class bsb.simulation.targetting.LocationTargetting(*args, _parent=None, _key=None, **kwargs)[source]

Bases: object

get_locations(cell)[source]
get_node_name()
strategy

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

class bsb.simulation.targetting.RepresentativesTargetting(*args, _parent=None, _key=None, **kwargs)[source]

Bases: CellModelFilter, FractionFilter, CellTargetting

Targets all identifiers of certain cell types.

get_node_name()
get_targets(adapter, simulation, simdata)[source]
n: int

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

class bsb.simulation.targetting.SomaTargetting(*args, _parent=None, _key=None, **kwargs)[source]

Bases: LocationTargetting

get_locations(cell)[source]
get_node_name()
class bsb.simulation.targetting.SphericalTargetting(*args, _parent=None, _key=None, **kwargs)[source]

Bases: CellModelFilter, FractionFilter, CellTargetting

Targets all cells in a sphere.

get_node_name()
get_targets(adapter, simulation, simdata)[source]

Target all or certain cells within a sphere of specified radius.

origin: list[float]

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

radius: float

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

class bsb.simulation.targetting.Targetting(*args, _parent=None, _key=None, **kwargs)[source]

Bases: object

get_node_name()
get_targets(adapter, simulation, simdata)[source]
strategy

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

type: Literal['cell', 'connection']

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

Module contents

class bsb.simulation.SimulationBackendPlugin(Adapter: bsb.simulation.adapter.SimulatorAdapter, Simulation: bsb.simulation.simulation.Simulation)[source]

Bases: object

Parameters:
Adapter: SimulatorAdapter
Simulation: Simulation
bsb.simulation.get_simulation_adapter(name: str)[source]
Parameters:

name (str)