Bluesky

raw JSON →
1.15.0 verified Fri May 01 auth: no python

Bluesky is a Python library for experiment specification and orchestration, providing a run engine (RunEngine) that coordinates data acquisition plans, detectors, and flyers. It is part of the broader Bluesky ecosystem for synchrotron and laboratory data acquisition. Current version 1.15.0 (requires Python >=3.10). Releases roughly quarterly, with a focus on stability and performance improvements.

pip install bluesky
error TypeError: __init__() got an unexpected keyword argument 'plan'
cause Passing a plan to RE() incorrectly; RE expects a plan as the first argument, but user tried `RE(plan=my_plan)`.
fix
Call RE(my_plan) instead of RE(plan=my_plan).
error AttributeError: module 'bluesky' has no attribute 'RunEngine'
cause Incorrect import or older bluesky version (<0.10) where RunEngine was in a different location.
fix
Ensure bluesky>=0.10 and use from bluesky import RunEngine.
error ValueError: The truth value of an array with more than one element is ambiguous
cause Passing a numpy array where a scalar is expected, e.g., as a motor setpoint in a plan.
fix
Ensure setpoints are scalars (float/int) and not arrays; use float(value) if necessary.
breaking In v1.14.0, `Movable.set` arguments changed: previously positional, now only keyword arguments are accepted.
fix Update any custom device `set` methods to accept `**kwargs` and pass values as keyword arguments.
deprecated `bluesky.plans.inner_product` and other 'inner' plans are deprecated; use the 'outer' plan wrappers.
fix Replace `count([det])` with `count([det])` (outer plan) – they are directly callable.
gotcha The RunEngine is a singleton per process. Creating multiple RE instances can lead to unexpected behavior.
fix Use a single global RE instance; avoid re-instantiation.
gotcha Subscriptions via `RE.subscribe` must be set before the plan is executed; late subscriptions may miss events.
fix Call `RE.subscribe(callback)` before `RE(plan)`.
conda install -c conda-forge bluesky

Instantiates a RunEngine, defines a dummy detector (callable returning a dict), and executes a count plan with a live table callback.

from bluesky import RunEngine
from bluesky.plans import count
from bluesky.callbacks import LiveTable

RE = RunEngine()
def detector():
    return {'det': 1}
RE(count([detector()])