BCDA-APS / apstools

various tools for use with Bluesky at the APS
https://bcda-aps.github.io/apstools/latest/
Other
16 stars 9 forks source link

Refactor run_blocking_function #952

Open prjemian opened 3 months ago

prjemian commented 3 months ago

Refactor the apstools.plans.run_blocking_function() plan to create a subclass or ophyd.Signal with an added trigger() method. In an inner function of that method, it runs the blocking function and then sets the status object to done. The plan calls the inner method with yield from bps.trigger(subclass_object).

prjemian commented 3 months ago

https://github.com/BCDA-APS/apstools/blob/a165d24b2ae272ba0db3fb73d9feba4416f40631/apstools/plans/run_blocking_function_plan.py#L11