bluesky.preprocessors.finalize_decorator

bluesky.preprocessors.finalize_decorator(final_plan)[source]

try…finally helper

Run the first plan and then the second. If any of the messages raise an error in the RunEngine (or otherwise), the second plan will attempted to be run anyway.

Notice that, this decorator requires a generator function so that it can be used multiple times, whereas bluesky.plans.finalize_wrapper() accepts either a generator function or a generator instance.

Parameters
final_plancallable

a callable that returns a generator, list, or similar containing Msg objects; attempted to be run no matter what happens in the first plan

Yields
msgMsg

messages from plan until it terminates or an error is raised, then messages from final_plan