-
Notifications
You must be signed in to change notification settings - Fork 5
Rotation scan puts in correct comment to ispyb #1425
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.
Thank you, some comments in code
src/hyperion/external_interaction/callbacks/rotation/ispyb_callback.py
Outdated
Show resolved
Hide resolved
tests/unit_tests/external_interaction/callbacks/rotation/test_ispyb_callback.py
Outdated
Show resolved
Hide resolved
self.aperture_size = aperture_size | ||
|
||
def construct_comment(self) -> str: | ||
return f"Smargon XYZ positions: {self.motor_position} User comment: {self.user_comment} Aperture size: {self.aperture_size}" |
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.
Must: I think this is going to get a lot more verbose than the original. Maybe "Sample position: {self.motor_position} {self.user_comment} Aperture: {self.aperture_size}"
@@ -87,7 +109,10 @@ def activity_gated_start(self, doc: RunStart): | |||
self.params | |||
) | |||
data_collection_info = populate_remaining_data_collection_info( | |||
COMMENT_FOR_ROTATION_SCAN, dcgid, data_collection_info, self.params | |||
self.rotation_comment.construct_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.
Should: It's a bit messy that this results in None
in the comments to start. Could we just have this as self.params.comment
? This will then also mean that we don't need to store a RotationIsPyBComment
any more and can get rid of the class altogether.
src/hyperion/external_interaction/callbacks/rotation/ispyb_callback.py
Outdated
Show resolved
Hide resolved
info = scan_data_infos[0] | ||
assert ( | ||
info.data_collection_position_info | ||
), "Unable to find smargon motor position info" | ||
motor_positions = [ | ||
info.data_collection_position_info.pos_x, | ||
info.data_collection_position_info.pos_y, | ||
info.data_collection_position_info.pos_z, | ||
] |
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: I think getting these from the doc is maybe nicer? I'm not 100% convinced either way though
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.
Awesome, thanks! Great!
Fixes #933
Link to dodal PR (if required): #XXX
(remember to update
setup.cfg
with the dodal commit tag if you need it for tests to pass!)To test: