Skip to content

Include device .name in API data - #297

Draft
flowln wants to merge 2 commits into
bluesky:mainfrom
flowln:add_name_to_devices
Draft

Include device .name in API data#297
flowln wants to merge 2 commits into
bluesky:mainfrom
flowln:add_name_to_devices

Conversation

@flowln

@flowln flowln commented Feb 26, 2024

Copy link
Copy Markdown
Contributor

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.

Thiago Donato Ferreira added 2 commits February 26, 2024 10:57
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

dmgav commented Feb 28, 2024

Copy link
Copy Markdown
Contributor

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

dmgav commented Feb 28, 2024

Copy link
Copy Markdown
Contributor

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