Conversation
There was a problem hiding this comment.
Pull request overview
Extends the device-info payload produced by the device server to include Ophyd component labels, and updates the client-side Device.summary() output to display those labels for a clearer overview of complex devices (e.g., aggregated status/temperature PVs).
Changes:
- Include
_ophyd_labels_in per-signal entries returned byget_device_info(). - Add a new “Labels” column to
Device.summary()and populate it from serialized signal info.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
bec_server/bec_server/device_server/devices/device_serializer.py |
Adds serialized labels field to each signal’s exported metadata. |
bec_lib/bec_lib/device.py |
Displays labels in Device.summary() via a new table column. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e0f6661 to
2c35baa
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
2c35baa to
71fdd9e
Compare
bec_lib/bec_lib/device.py
Outdated
| signal_info.get("kind_str"), | ||
| signal_info.get("describe", {}).get("source"), | ||
| signal_info.get("describe", {}).get("dtype"), | ||
| ", ".join(label for label in sorted(signal_info.get("labels", set(("",))))), |
There was a problem hiding this comment.
Why sorted? And why BEC signal labels not sorted?
There was a problem hiding this comment.
Done, casted to sorted list of strings already in the device_serializer.
a6cf7fd to
a6a997a
Compare
cSAXS has a rather complex device 'EPS', which is about to be merged to csaxs_bec (https://gitea.psi.ch/bec/csaxs_bec/pulls/134). Here PVs indicating status values, temperatures, etc. are merged together. This information is currently spread across the various signals of the device, and encoded in either 'docs' or 'labels. To get a nice overview of the relevant information, I would like to extend the device serializer and summary method to also show _ophyd_labels passed as
labels:set[str]to the ophyd components.I was also considering adding the 'doc' field of sub-devices, but then dropped the idea again as this would require to unfold all nested sub-devices which could make the table printout rather confusing.