-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add do fgs_plan #140
Add do fgs_plan #140
Conversation
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 we will probably want another level of categorisation than this, maybe put do_fgs
into a gridscan module?
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.
Thanks, I think we can maybe keep them even more similar
src/mx_bluesky/plan_stubs/do_fgs.py
Outdated
if post_plans: | ||
yield from post_plans() |
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: Similar to above, I think we might be able to:
- Wait for the zocalo stage in hyperion before calling
do_fgs
- Just always read the devices we have in both plans
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.
So the wait for zocalo stage has the potential to take 2 seconds. I think maybe for the moment keep the post_plans
bit and call it with a wait for stage on hyperion. I think it should be renamed to during_collection_plans
though, as that's what it is
7a76b60
to
adb89b3
Compare
adb89b3
to
b439f20
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #140 +/- ##
==========================================
+ Coverage 78.28% 78.39% +0.11%
==========================================
Files 93 96 +3
Lines 6815 6850 +35
==========================================
+ Hits 5335 5370 +35
Misses 1480 1480
|
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.
Sorry to put comments on this again. Is there a reason we didn't just put all of kickoff_and_complete_gridscan
in common? I think it is common to all beamlines?
src/mx_bluesky/hyperion/experiment_plans/flyscan_xray_centre_plan.py
Outdated
Show resolved
Hide resolved
No real reason, I was just trying to move bits incrementally, and wasn't sure about the Zocalo bits on other beamlines |
I agree about the zocalo stuff not being needed everywhere but I think the other decorators are common, and would be needed for nexus/ispyb writing. If you want to do that in the next PR though that's fine |
OK, I'll put the whole function in |
I started to reshuffle some of the hyperion tests in |
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.
A couple of final questions around the tests but generally there.
"mx_bluesky.common.plans.do_fgs.check_topup_and_wait_if_necessary" | ||
) as mock_check_topup, | ||
patch( | ||
"mx_bluesky.common.plans.do_fgs.read_hardware_for_zocalo" | ||
) as mock_read_hardware, |
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: Why not have these as a patch decorator? Seems slightly cleaner?
assert len(null_messages) == 0 | ||
|
||
|
||
def test_kickoff_and_complete_gridscan_with_run_engine_correct_documents( |
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.
Could: It's probably better to test this with the real zocalo callback. Otherwise we end up potentially going down the rabbithole of #479
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.
Yep, agreed. I did start to do this, but then it lead to having to move the callbacks to common, which requires also moving the parameters + constants to common, so I reverted. Anyway, I'll add a comment linking to an issue, saying to change this test once the zocalo callbacks have been moved
tests/unit_tests/hyperion/experiment_plans/test_flyscan_xray_centre_plan.py
Outdated
Show resolved
Hide resolved
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.
Great, thank you!
Fixes #80 as part of https://github.com/orgs/DiamondLightSource/projects/6/views/1?pane=issue&itemId=73047222. This adds a slightly modified version of the
do_fgs
plan in Hyperion. Here, you can optionally device whether or not we need to do extra things - eg zocalo. This plan should be usable for VMXm, i03, i04, and hopefully other MX beamlines.The idea of theI renamed itlevel 1
folder is for it to be filled with plan stubs, i.e plans that cannot be ran on their own. I guess it could just be renamed toplan_stubs
...plan_stubs
To test: