Skip to content

Commit

Permalink
updated to collect_while_completing
Browse files Browse the repository at this point in the history
  • Loading branch information
ZohebShaikh committed Aug 22, 2024
1 parent d7f0748 commit 565b629
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 23 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies = [
"numpy<2.0.0",
"packaging",
"pint",
"bluesky>=1.13.0a3",
"bluesky>=1.13.0a4",
"event_model",
"p4p",
"pyyaml",
Expand Down
25 changes: 3 additions & 22 deletions src/ophyd_async/plan_stubs/_fly.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from typing import List, Optional

import bluesky.plan_stubs as bps
from bluesky.utils import short_uid

from ophyd_async.core import (
DetectorTrigger,
Expand Down Expand Up @@ -119,27 +118,9 @@ def fly_and_collect(
for detector in detectors:
yield from bps.kickoff(detector)

# collect_while_completing
group = short_uid(label="complete")

yield from bps.complete(flyer, wait=False, group=group)
for detector in detectors:
yield from bps.complete(detector, wait=False, group=group)

done = False
while not done:
try:
yield from bps.wait(group=group, timeout=0.5)
except TimeoutError:
pass
else:
done = True
yield from bps.collect(
*detectors,
return_payload=False,
name=stream_name,
)
yield from bps.wait(group=group)
yield from bps.collect_while_completing(
flyers=[flyer], dets=detectors, flush_period=0.5, stream_name=stream_name
)


def fly_and_collect_with_static_pcomp(
Expand Down

0 comments on commit 565b629

Please sign in to comment.