Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Rotation scan puts in correct comment to ispyb #1425

Merged
merged 10 commits into from
Jun 10, 2024

Conversation

olliesilvester
Copy link
Contributor

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:

  1. Confirm tests are sensible and pass

@olliesilvester olliesilvester changed the title 933 rotation scan ispyb comment 2 Rotation scan puts in correct comment to ispyb Jun 3, 2024
Copy link
Collaborator

@DominicOram DominicOram left a 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

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}"
Copy link
Collaborator

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(),
Copy link
Collaborator

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.

Comment on lines 153 to 161
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,
]
Copy link
Collaborator

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

Copy link
Collaborator

@DominicOram DominicOram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks! Great!

@DominicOram DominicOram merged commit e2a5f0d into main Jun 10, 2024
6 checks passed
@DominicOram DominicOram deleted the 933_rotation_scan_ispyb_comment_2 branch June 10, 2024 15:24
olliesilvester added a commit to olliesilvester/mx-bluesky that referenced this pull request Aug 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rotation scan ispyb comment should contain metadata
2 participants