-
Notifications
You must be signed in to change notification settings - Fork 79
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
Idea: Add a human-readable "display name" to Ophyd Objects to supplement name #1161
Comments
I think this would be useful in many cases It's worth considering if there are any places internally where ophyd can and should leverage this information as well- does it belong in tracebacks and log messages, for example? |
I'd say it could be useful in tracebacks/logs, but you'd have to be careful. The display name isn't necessarily going to tell you as much about the object structure as the actual name. So if you replaced Now granted, I'd keep it simple for now and just add |
"both" is probably the right answer for tracebacks and logs. |
I have also often wanted this feature, and I agree, I would like to see both in logs and tracebacks |
Could we spell it |
I wonder if |
Are component display names expected to be generated automatically based on display names of parents? Or |
I'll add my 2 cents: we recently used the Docs: https://epics.anl.gov/EpicsDocumentation/AppDevManuals/RecordRef/Recordref-6.html. I don't think it's tied to the Motor Record only, seems to be a more general feature. @shroffk, could you please confirm? |
In the apstools package, we define |
In EPICS, |
As mentioned With
|
I'd like to comment that Ophyd objects are much closer to any notion of "intent", "purpose", or "description" when compared to the DESC field of an EPICS record. My intention is that the descriptions would be set on Bluesky startup, and that they would really describe an object, including its purpose, not just a generic string from EPICS. As an example (which is very relevant to my beamline), if there are two endstations on a beamline, with a shutter in-between, one endstation may want to describe the shutter as "Downstream Photon Shutter", whereas the second endstation would call it "Upstream Photon Shutter". But perhaps (if they were organized scientists!) the ophyd name (i.e, not the description) would be something like "shutter4", based on some global beamline optical numbering scheme, which is important, but not terribly descriptive to a user, or as a label in a program. Our Ophyd object names are typically unique, but the descriptions may not necessarily be. It should be up to the scientist writing the beamline code how to describe the objects in the most useful way for their circumstance. |
How about
I agree that the EPICS
|
I think |
Wouldn't I like |
FWIW, NeXus has a |
And, yes, NeXus also had long discussions about how to name things. |
I believe |
I actually like I also think it would be good if we inched towards making it easier to export NeXus classes from Tiled data. In contrast, I think |
Background
Most of the time, the "name" attribute of my Ophyd objects is either auto-generated, i.e, "parentname_signalname", or at the top-level, something short and simple so that it's easy to remember and access in the run data later.
E.g,
data['ref']
is easy to remember,data['SST Beamline Intensity Monitor']
is notHowever, there are plenty of times when I would rather display "SST Beamline Intensity Monitor" to a user who isn't likely to care about the under-the-hood data key. This is becoming especially relevant when trying to make a GUI.
Suggestion
I think it would be very simple to add a
display_name
attribute toOphydObject
. The implementation would probably be a property with a setter, that defaults to returningname
if nodisplay_name
has been set.I believe this would be very easy to implement, and completely non-disruptive. I would be happy to implement and submit a PR. Thoughts?
The text was updated successfully, but these errors were encountered: