bluesky / ophyd-async

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

Support ai/ao records with prec=0 as Signal[int] #280

Open evalott100 opened 2 months ago

evalott100 commented 2 months ago

In https://github.com/bluesky/ophyd-async/pull/276, we fixed the bug that the panda intialises an analogOut with precision 0 as an int. The signal is made (correctly) with an int, however make_converter fails

https://github.com/bluesky/ophyd-async/blob/58e1cf47b6895093dd029c941f42362565d5a555/src/ophyd_async/epics/_backend/_p4p.py#L219-L220

since float is not a subclass of int.

The fix in in https://github.com/bluesky/ophyd-async/pull/276 allows the signal to be made anyway. We should add the constraint that .PREC == 0.

evalott100 commented 1 month ago

Once the following are merged we can drop the changes introduced in #276

https://github.com/PandABlocks/PandABlocks-ioc/issues/112 https://github.com/dls-controls/pythonSoftIOC/issues/160

We've decided these kind of checks shouldn't be handled in ophyd-async - pandablocks-ioc should be using an int for the record if ophyd-async expects an int datatype.

coretl commented 1 month ago

This has since come up with the CA backend, so I think we need to support this anyway. I suggest we: