bluesky.preprocessors.finalize_wrapper#

bluesky.preprocessors.finalize_wrapper(plan, final_plan, *, pause_for_debug=False)[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.

See contingency_wrapper() for a more complex and more feature-complete error-handling preprocessor.

Parameters:
planiterable or iterator

a generator, list, or similar containing Msg objects

final_plancallable, iterable or iterator

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

pause_for_debugbool, optional

If the plan should pause before running the clean final_plan in the case of an Exception. This is intended as a debugging tool only.

Yields:
msgMsg

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