Plan Stubs#

blop.plan_stubs.navigate_to_best(actuators, optimizer=None, parameterization=None)[source]#

Move actuators to the best point found during optimization.

If no explicit parameterization is provided, queries the optimizer for its best point(s). For multi-objective optimizers that return multiple Pareto-optimal points, an explicit parameterization must be provided.

Parameters:
actuatorsSequence[Actuator]

The actuators to move to the best parameterization.

optimizerOptimizer | None, optional

The optimizer to query for the best point.

parameterizationMapping | None, optional

Explicit parameterization to navigate to. If None, queries the optimizer’s best point. For multi-objective problems, call optimizer.get_best_points() to inspect the Pareto set and select one.

Raises:
TypeError

If both parameterization and optimizer arguments are None.

ValueError

If the optimizer returns multiple Pareto-optimal points and no explicit parameterization is provided.

blop.plan_stubs.read_step(uid, suggestions, outcomes, n_points, readable_cache)[source]#

Plan stub to read the suggestions and outcomes of a single optimization step.

If fewer suggestions are returned than n_points arrays are padded to n_points length with np.nan to ensure consistent shapes for event-model specification.

Parameters:
uidstr

The Bluesky run UID from the acquisition plan.

suggestionslist[dict]

List of suggestion dictionaries, each containing an ID_KEY.

outcomeslist[dict]

List of outcome dictionaries, each containing an ID_KEY matching suggestions.

n_pointsint

Expected number of suggestions. Arrays will be padded to this length if needed.

readable_cachedict[str, InferredReadable]

Cache of InferredReadable objects to reuse across iterations.