bluesky / bluesky-queueserver

Server for queueing plans
https://blueskyproject.io/bluesky-queueserver/
BSD 3-Clause "New" or "Revised" License
11 stars 20 forks source link

Include device `.name` in API data #297

Open flowln opened 4 months ago

flowln commented 4 months ago

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.

dmgav commented 4 months ago

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: https://github.com/bluesky/ophyd/issues/1161 Once implemented in Ophyd, the display_name could be included in the device description.

dmgav commented 4 months ago

I am converting the PR to draft for now.