DiamondLightSource / DiamondLightSource/dodal
Create preprocessor helper function to insert a plan before 'open_run' and after 'close_run' messages
- Dominant language
- Python
- Stars
- 5
- Forks
- 13
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 10
Description
As of https://github.com/DiamondLightSource/dodal/pull/1099 and https://github.com/DiamondLightSource/mx-bluesky/pull/872, we have made bluesky preprocessors which insert plans before an 'open_run', and after a 'close_run' message is seen in the `RunEngine`. Both of these preprocessors follow a similar pattern, and in the future more of these are likely to be created. We should create a helper function which looks something like
`def do_on_run(on_run_open, on_run_close = None, run_key=None)` to save duplicating the logic for this part. We should also discuss with Bluesky developers as to whether this would be a useful thing to put in Bluesky instead
## Acceptance Criteria
- Discussion with Bluesky to see if this is a feature they want
- A function which looks like `def do_on_run(on_run_open, on_run_close = None, run_key=None)` is added to Bluesky or dodal, depending on the above
- The undulator preprocessor (in dodal) and the xbpm preprocessor (in mx-bluesky) are updated to use this helper function
Contributor guide
Assessment
This issue has not been assessed yet.