-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update to bps.collect_while_completeing #536
base: main
Are you sure you want to change the base?
update to bps.collect_while_completeing #536
Conversation
565b629
to
cbe0434
Compare
@@ -16,7 +16,7 @@ dependencies = [ | |||
"numpy<2.0.0", | |||
"packaging", | |||
"pint", | |||
"bluesky>=1.13.0a3", | |||
"bluesky>=1.13.0a4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have change this to make sure that we are at version the hardware test was conducted
9703a49
to
5ddf953
Compare
5ddf953
to
923490c
Compare
src/ophyd_async/plan_stubs/_fly.py
Outdated
@@ -129,17 +127,12 @@ def fly_and_collect( | |||
done = False | |||
while not done: | |||
try: | |||
yield from bps.wait(group=group, timeout=0.5) | |||
yield from bps.wait(group=group, timeout=0.5, move_on=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a new global constant for readability:
# Collect every 0.5 seconds even if the flyscan is still completing
_SECONDS_TO_FORCE_COLLECT_AFTER = 0.5
yield from bps.wait(group=group, timeout=0.5, move_on=True) | |
yield from bps.wait( | |
group=group, | |
timeout=_SECONDS_TO_FORCE_COLLECT_AFTER, | |
move_on=True | |
) |
src/ophyd_async/plan_stubs/_fly.py
Outdated
@@ -129,17 +127,12 @@ def fly_and_collect( | |||
done = False | |||
while not done: | |||
try: | |||
yield from bps.wait(group=group, timeout=0.5) | |||
yield from bps.wait(group=group, timeout=0.5, move_on=True) | |||
except TimeoutError: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually don't think we need to do this now. It seems timeout is only raised if move_on=False
I think we can change this whole thing to:
done = False
while not done:
done = (
yield from bps.wait(
group=group,
timeout=_SECONDS_TO_FORCE_COLLECT_AFTER,
move_on=True
)
)
yield from bps.collect(*detectors, name=stream_name)
Since done is returned here:
https://github.com/bluesky/bluesky/blob/978995b69c00cc0b9bef5103bdb31b665a6fbed9/src/bluesky/run_engine.py#L2379
923490c
to
db41573
Compare
db41573
to
be29b8e
Compare
return_payload=False, | ||
name=stream_name, | ||
done = yield from bps.wait( | ||
group=group, timeout=_SECONDS_TO_FORCE_COLLECT_AFTER, move_on=True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add flush_period: float = 0.5
to the function parameters, then use that rather than a global
group=group, timeout=_SECONDS_TO_FORCE_COLLECT_AFTER, move_on=True | |
group=group, timeout=flush_period, move_on=True |
No description provided.