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

Commit

Permalink
Merge pull request #1261 from DiamondLightSource/1260_provide_index_w…
Browse files Browse the repository at this point in the history
…ith_zocalo

Provide index to zocalo for GPU
  • Loading branch information
DominicOram authored Mar 18, 2024
2 parents beac4d1 + f562f27 commit 43c229c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ install_requires =
xarray
doct
databroker
dls-dodal @ git+https://github.com/DiamondLightSource/dodal.git
dls-dodal @ git+https://github.com/DiamondLightSource/dodal.git@288697d744a1d745dc865889960063e575c59b21
pydantic<2.0 # See https://github.com/DiamondLightSource/hyperion/issues/774
scipy
pyzmq<25 # See https://github.com/DiamondLightSource/hyperion/issues/1103
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,15 @@ def start(self, doc: RunStart):
and len(ispyb_ids) > 0
):
ids_and_shape = list(zip(ispyb_ids, scan_points))
start_idx = 0
start_frame = 0
self.zocalo_info = []
for id, shape in ids_and_shape:
for idx, id_and_shape in enumerate(ids_and_shape):
id, shape = id_and_shape
num_frames = number_of_frames_from_scan_spec(shape)
self.zocalo_info.append(
ZocaloStartInfo(id, None, start_idx, num_frames)
ZocaloStartInfo(id, None, start_frame, num_frames, idx)
)
start_idx += num_frames
start_frame += num_frames
else:
raise ISPyBDepositionNotMade(
f"No ISPyB IDs received by the start of {self.triggering_plan=}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -826,8 +826,8 @@ def test_kickoff_and_complete_gridscan_triggers_zocalo(
mock_zocalo_trigger_class.assert_called_once_with(zocalo_env)

expected_start_infos = [
ZocaloStartInfo(id_1, "test/filename", 0, x_steps * y_steps),
ZocaloStartInfo(id_2, "test/filename", x_steps * y_steps, x_steps * z_steps),
ZocaloStartInfo(id_1, "test/filename", 0, x_steps * y_steps, 0),
ZocaloStartInfo(id_2, "test/filename", x_steps * y_steps, x_steps * z_steps, 1),
]

expected_start_calls = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ def test_execution_of_do_fgs_triggers_zocalo_calls(
assert zocalo_handler.zocalo_interactor is not None

expected_start_calls = [
call(ZocaloStartInfo(1, "test_path", 0, 200)),
call(ZocaloStartInfo(2, "test_path", 200, 300)),
call(ZocaloStartInfo(1, "test_path", 0, 200, 0)),
call(ZocaloStartInfo(2, "test_path", 200, 300, 1)),
]

zocalo_handler.zocalo_interactor.run_start.assert_has_calls(
Expand Down

0 comments on commit 43c229c

Please sign in to comment.