-
Notifications
You must be signed in to change notification settings - Fork 28
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
Move timeout handling to functions wrapped with AsyncStatus #318
Conversation
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.
@coretl This seems very nice for motors but how does it affect your common garden signal?
The only question I have is whether we should allow this timeout to be overridden.
I can see the use case of "I want this motor to reach position a
in n
seconds otherwise my beamline is broken and I want to know about it" being a thing
Not at all, they will still take
So "I want this to move within 2 seconds no matter where it was to begin with"? That's fairly easy to add as an override |
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 think this is an elegant solution. The only real concern I would have had is about being able to override the timeout, that should definitely be possible. Is it still possible to wait forever on this?
I've made the handling of |
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.
lgtm
I think the best place to apply timeouts for motion is in the
*Motor.set
function, rather than the caller to this function.This PR shows what this looks like:
timeout
handling from*AsyncStatus
velocity
in*Motor.set
and addingDEFAULT_TIMEOUT
observe_value
forMover.set
I think this makes things easier to use as you are not forced to
bps.mv(motor, value, timeout=<something I have to calculate>)
, it fills in a sensible value for timeout itself. The only question I have is whether we should allow this timeout to be overridden.@dperl-dls @callumforrester thoughts?