-
Notifications
You must be signed in to change notification settings - Fork 8
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
use devicevector #799
use devicevector #799
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #799 +/- ##
==========================================
- Coverage 94.99% 94.97% -0.03%
==========================================
Files 115 115
Lines 4719 4698 -21
==========================================
- Hits 4483 4462 -21
Misses 236 236 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a worse interface for the users. The grouping of devices in the beamline
file should be logical to a scientist as that is their interface with the devices. They do not think of the slits on the beamline as one large device with multiple slits but rather as individual devices. So they would want to define a plan like def slit_scan(slit: Slits = inject("slits_1"))
. This also brings the issue of how we deal with disconnected slits. It is very possible that the beamline may have one slit set offline but still want to use the others. With SixSlits
the whole device will fail to connect and throw errors.
@DominicOram at the moment I only see the
that is a valid point, might need a decorator 'allow fail'? I am not sure if the slits are used independently like what you're describing now at i22 |
If we go this way I don't think it should be called six_slits: we'd still be able to address individual slits with e.g. |
at the latest version it's a |
@DominicOram what is a plan that you'd like to define in ipython and then run it that the inject behavior would be used? |
Something like: def slit_scan(slit: Slits = inject("slits_1"), i0: TetrammDetector = inject("i0"):
yield from bps.scan([i0], slit.x, 0, 100) |
ok how do I get the beamline module to be referred to with I don't see this in search also does not provide information on the use of dodal in ipython https://diamondlightsource.github.io/dodal/main/search.html?q=ipython |
It's a blueapi-ism, assuming that there is a device with that name in the blueapi context that will fetchable when the pydantic model is deserialised: regardless of what beamline module is loaded. It's not particularly well developed or documented, I'm hoping there's something in Pydantic 2 that we'll be able to leverage for the same effect but I will have to look after I get back. |
@DominicOram on re-reading your initial comment I see that the granularity of |
Fixes #795
Instructions to reviewer on how to test:
dodal connect i22
dodal connect p38
Checks for reviewer
dodal connect ${BEAMLINE}