diff --git a/setup.cfg b/setup.cfg index 33ee12e26..b8af7a30b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -45,7 +45,7 @@ install_requires = ophyd-async >= 0.3a5 bluesky >= 1.13.0a3 blueapi >= 0.4.3-rc1 - dls-dodal @ git+https://github.com/DiamondLightSource/dodal.git@ce2a48780b979fb585214092741b76c449b05452 + dls-dodal @ git+https://github.com/DiamondLightSource/dodal.git@1609c2dccdc85f43b02de5f5e0a12722842f7d1d [options.entry_points] console_scripts = diff --git a/src/hyperion/device_setup_plans/read_hardware_for_setup.py b/src/hyperion/device_setup_plans/read_hardware_for_setup.py index 3a2cb960c..2521fc7c0 100644 --- a/src/hyperion/device_setup_plans/read_hardware_for_setup.py +++ b/src/hyperion/device_setup_plans/read_hardware_for_setup.py @@ -7,7 +7,7 @@ from dodal.devices.eiger import EigerDetector from dodal.devices.flux import Flux from dodal.devices.robot import BartRobot -from dodal.devices.s4_slit_gaps import S4SlitGaps +from dodal.devices.slits import Slits from dodal.devices.smargon import Smargon from dodal.devices.synchrotron import Synchrotron from dodal.devices.undulator import Undulator @@ -19,7 +19,7 @@ def read_hardware_for_ispyb_pre_collection( undulator: Undulator, synchrotron: Synchrotron, - s4_slit_gaps: S4SlitGaps, + s4_slit_gaps: Slits, aperture_scatterguard: ApertureScatterguard, robot: BartRobot, smargon: Smargon, @@ -30,8 +30,8 @@ def read_hardware_for_ispyb_pre_collection( ) # gives name to event *descriptor* document yield from bps.read(undulator.current_gap) yield from bps.read(synchrotron.synchrotron_mode) - yield from bps.read(s4_slit_gaps.xgap) - yield from bps.read(s4_slit_gaps.ygap) + yield from bps.read(s4_slit_gaps.x_gap) + yield from bps.read(s4_slit_gaps.y_gap) yield from bps.read(aperture_scatterguard) yield from bps.read(smargon.x) yield from bps.read(smargon.y) diff --git a/src/hyperion/experiment_plans/flyscan_xray_centre_plan.py b/src/hyperion/experiment_plans/flyscan_xray_centre_plan.py index fa903b913..4249f449b 100755 --- a/src/hyperion/experiment_plans/flyscan_xray_centre_plan.py +++ b/src/hyperion/experiment_plans/flyscan_xray_centre_plan.py @@ -24,7 +24,7 @@ from dodal.devices.fast_grid_scan import set_fast_grid_scan_params as set_flyscan_params from dodal.devices.flux import Flux from dodal.devices.robot import BartRobot -from dodal.devices.s4_slit_gaps import S4SlitGaps +from dodal.devices.slits import Slits from dodal.devices.smargon import Smargon, StubPosition from dodal.devices.synchrotron import Synchrotron from dodal.devices.undulator import Undulator @@ -79,7 +79,7 @@ class FlyScanXRayCentreComposite: eiger: EigerDetector zebra_fast_grid_scan: ZebraFastGridScan flux: Flux - s4_slit_gaps: S4SlitGaps + s4_slit_gaps: Slits smargon: Smargon undulator: Undulator synchrotron: Synchrotron diff --git a/src/hyperion/experiment_plans/grid_detect_then_xray_centre_plan.py b/src/hyperion/experiment_plans/grid_detect_then_xray_centre_plan.py index fc131b753..37507b503 100644 --- a/src/hyperion/experiment_plans/grid_detect_then_xray_centre_plan.py +++ b/src/hyperion/experiment_plans/grid_detect_then_xray_centre_plan.py @@ -18,7 +18,7 @@ from dodal.devices.oav.oav_parameters import OAV_CONFIG_JSON, OAVParameters from dodal.devices.oav.pin_image_recognition import PinTipDetection from dodal.devices.robot import BartRobot -from dodal.devices.s4_slit_gaps import S4SlitGaps +from dodal.devices.slits import Slits from dodal.devices.smargon import Smargon from dodal.devices.synchrotron import Synchrotron from dodal.devices.undulator import Undulator @@ -75,7 +75,7 @@ class GridDetectThenXRayCentreComposite: pin_tip_detection: PinTipDetection smargon: Smargon synchrotron: Synchrotron - s4_slit_gaps: S4SlitGaps + s4_slit_gaps: Slits undulator: Undulator xbpm_feedback: XBPMFeedback zebra: Zebra diff --git a/src/hyperion/experiment_plans/robot_load_then_centre_plan.py b/src/hyperion/experiment_plans/robot_load_then_centre_plan.py index f6c23550a..d4c259f97 100644 --- a/src/hyperion/experiment_plans/robot_load_then_centre_plan.py +++ b/src/hyperion/experiment_plans/robot_load_then_centre_plan.py @@ -20,7 +20,7 @@ from dodal.devices.oav.oav_detector import OAV from dodal.devices.oav.pin_image_recognition import PinTipDetection from dodal.devices.robot import BartRobot, SampleLocation -from dodal.devices.s4_slit_gaps import S4SlitGaps +from dodal.devices.slits import Slits from dodal.devices.smargon import Smargon, StubPosition from dodal.devices.synchrotron import Synchrotron from dodal.devices.undulator import Undulator @@ -67,7 +67,7 @@ class RobotLoadThenCentreComposite: pin_tip_detection: PinTipDetection smargon: Smargon synchrotron: Synchrotron - s4_slit_gaps: S4SlitGaps + s4_slit_gaps: Slits undulator: Undulator zebra: Zebra zocalo: ZocaloResults diff --git a/src/hyperion/experiment_plans/rotation_scan_plan.py b/src/hyperion/experiment_plans/rotation_scan_plan.py index 39d9bb306..e466fd8c6 100644 --- a/src/hyperion/experiment_plans/rotation_scan_plan.py +++ b/src/hyperion/experiment_plans/rotation_scan_plan.py @@ -13,7 +13,7 @@ from dodal.devices.eiger import EigerDetector from dodal.devices.flux import Flux from dodal.devices.robot import BartRobot -from dodal.devices.s4_slit_gaps import S4SlitGaps +from dodal.devices.slits import Slits from dodal.devices.smargon import Smargon from dodal.devices.synchrotron import Synchrotron from dodal.devices.undulator import Undulator @@ -62,7 +62,7 @@ class RotationScanComposite: smargon: Smargon undulator: Undulator synchrotron: Synchrotron - s4_slit_gaps: S4SlitGaps + s4_slit_gaps: Slits zebra: Zebra def __post_init__(self): diff --git a/src/hyperion/external_interaction/callbacks/ispyb_callback_base.py b/src/hyperion/external_interaction/callbacks/ispyb_callback_base.py index 9129aa6d5..f033bc537 100644 --- a/src/hyperion/external_interaction/callbacks/ispyb_callback_base.py +++ b/src/hyperion/external_interaction/callbacks/ispyb_callback_base.py @@ -121,8 +121,8 @@ def _handle_ispyb_hardware_read(self, doc) -> Sequence[ScanDataInfo]: focal_spot_size_at_sampley=beamsize.y_um, undulator_gap1=doc["data"]["undulator-current_gap"], synchrotron_mode=synchrotron_mode.value, - slitgap_horizontal=doc["data"]["s4_slit_gaps_xgap"], - slitgap_vertical=doc["data"]["s4_slit_gaps_ygap"], + slitgap_horizontal=doc["data"]["s4_slit_gaps-x_gap"], + slitgap_vertical=doc["data"]["s4_slit_gaps-y_gap"], ) hwscan_position_info = DataCollectionPositionInfo( pos_x=doc["data"]["smargon_x"], diff --git a/tests/conftest.py b/tests/conftest.py index c4616e991..2a0ef4fe0 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -33,7 +33,7 @@ from dodal.devices.flux import Flux from dodal.devices.oav.oav_detector import OAVConfigParams from dodal.devices.robot import BartRobot -from dodal.devices.s4_slit_gaps import S4SlitGaps +from dodal.devices.slits import Slits from dodal.devices.smargon import Smargon from dodal.devices.synchrotron import Synchrotron, SynchrotronMode from dodal.devices.undulator import Undulator @@ -547,7 +547,7 @@ def fake_create_rotation_devices( undulator: Undulator, aperture_scatterguard: ApertureScatterguard, synchrotron: Synchrotron, - s4_slit_gaps: S4SlitGaps, + s4_slit_gaps: Slits, dcm: DCM, robot: BartRobot, done_status, diff --git a/tests/system_tests/experiment_plans/test_plan_system.py b/tests/system_tests/experiment_plans/test_plan_system.py index 583f62fe8..33332df3a 100644 --- a/tests/system_tests/experiment_plans/test_plan_system.py +++ b/tests/system_tests/experiment_plans/test_plan_system.py @@ -3,7 +3,7 @@ from bluesky.run_engine import RunEngine from dodal.beamlines import i03 from dodal.devices.aperturescatterguard import ApertureScatterguard -from dodal.devices.s4_slit_gaps import S4SlitGaps +from dodal.devices.slits import Slits from dodal.devices.undulator import Undulator from hyperion.device_setup_plans.read_hardware_for_setup import ( @@ -20,7 +20,7 @@ async def test_getting_data_for_ispyb(): f"{CONST.SIM.INSERTION_PREFIX}-MO-SERVC-01:", name="undulator" ) synchrotron = i03.synchrotron(fake_with_ophyd_sim=True) - slit_gaps = S4SlitGaps(f"{CONST.SIM.BEAMLINE}-AL-SLITS-04:", name="slits") + slit_gaps = Slits(f"{CONST.SIM.BEAMLINE}-AL-SLITS-04:", name="slits") attenuator = i03.attenuator(fake_with_ophyd_sim=True) flux = i03.flux(fake_with_ophyd_sim=True) dcm = i03.dcm(fake_with_ophyd_sim=True) @@ -29,9 +29,9 @@ async def test_getting_data_for_ispyb(): ) smargon = i03.smargon(fake_with_ophyd_sim=True) - undulator.wait_for_connection() + await undulator.connect() await synchrotron.connect() - slit_gaps.wait_for_connection() + await slit_gaps.connect() attenuator.wait_for_connection() flux.wait_for_connection() aperture_scatterguard.wait_for_connection() diff --git a/tests/system_tests/external_interaction/test_ispyb_dev_connection.py b/tests/system_tests/external_interaction/test_ispyb_dev_connection.py index 39bd9b6d9..f3d5630c2 100644 --- a/tests/system_tests/external_interaction/test_ispyb_dev_connection.py +++ b/tests/system_tests/external_interaction/test_ispyb_dev_connection.py @@ -12,7 +12,7 @@ from bluesky.run_engine import RunEngine from dodal.devices.attenuator import Attenuator from dodal.devices.flux import Flux -from dodal.devices.s4_slit_gaps import S4SlitGaps +from dodal.devices.slits import Slits from dodal.devices.synchrotron import Synchrotron, SynchrotronMode from dodal.devices.undulator import Undulator from ophyd.status import Status @@ -586,8 +586,12 @@ def test_ispyb_deposition_in_gridscan( fetch_datacollection_position_attribute: Callable[..., Any], ): os.environ["ISPYB_CONFIG_PATH"] = CONST.SIM.DEV_ISPYB_DATABASE_CFG - grid_detect_then_xray_centre_composite.s4_slit_gaps.xgap.user_readback.sim_put(0.1) # type: ignore - grid_detect_then_xray_centre_composite.s4_slit_gaps.ygap.user_readback.sim_put(0.1) # type: ignore + set_mock_value( + grid_detect_then_xray_centre_composite.s4_slit_gaps.x_gap.user_readback, 0.1 + ) + set_mock_value( + grid_detect_then_xray_centre_composite.s4_slit_gaps.y_gap.user_readback, 0.1 + ) ispyb_callback = GridscanISPyBCallback() RE.subscribe(ispyb_callback) RE( @@ -756,7 +760,7 @@ def test_ispyb_deposition_in_rotation_plan( undulator: Undulator, attenuator: Attenuator, synchrotron: Synchrotron, - s4_slit_gaps: S4SlitGaps, + s4_slit_gaps: Slits, flux: Flux, robot, fake_create_devices: dict[str, Any], @@ -789,11 +793,13 @@ def test_ispyb_deposition_in_rotation_plan( fake_create_rotation_devices.synchrotron.topup_start_countdown, # pyright: ignore -1, ) - fake_create_rotation_devices.s4_slit_gaps.xgap.user_readback.sim_put( # pyright: ignore - test_slit_gap_horiz + set_mock_value( + fake_create_rotation_devices.s4_slit_gaps.x_gap.user_readback, + test_slit_gap_horiz, ) - fake_create_rotation_devices.s4_slit_gaps.ygap.user_readback.sim_put( # pyright: ignore - test_slit_gap_vert + set_mock_value( + fake_create_rotation_devices.s4_slit_gaps.y_gap.user_readback, + test_slit_gap_vert, ) test_rotation_params.detector_params.expected_energy_ev = energy_ev diff --git a/tests/unit_tests/experiment_plans/test_flyscan_xray_centre_plan.py b/tests/unit_tests/experiment_plans/test_flyscan_xray_centre_plan.py index 0ed4978e0..811e9e4bf 100644 --- a/tests/unit_tests/experiment_plans/test_flyscan_xray_centre_plan.py +++ b/tests/unit_tests/experiment_plans/test_flyscan_xray_centre_plan.py @@ -206,8 +206,13 @@ def test_read_hardware_for_ispyb_updates_from_ophyd_devices( "radius_microns": 20, "location": (10, 11, 2, 13, 14), } - fake_fgs_composite.s4_slit_gaps.xgap.user_readback.sim_put(xgap_test_value) # type: ignore - fake_fgs_composite.s4_slit_gaps.ygap.user_readback.sim_put(ygap_test_value) # type: ignore + set_mock_value( + fake_fgs_composite.s4_slit_gaps.x_gap.user_readback, xgap_test_value + ) + set_mock_value( + fake_fgs_composite.s4_slit_gaps.y_gap.user_readback, ygap_test_value + ) + flux_test_value = 10.0 fake_fgs_composite.flux.flux_reading.sim_put(flux_test_value) # type: ignore @@ -254,9 +259,9 @@ def test_read_hardware_for_ispyb_updates_from_ophyd_devices( { "undulator-current_gap": undulator_test_value, "synchrotron-synchrotron_mode": synchrotron_test_value.value, - "s4_slit_gaps_xgap": xgap_test_value, - "s4_slit_gaps_ygap": ygap_test_value, - 'aperture_scatterguard-selected_aperture': ap_sg_test_value + "s4_slit_gaps-x_gap": xgap_test_value, + "s4_slit_gaps-y_gap": ygap_test_value, + aperture_scatterguard-selected_aperture': ap_sg_test_value }, ) assert_event( diff --git a/tests/unit_tests/experiment_plans/test_panda_flyscan_xray_centre_plan.py b/tests/unit_tests/experiment_plans/test_panda_flyscan_xray_centre_plan.py index af28b211e..2fbe9d55a 100644 --- a/tests/unit_tests/experiment_plans/test_panda_flyscan_xray_centre_plan.py +++ b/tests/unit_tests/experiment_plans/test_panda_flyscan_xray_centre_plan.py @@ -151,8 +151,12 @@ def test_read_hardware_for_ispyb_updates_from_ophyd_devices( } xgap_test_value = 0.1234 ygap_test_value = 0.2345 - fake_fgs_composite.s4_slit_gaps.xgap.user_readback.sim_put(xgap_test_value) # type: ignore - fake_fgs_composite.s4_slit_gaps.ygap.user_readback.sim_put(ygap_test_value) # type: ignore + set_mock_value( + fake_fgs_composite.s4_slit_gaps.x_gap.user_readback, xgap_test_value + ) + set_mock_value( + fake_fgs_composite.s4_slit_gaps.y_gap.user_readback, ygap_test_value + ) flux_test_value = 10.0 fake_fgs_composite.flux.flux_reading.sim_put(flux_test_value) # type: ignore @@ -191,8 +195,8 @@ def test_read_hardware_for_ispyb_updates_from_ophyd_devices( { "undulator-current_gap": undulator_test_value, "synchrotron-synchrotron_mode": synchrotron_test_value.value, - "s4_slit_gaps_xgap": xgap_test_value, - "s4_slit_gaps_ygap": ygap_test_value, + "s4_slit_gaps-x_gap": xgap_test_value, + "s4_slit_gaps-y_gap": ygap_test_value, 'aperture_scatterguard-selected_aperture': ap_sg_test_value, }, ) diff --git a/tests/unit_tests/external_interaction/callbacks/conftest.py b/tests/unit_tests/external_interaction/callbacks/conftest.py index 4a648044a..a067d8995 100644 --- a/tests/unit_tests/external_interaction/callbacks/conftest.py +++ b/tests/unit_tests/external_interaction/callbacks/conftest.py @@ -190,8 +190,8 @@ class TestData: "descriptor": "bd45c2e5-2b85-4280-95d7-a9a15800a78b", "time": 1666604299.828203, "data": { - "s4_slit_gaps_xgap": 0.1234, - "s4_slit_gaps_ygap": 0.2345, + "s4_slit_gaps-x_gap": 0.1234, + "s4_slit_gaps-y_gap": 0.2345, "synchrotron-synchrotron_mode": SynchrotronMode.USER, "undulator-current_gap": 1.234, "aperture_scatterguard-selected_aperture": {