Callbacks#

OptimizationLogger#

class bluesky_adaptive.callbacks.logger.OptimizationLogger(console=None, **kwargs)[source]#

Bases: CallbackBase

A Bluesky callback for displaying optimization progress to the console.

This callback provides structured, styled console output during optimization runs using the rich library. It listens for documents from the optimize plan and displays:

  • A header panel with optimizer configuration at run start

  • A formatted table of parameter and outcome values for each step event

    • a box coloring indicating sectioning by iteration

  • A compact inline summary of outcome statistics after every 5 steps

  • A full summary statistics table at run completion

Notes

Multiple consecutive optimization runs will accumulate iteration counts and statistics.

start(doc)[source]#

Process the start document from the Bluesky run.

Logs the optimization setup observed from metadata.

descriptor(doc)[source]#

Cache the parameter and outcome fields named by the descriptor’s object_keys.

event(doc)[source]#

Process an event document from a Bluesky run.

Logs what occurred in this event along with running stats.

stop(doc)[source]#

Handle the stop document of a Bluesky run.

Prints summary statistics of what has been observed so far.