From b140cb94d11dbe657afa2ae47414c7d84365f2ea Mon Sep 17 00:00:00 2001 From: Oliver Silvester Date: Mon, 20 May 2024 16:11:36 +0100 Subject: [PATCH] Remove s4_slit_gaps and just use slits --- src/dodal/beamlines/i03.py | 6 +++--- src/dodal/beamlines/i04.py | 6 +++--- src/dodal/beamlines/i04_1.py | 6 +++--- src/dodal/devices/s4_slit_gaps.py | 8 -------- tests/devices/system_tests/test_slit_gaps_system.py | 8 ++++---- 5 files changed, 13 insertions(+), 21 deletions(-) delete mode 100644 src/dodal/devices/s4_slit_gaps.py diff --git a/src/dodal/beamlines/i03.py b/src/dodal/beamlines/i03.py index bd1be45e37..14397ae776 100644 --- a/src/dodal/beamlines/i03.py +++ b/src/dodal/beamlines/i03.py @@ -22,8 +22,8 @@ from dodal.devices.panda_fast_grid_scan import PandAFastGridScan from dodal.devices.qbpm1 import QBPM1 from dodal.devices.robot import BartRobot -from dodal.devices.s4_slit_gaps import S4SlitGaps from dodal.devices.sample_shutter import SampleShutter +from dodal.devices.slits import Slits from dodal.devices.smargon import Smargon from dodal.devices.synchrotron import Synchrotron from dodal.devices.undulator import Undulator @@ -267,12 +267,12 @@ def smargon( def s4_slit_gaps( wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False -) -> S4SlitGaps: +) -> Slits: """Get the i03 s4_slit_gaps device, instantiate it if it hasn't already been. If this is called when already instantiated in i03, it will return the existing object. """ return device_instantiation( - S4SlitGaps, + Slits, "s4_slit_gaps", "-AL-SLITS-04:", wait_for_connection, diff --git a/src/dodal/beamlines/i04.py b/src/dodal/beamlines/i04.py index 4451adb271..8f9ad5ac70 100644 --- a/src/dodal/beamlines/i04.py +++ b/src/dodal/beamlines/i04.py @@ -14,8 +14,8 @@ from dodal.devices.ipin import IPin from dodal.devices.motors import XYZPositioner from dodal.devices.oav.oav_detector import OAV, OAVConfigParams -from dodal.devices.s4_slit_gaps import S4SlitGaps from dodal.devices.sample_shutter import SampleShutter +from dodal.devices.slits import Slits from dodal.devices.smargon import Smargon from dodal.devices.synchrotron import Synchrotron from dodal.devices.undulator import Undulator @@ -275,12 +275,12 @@ def fast_grid_scan( def s4_slit_gaps( wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False -) -> S4SlitGaps: +) -> Slits: """Get the i04 s4_slit_gaps device, instantiate it if it hasn't already been. If this is called when already instantiated in i04, it will return the existing object. """ return device_instantiation( - S4SlitGaps, + Slits, "s4_slit_gaps", "-AL-SLITS-04:", wait_for_connection, diff --git a/src/dodal/beamlines/i04_1.py b/src/dodal/beamlines/i04_1.py index edadf03eea..f053592e8f 100644 --- a/src/dodal/beamlines/i04_1.py +++ b/src/dodal/beamlines/i04_1.py @@ -4,7 +4,7 @@ from dodal.devices.detector import DetectorParams from dodal.devices.eiger import EigerDetector from dodal.devices.oav.oav_detector import OAV, OAVConfigParams -from dodal.devices.s4_slit_gaps import S4SlitGaps +from dodal.devices.slits import Slits from dodal.devices.synchrotron import Synchrotron from dodal.devices.undulator import Undulator from dodal.devices.zebra import Zebra @@ -81,12 +81,12 @@ def oav(wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False) -> def s4_slit_gaps( wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False -) -> S4SlitGaps: +) -> Slits: """Get the i04_1 s4_slit_gaps device, instantiate it if it hasn't already been. If this is called when already instantiated in i04_1, it will return the existing object. """ return device_instantiation( - S4SlitGaps, + Slits, "s4_slit_gaps", "-AL-SLITS-04:", wait_for_connection, diff --git a/src/dodal/devices/s4_slit_gaps.py b/src/dodal/devices/s4_slit_gaps.py deleted file mode 100644 index 522bb551ac..0000000000 --- a/src/dodal/devices/s4_slit_gaps.py +++ /dev/null @@ -1,8 +0,0 @@ -from ophyd import Component, Device, EpicsMotor - - -class S4SlitGaps(Device): - """Note that the S4 slits have a different PV fromat to other beamline slits""" - - xgap = Component(EpicsMotor, "XGAP") - ygap = Component(EpicsMotor, "YGAP") diff --git a/tests/devices/system_tests/test_slit_gaps_system.py b/tests/devices/system_tests/test_slit_gaps_system.py index 4b03134598..190d5466ce 100644 --- a/tests/devices/system_tests/test_slit_gaps_system.py +++ b/tests/devices/system_tests/test_slit_gaps_system.py @@ -1,10 +1,10 @@ import pytest -from dodal.devices.s4_slit_gaps import S4SlitGaps +from dodal.devices.slits import Slits @pytest.mark.s03 -def test_when_s4_slit_gaps_created_against_s03_then_can_connect(): - slit_gaps = S4SlitGaps("BL03S-AL-SLITS-04:", name="slit_gaps") +async def test_when_s4_slit_gaps_created_against_s03_then_can_connect(): + slit_gaps = Slits("BL03S-AL-SLITS-04:", name="slit_gaps") - slit_gaps.wait_for_connection() + await slit_gaps.connect()