-
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
Beamline creation readme #323
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #323 +/- ##
==========================================
+ Coverage 89.97% 92.07% +2.10%
==========================================
Files 83 83
Lines 3171 3181 +10
==========================================
+ Hits 2853 2929 +76
+ Misses 318 252 -66 ☔ View full report in Codecov by Sentry. |
16f92f2
to
35c80b7
Compare
This change does enforce that Only device factory functions are defined in the beamlines package, and also enforces that beamlines either utilise device_instantiation or some other form of ensuring their methods return a singleton. Test coverage of new beamlines is already above the required patchset percentage just by inclusion in test_device_instantiation, which should reduce the barrier to entry of getting new beamlines added. |
2d7ef7d
to
a258c40
Compare
|
||
def test_device_creation(): | ||
devices = make_all_devices(i24, fake_with_ophyd_sim=True) | ||
@patch.object(dodal.utils, "get_beamline_name", return_value="i24") |
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 prefer the solution in #330 (review) - I know it's just a test, but reloading modules and deleting from sys feels extra messy to me - and it's not really necessary - all that's needed is to set the beamline_utils.BL
and clear the devices like I did here 05ab615
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.
Now that 330 is merged I'm happy to just rebase on top of main again and discard this. Any thoughts on the rest of the changes?
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.
Yes, I think this is great! it'll be very helpful I'm sure. It looks detailed enough for most developers to me, hopefully that's right. But I think you'd get better feedback from someone who didn't write the thing in the first place, haha
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.
Removed the i24 test changes from the tree
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.
But now i24 is failing again
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'm looking into it, I think it's not relevant for this PR, you can merge it anyway
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.
- Prevents issue with RunEngine event_loop not being available - Reduces duplication - Expandable to new beamlines
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 for this! I see nothing objectionable here so I think we can improve it later if we can get some feedback from people who look at it with fresh eyes
a258c40
to
217cc52
Compare
Addresses #321 (hopefully in time to assist creation of i20-1 beamline, help get i22 merged)
Instructions to reviewer on how to test:
Checks for reviewer