bluesky / ophyd-async

Hardware abstraction for bluesky written using asyncio
https://blueskyproject.io/ophyd-async
BSD 3-Clause "New" or "Revised" License
12 stars 26 forks source link

make motor locatable #541

Closed stan-dot closed 3 months ago

stan-dot commented 3 months ago

Looks good, would you please add a test and fix the inheritance order?

ah yes I forgot it's not a set but an ordered list. how should the inheritance order look like?

stan-dot commented 3 months ago

also I realized if sim motor actions are instant I might not get the assert on the difference between the readback and set point. there should be a way to do this, investigating...

dperl-dls commented 3 months ago

Not sure, but some way that https://docs.python.org/3/howto/mro.html can get a consistent order out of HasName, Movable, Stoppable, Flyable, Preparable, Locatable.

I think the issue is likely that several of these inherit each other already, so I would try:

StandardReadable, Flyable, Locatable, Preparable, Stoppable since this covers all the methods.

You can stop the sim motor from moving with

with ophyd_async.core.mock_puts_blocked(motor.signal):
    < do the set, assert, etc. >
stan-dot commented 3 months ago

thanks, trying this now