Skip to content

Comments

Add ophyd_labels to device_info and summary#765

Open
cappel89 wants to merge 3 commits intomainfrom
refactor/add-labels-to-summary
Open

Add ophyd_labels to device_info and summary#765
cappel89 wants to merge 3 commits intomainfrom
refactor/add-labels-to-summary

Conversation

@cappel89
Copy link
Contributor

@cappel89 cappel89 commented Feb 11, 2026

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.

Screenshot 2026-02-11 at 21 08 38

Copilot AI review requested due to automatic review settings February 11, 2026 20:08
@cappel89 cappel89 self-assigned this Feb 11, 2026
@cappel89 cappel89 requested a review from wakonig February 11, 2026 20:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 by get_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.

@cappel89 cappel89 requested a review from d-perl February 12, 2026 09:14
@cappel89 cappel89 force-pushed the refactor/add-labels-to-summary branch from e0f6661 to 2c35baa Compare February 12, 2026 09:18
@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@cappel89 cappel89 force-pushed the refactor/add-labels-to-summary branch from 2c35baa to 71fdd9e Compare February 12, 2026 12:30
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(("",))))),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why sorted? And why BEC signal labels not sorted?

Copy link
Contributor Author

@cappel89 cappel89 Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, casted to sorted list of strings already in the device_serializer.

@cappel89 cappel89 force-pushed the refactor/add-labels-to-summary branch from a6cf7fd to a6a997a Compare February 17, 2026 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants