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

Take snapshots before robot load #1333

Merged
merged 4 commits into from
Apr 26, 2024
Merged

Conversation

DominicOram
Copy link
Collaborator

Fixes #1282

Dodal PR: DiamondLightSource/dodal#468

To test:

  1. Confirm tests pass
  2. Run the modified system tests and confirm data appears in the dev ispyb database with snapshots (note https://jira.diamond.ac.uk/browse/LIMS-1304)

Copy link
Contributor

@olliesilvester olliesilvester left a comment

Choose a reason for hiding this comment

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

Looks sensible, nice!

@@ -62,7 +62,12 @@ def activity_gated_event(self, doc: Event) -> Event | None:
self.action_id is not None
), "ISPyB Robot load callback event called unexpectedly"
barcode = doc["data"]["robot-barcode"]
self.expeye.update_barcode(self.action_id, barcode)
oav_snapshot = doc["data"]["oav_snapshot_last_saved_path"]
Copy link
Contributor

Choose a reason for hiding this comment

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

How do you know if you need dashes or hyphens in lines like webcam_snapshot = doc["data"]["webcam-last_saved_path"]?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So when you have a device like:

class MyDevice():
    self.signal = ...
my_device = MyDevice()

Then you do yield from bps.read(my_device) the RE produces a document with data like:

data: {
    "X": "value"
}

Where:

  • In ophyd _ is used as a separator so X is my_device_signal
  • ophyd_async instead uses - so X is my_device-signal

If you tried to look in the dict for the wrong one you would fail with a KeyError. This is a frustrating breaking change between the two but it does make sense because _ is a valid (and commonly used) part of a variable name it's impossible to know which was the device and signal in my_device_signal by just looking at the string. By using - instead you can work that out.

@DominicOram DominicOram merged commit e729d60 into main Apr 26, 2024
24 checks passed
@DominicOram DominicOram deleted the 1282_robot_load_snapshots branch April 26, 2024 09:55
olliesilvester pushed a commit to olliesilvester/mx-bluesky that referenced this pull request Aug 23, 2024
…Source/1282_robot_load_snapshots

Take snapshots before robot load
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.

Create snapshots after robot load
2 participants