Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rationalise slits #557

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/dodal/beamlines/i03.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
from dodal.devices.oav.pin_image_recognition import PinTipDetection
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.thawer import Thawer
Expand Down Expand Up @@ -282,12 +283,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,
Expand Down
7 changes: 4 additions & 3 deletions src/dodal/beamlines/i04.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
from dodal.devices.ipin import IPin
from dodal.devices.motors import XYZPositioner
from dodal.devices.oav.oav_detector import OAV, OAVConfigParams
from dodal.devices.sample_shutter import SampleShutter
from dodal.devices.slits import Slits
from dodal.devices.robot import BartRobot
from dodal.devices.s4_slit_gaps import S4SlitGaps
from dodal.devices.smargon import Smargon
from dodal.devices.synchrotron import Synchrotron
from dodal.devices.thawer import Thawer
Expand Down Expand Up @@ -277,12 +278,12 @@ def zebra_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,
Expand Down
6 changes: 3 additions & 3 deletions src/dodal/beamlines/i04_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 0 additions & 8 deletions src/dodal/devices/s4_slit_gaps.py

This file was deleted.

8 changes: 4 additions & 4 deletions tests/devices/system_tests/test_slit_gaps_system.py
Original file line number Diff line number Diff line change
@@ -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()
Loading