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

Add initial orchestrators idea #1168

Closed marcomontevechi1 closed 11 months ago

marcomontevechi1 commented 11 months ago

Im not sure if the general ideia fits in ophyd scope, but this is an initial attempt. The idea is to have abstractions to perform tasks that are possibly frequent to the plugins and drivers, but not basic enough to be put in the initial plugin/driver abstractions. For example, a common method to configure a grid of peaks in SimDetector or one to define how to average images in processPlugin.

I wanted to set a default behavior in the method but in a way that default parameter values could be overriden by an user who knows what they are doing.

Unfortunately, the only way i could come up to do this was by manually coding the properties as possible keys to kwargs (eg. line 22 in ProcessPluginOrchestrator). I tried dynamically checking if any argument in kwargs was equal to one of the component_names but for that i needed to use something like getattr(self.cam, component_name).put() and for some reason that didnt work.

I appreciate any feedback.