-
Notifications
You must be signed in to change notification settings - Fork 26
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
Naming of signals in ophyd-async is different to ophyd.v1 #666
Comments
@DominicOram @DiamondJoseph @callumforrester will this break anything if we make @whs92 I can be convinced on changing Also, in your example, if |
Why did we use |
|
Sorry, reading failure on my part.
Neither have I, but it makes sense to me. Are there any other major disadvantages we can think of for going back to |
Making it default to ophyd.v1 while also making it configurable seems like a great compromise |
Using a character for separation which is not a part of a valid python identifier was a significant improvement on the naming scheme in Ophyd IMO; I would hate to have to go through all our data handling code and rename everything back (but obviously I would be willing to if it's really important). Is it just the aesthetics of having the different schemes that bothers you @whs92 or are there also functional problems with this? I would be okay with making it configurable too, but that has some potential pitfalls - it should at least be one global config singleton so that we don't have some devices accidentally unconfigured - and seems like a lot of work. |
I agree that having a character that isn't a valid Python variable name actively prevents confusion and is a design choice we should stick by- if I have a device named There must be something that unambiguously cannot be a variable name to allow you to split on it reliably. |
All good points, thanks everyone for your input.
No, when you monitor a signal the resulting stream name takes the name of the signal. Using a I agree with @DiamondJoseph point about the I'd argue that this all might seem minor but trying to reduce differences between ophyd v1 and v2 is helpful to drive adoption. Diamond is maybe the only place where only ophyd async is used. Most places are using and have been using v1 for many years and are now exploring async. We have mixed environments. If we leave things as they are I have to write docs for my users explaining why their data contains keys which look different. Aesthetics matter. |
Yes, sorry, I didn't mean to imply aesthetics don't matter at all, it's definitely still a burden to have to keep the naming convention in mind. But we did run with mixed ophyd and ophyd-async devices for about a year and it wasn't really a problem, and we still have a few ophyd v1 devices kicking around. But then similarly "we know not to form this" about the above mirror heater example is a significant mental burden too - and we have to onboard tens of new people to writing ophyd devices who will not find it easy to understand why they shouldn't name the child of the mirror "heater" - in fact, knowing when to do this and when not is quite subtle, and not systematic like "one uses dashes and the other underscores", and may also lead to some unaesthetic naming choices. |
I would also be happy if we make it possible to specify this in ophyd.v1. My main problem is the inconsistency. I don't really care which one is used, I just want it to be the same, or be possible to configure it to be the same. I agree that the names in ophyd-async are easier to seperate and more likely to be unique in the dataset. |
I suggest we discuss this in the collab meeting on Monday. @whs92 are you around for this? |
Yep. See you there. |
In ophyd v1 the names of signals of components of a device are created by joining names with a
_
so a device like:
would have component names like:
In ophyd-async component names are joined with a
-
character instead and any_
characters are removed from the child name.https://github.com/bluesky/ophyd-async/blob/main/src/ophyd_async/core/_device.py#L113
If I include
ophyd.v1
andophyd-async
devices in a plan together then the signals in event documents fromophyd-async
andophyd.v1
devices look different.Why is this useful?
@coretl
@DiamondJoseph suggests it's possible to iterate through the descriptor document to walk the tree. (I've not tried this)
Why is this a problem?
-
can be interpreted as a -Ve sign in some cases e.g if the signal is monitored in a plan and then you try to access the stream from the run using the databroker client.Proposal
Standardise the signal naming of signals to be the same as in ophyd.v1
The text was updated successfully, but these errors were encountered: