Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include device .name in API data #297

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

flowln
Copy link

@flowln flowln commented Feb 26, 2024

This field can be used to show a better user-facing name in a GUI.

To be honest, maybe the field should be named something else, like display_name or device_name, but since neither Bluesky nor Ophyd constrains what name can be, I used the generic name. Tell me if you think it should be something else!

Motivation and Context

This allows us to have a potentially ugly Python variable name, while having a nicer name attribute on the device, that users can interact with in a GUI application.

Summary of Changes for Release Notes

Added

A name field to the device list in the API, corresponding to the device's .name attribute, when it exists.

This field can be used to show a better user-facing name in a GUI.

Signed-off-by: Thiago Donato Ferreira <thiago.ferreira@lnls.br>
Signed-off-by: Thiago Donato Ferreira <thiago.ferreira@lnls.br>
@dmgav
Copy link
Contributor

dmgav commented Feb 28, 2024

Thank you for contributing to the project. We consider adding user-friendly name to the device description as a useful feature. But the primary purpose of the name attribute of the Ophyd object is different, and using it for arbitrary user-friendly name is not the best practice. There is an issue in Ophyd project, proposing a new attribute display_name for OphydObject class: bluesky/ophyd#1161 Once implemented in Ophyd, the display_name could be included in the device description.

@dmgav dmgav marked this pull request as draft February 28, 2024 00:13
@dmgav
Copy link
Contributor

dmgav commented Feb 28, 2024

I am converting the PR to draft for now.

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