-
Notifications
You must be signed in to change notification settings - Fork 12
Wrap plans and plan stubs with dictionaries #1734
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1734 +/- ##
==========================================
+ Coverage 99.12% 99.13% +0.01%
==========================================
Files 282 283 +1
Lines 10698 10908 +210
==========================================
+ Hits 10604 10814 +210
Misses 94 94 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
1cc044e to
daeb4ec
Compare
|
whatt else does this need until it can not be a draft and be merged? |
|
@RJCD-Diamond, it should be good to go, but could likely use some input on plan names and and other changes. |
|
Why did you go with |
|
DominicOram
left a comment
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.
until spec_scan is stable and supports start stop step rather than start stop num
Does this mean you intend for these to be removed when bluesky/scanspec#186 is done? If so I would put a comment in each plan you intend to retire saying that it will be replaced and pointing to that issue.
Concurrent trajectory scans (scan, etc.) and independent trajectory scans (grid_scan, etc.) are both accessed through the same plan and differentiated by number of parameters given for each movable - similar to current GDA-style scans.
Is this a hard requirement? I think I would rather we have them separate as:
- We can then just point people to https://blueskyproject.io/bluesky/main/plans.html as documentation
- They seem to actually be quite different things and lead to weirdness e.g.
snake_axesmeaning nothing in some contexts
On that note, having different behaviour based on whether we provide a num for each axis or not is also not intuitive. Again, I would just stick to the bluesky way of being more explicit about what you actually want to do
tests/plans/test_wrapped.py
Outdated
| x_axis: Motor, | ||
| x_args: list[float | int], | ||
| ): | ||
| run_engine(num_scan(detectors=[det], params={x_axis: x_args})) |
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.
Should: It would be good to assert something here e.g. that the motor is moved the expected number of times or that the detector is read the expected number of times. Otherwise this is just a smoke test. Similarly with other tests in this file.
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've added assertions that the documents contain the correct number of events, resources, etc. to the relevant tests
src/dodal/plans/wrapped.py
Outdated
| params: Annotated[ | ||
| dict[Movable | Motor, list[float | int]], | ||
| Field( | ||
| description="Dictionary of 'device: paramater' keys. For concurrent " |
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.
Nit:
| description="Dictionary of 'device: paramater' keys. For concurrent " | |
| description="Dictionary of 'device: parameter' keys. For concurrent " |
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.
(Also in the rest of the file)
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.
Done!
|
@EmsArnold Been using this for commissioning purposes on i22 - and strongly suggest we make sure that all of these plans stubs wait for the plan to finish by default |
I think we should reduce the number of plans which result in the same functional scan (i.e. having two plans which do a scan based on
No, I only implemented the plans this way (implicit scan type, familiar for GDA users) as a comparison to #1702 (explicit scan type, familiar to bluesky users). If there is a consensus to shift from the implicit GDA style to an explicit bluesky style (and we believe this would benefit scientists and users in the future), I am happy to make the swap. |
|
Sorry for comments so late due to holiday leaves. I support @DominicOram suggestion that all scans should be explicitly named so its behaviour doesn't depend on the number of parameters in the input - I regard this feature in GDA scan is a bad design as users need to read doc or use help to discover what each scan syntax does. in the new system we should make these explicitly and then enforce the number of parameters checking for each command in command pre-processor or parser. |
45984d0 to
747ff68
Compare
|
@DominicOram , I have swapped the plans from implicit to explicit for |
Closes #1498, and as an alternative to #1702. Scan syntax is more similar to both GDA and bluesky.
Wraps bluesky plans (
scan,rel_scan,grid_scan,rel_grid_scan) and plan stubs (rd,stop) for use in blueapi. Intended as a replacement for gda-style start stop step scans until spec_scan is stable and supports start stop step rather than start stop num. Start stop step scans are achieved through generating a list for use withlist_scan,rel_list_scan, ...Concurrent trajectory scans (
scan, etc.) and independent trajectory scans (grid_scan, etc.) are both accessed through the same plan and differentiated by number of parameters given for each movable - similar to current GDA-style scans.Instructions to reviewer on how to test:
Checks for reviewer