diff --git a/src/hyperion/experiment_plans/oav_snapshot_plan.py b/src/hyperion/experiment_plans/oav_snapshot_plan.py index 1615d55d6..0a6167a38 100644 --- a/src/hyperion/experiment_plans/oav_snapshot_plan.py +++ b/src/hyperion/experiment_plans/oav_snapshot_plan.py @@ -56,6 +56,9 @@ def oav_snapshot_plan( oav_parameters: OAVParameters, wait: bool = True, ) -> MsgGenerator: + omegas = parameters.snapshot_omegas_deg + if not omegas: + return yield from _setup_oav(composite, parameters, oav_parameters) - for omega in parameters.snapshot_omegas_deg: + for omega in omegas: yield from _take_oav_snapshot(composite, parameters, omega) diff --git a/tests/unit_tests/external_interaction/callbacks/rotation/test_ispyb_callback.py b/tests/unit_tests/external_interaction/callbacks/rotation/test_ispyb_callback.py index 0096b76f9..9a47f2c3c 100644 --- a/tests/unit_tests/external_interaction/callbacks/rotation/test_ispyb_callback.py +++ b/tests/unit_tests/external_interaction/callbacks/rotation/test_ispyb_callback.py @@ -236,7 +236,7 @@ def test_oav_rotation_snapshot_triggered_event( ]: mx.upsert_data_collection.reset_mock() event_doc = dict(TestData.test_event_document_oav_rotation_snapshot) - event_doc["data"]["oav_snapshot_last_saved_path"] = snapshot["filename"] + event_doc["data"]["oav_snapshot_last_saved_path"] = snapshot["filename"] # type: ignore callback.activity_gated_event( TestData.test_event_document_oav_rotation_snapshot )