bluesky / bluesky

experiment orchestration and data acquisition
https://blueskyproject.io/bluesky/
BSD 3-Clause "New" or "Revised" License
146 stars 90 forks source link

How to Configure Bluesky Plans to Emit Only Event Documents Without Start and Stop Documents? #1764

Open Cassiel-girl opened 1 month ago

Cassiel-girl commented 1 month ago

In Bluesky, existing plans like count, list_scan, etc., are runs that emit start, stop documents when executed. How can I configure them so they are not considered runs, do not emit start and stop documents, but still emit event documents?

prjemian commented 1 month ago

What's your use case?

ZLLentz commented 1 month ago

Here's a built-in preprocessor that modifies a plan to remove start, stop, stage, and unstage messages, that you can either use or draw inspiration from: https://github.com/bluesky/bluesky/blob/5bd9a4150d3a8594ae0f3232547b3111dae28a03/src/bluesky/preprocessors.py#L758

In the past I had used this to combine multiple plans into one run, putting my own run_wrapper and stage_wrapper around a full group of several plans in a row, each sub-plan wrapped in the stub_wrapper, so that the resulting single run contained data from all of the sub-plans.