set_device function

(Shortest import: from brian2 import set_device)

brian2.devices.device.set_device(device, build_on_run=True, **kwargs)[source]

Set the device used for simulations.


device : Device or str

The Device object or the name of the device.

build_on_run : bool, optional

Whether a call to run() (or should directly trigger a This is only relevant for standalone devices and means that a run call directly triggers the start of a simulation. If the simulation consists of multiple run calls, set build_on_run to False and call explicitly. Defaults to True.

kwargs : dict, optional

Only relevant when build_on_run is True: additional arguments that will be given to the call.