bluesky.plans.lazily_stage_wrapper

bluesky.plans.lazily_stage_wrapper(plan)

This is a preprocessor that inserts ‘stage’ messages and appends ‘unstage’.

The first time an object is seen in plan, it is staged. To avoid redundant staging we actually stage the object’s ultimate parent, pointed to be its root property.

At the end, in a finally block, an ‘unstage’ Message issued for every ‘stage’ Message.

Parameters:plan (iterable or iterator) – a generator, list, or similar containing Msg objects
Yields:msg (Msg) – messages from plan with ‘stage’ messages inserted and ‘unstage’ messages appended

See also

bluesky.plans.stage_context