Closed coretl closed 1 year ago
https://github.com/bluesky/bluesky/pull/1596 is one path that may help.
In the first case eventually it should be the shutter and motor's job to report when they are done so in the plan you should do:
yield from bps.mv(detector.shutter, "open", detector.z_motor, target)
Part of the assumption of blueky is that when it is running it controls the beamline so having a hybrid GDA/bluesky system is likely to have some rough edges.
Possibly the ophyd.v2.core.wait_for_value
async method could be converted to return a Status, then we could pass this to bps.wait_for
I do not see where bps.sleep()
was removed in https://github.com/bluesky/bluesky/pull/1598.
the bps.sleep
is in the test plan in this repo, rather than in bluesky. It enables the following:
https://github.com/bluesky/ophyd-epics-devices/blob/c5efe8b5ee9adca2ba6dc0be9bb2844070c4cceb/tests/test_area_detector.py#L166-L174
To be written as per https://github.com/bluesky/bluesky/issues/1597:
for det in dets:
yield from bps.complete(det, wait=False, group="complete")
done = False
while not done:
try:
yield from bps.wait(group="complete", timeout=FLUSH_PERIOD)
except TimeoutError:
pass
else:
done = True
for det in dets:
yield from bps.collect(det, stream=True, return_payload=False)
Thanks for describing that!
In MX we have similar issues around waiting plan side, which is very messy (https://github.com/DiamondLightSource/python-artemis/issues/426). Some examples:
The detector Z and shutter has been moved by GDA, we want to make sure it's finished:
We want to set a bunch of PVs and wait on a separate PV to tell us the device is configured. We currently do:
I think there is probably a cleaner way to do this in the device for 2) and you could argue that 1) is only a problem due to GDA/Bluesky migration and will go away on it's own