-
Notifications
You must be signed in to change notification settings - Fork 12
Add ability to move scintillator in to beam for i04 #1583
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1583 +/- ##
=======================================
Coverage 99.08% 99.09%
=======================================
Files 275 275
Lines 10098 10114 +16
=======================================
+ Hits 10006 10022 +16
Misses 92 92 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Thanks, some comments in code but mostly quite minor
|
From discussion on i03 I think we may have got the collision with the aperture/scatterguard wrong here, see DiamondLightSource/mx-bluesky#1354 |
srishtysajeev
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.
From beamline testing need to add awaits such as:
- def _check_aperture_parked(self):
+ async def _check_aperture_parked(self):
if (
- self._aperture_scatterguard().selected_aperture.get_value()
+ await self._aperture_scatterguard().selected_aperture.get_value()
!= ApertureValue.PARKED
):
raise ValueError(
- "Cannot move scintillator out if aperture/scatterguard is not parked"
+ f"Cannot move scintillator out if aperture/scatterguard is not parked. Position is currently {await self._aperture_scatterguard().selected_aperture.get_value()}"
)
async def _set_selected_position(self, position: InOut) -> None:
- self._check_aperture_parked()
+ await self._check_aperture_parked()
match position:
case InOut.OUT:
await self.y_mm.set(self._scintillator_out_yz_mm[0])
ba148ee to
9ac45ee
Compare
|
Need to make sure this doesn't undo #1625 by blocking a set if nothing needs to happen |
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.
Thanks, a couple of comments
tests/devices/test_scintillator.py
Outdated
| await assert_value(scintillator.z_mm.user_setpoint, 101.5115) | ||
|
|
||
|
|
||
| async def test_given_aperture_scatterguard_not_parked_when_set_to_out_position_then_exception_raised( |
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: This function says it checks out but it actually checks both. A better way to do this would be to use pytest.mark.parametrize to test each thing in isolation
| """ | ||
| See https://opencv24-python-tutorials.readthedocs.io/en/latest/py_tutorials/py_imgproc/py_morphological_ops/py_morphological_ops.html | ||
| for description of functions below. | ||
| """ |
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: This seems unrelated so technically shouldn't be part of this PR but it's just some docs so fine to keep here
…to just In and Out.
…ition from tuple to list
9f52097 to
21b3eca
Compare
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.
Great, thanks
srishtysajeev
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.
addint comment
| raise ValueError( | ||
| f"Cannot move scintillator if aperture/scatterguard is not parked. Position is currently {await self._aperture_scatterguard().selected_aperture.get_value()}" | ||
| ) | ||
|
|
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.
Is self._aperture_scatterguard().selected_aperture.get_value(), what we want here? I noticed that sometimes the error gives out Large or Small rather than an actual position - is that expected, and should I be testing that the correct error message is outputted?
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.
That's correct, the positions it can have are Large/Medium/Small
* Add scint into beam + change Enum comment to be be more descriptive compared to just In and Out. --------- Co-authored-by: Dominic Oram <[email protected]>
Fixes #1567
Instructions to reviewer on how to test:
Checks for reviewer
dodal connect ${BEAMLINE}