bluesky / ophyd

hardware abstraction in Python with an emphasis on EPICS
https://blueskyproject.io/ophyd
BSD 3-Clause "New" or "Revised" License
49 stars 78 forks source link

v2: Make the split between Signal and SignalBackend support tables #1120

Open coretl opened 1 year ago

coretl commented 1 year ago

At the moment, we have this interface for Signal.read and Signal.describe: https://github.com/bluesky/ophyd/blob/7612b2c9de9d5bc16cf28eea79ba5c12553f3cc2/ophyd/v2/core.py#L661-L669

This only allows a backend to produce a single data key in the Descriptor and Event. We decided (with @danielballan) to explode tables to be multiple fields, as this would make them look like arrays. This means that instead of a single panda-seq1-table entry in the descriptor with dtype=object, we would want an entry for every column (like panda-seq1-table-repeats, panda-seq1-table-time1, etc.) with dtype=array.

To do this, SignalBackend.get_descriptor and Signal.get_reading will need to change from: https://github.com/bluesky/ophyd/blob/7612b2c9de9d5bc16cf28eea79ba5c12553f3cc2/ophyd/v2/core.py#L377-L383

To something like:

 @abstractmethod 
 async def get_descriptor(self, name: str) -> Dict[str, Descriptor]: 
     """Metadata like source, dtype, shape, precision, units""" 

 @abstractmethod 
 async def get_reading(self, name: str) -> Dict[str, Reading]: 
     """The current value, timestamp and severity""" 

And all the backends (and the SignalCache) change to produce these dictionaries instead of single values