Skip to content

Commit f503f67

Browse files
WIP begin refactor of common gridscans
1 parent 3d3e31b commit f503f67

File tree

9 files changed

+21
-20
lines changed

9 files changed

+21
-20
lines changed

src/mx_bluesky/beamlines/i04/experiment_plans/i04_grid_detect_then_xray_centre_plan.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from dodal.devices.detector.detector_motion import DetectorMotion
1414
from dodal.devices.eiger import EigerDetector
1515
from dodal.devices.fast_grid_scan import (
16-
ZebraFastGridScan,
16+
ZebraThreeDFastGridScan,
1717
set_fast_grid_scan_params,
1818
)
1919
from dodal.devices.flux import Flux
@@ -80,7 +80,7 @@ def i04_grid_detect_then_xray_centre(
8080
backlight: Backlight = inject("backlight"),
8181
beamstop: Beamstop = inject("beamstop"),
8282
dcm: BaseDCM = inject("dcm"),
83-
zebra_fast_grid_scan: ZebraFastGridScan = inject("zebra_fast_grid_scan"),
83+
zebra_fast_grid_scan: ZebraThreeDFastGridScan = inject("zebra_fast_grid_scan"),
8484
flux: Flux = inject("flux"),
8585
oav: OAV = inject("oav"),
8686
pin_tip_detection: PinTipDetection = inject("pin_tip_detection"),

src/mx_bluesky/common/experiment_plans/common_flyscan_xray_centre_plan.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ def run_gridscan(
290290

291291
# GDA's gridscans requires Z steps to be at 0, so make sure we leave this device
292292
# in a GDA-happy state.
293+
# TODO if fgs motors is 3d then do the below
293294
yield from bps.abs_set(beamline_specific.fgs_motors.z_steps, 0, wait=False)
294295

295296

src/mx_bluesky/common/parameters/device_composites.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from dodal.devices.detector.detector_motion import DetectorMotion
1111
from dodal.devices.eiger import EigerDetector
1212
from dodal.devices.fast_grid_scan import (
13-
ZebraFastGridScan,
13+
ZebraThreeDFastGridScan,
1414
)
1515
from dodal.devices.flux import Flux
1616
from dodal.devices.mx_phase1.beamstop import Beamstop
@@ -62,7 +62,7 @@ class GridDetectThenXRayCentreComposite(FlyScanEssentialDevices):
6262
beamstop: Beamstop
6363
dcm: BaseDCM
6464
detector_motion: DetectorMotion
65-
zebra_fast_grid_scan: ZebraFastGridScan
65+
zebra_fast_grid_scan: ZebraThreeDFastGridScan
6666
flux: Flux
6767
oav: OAV
6868
pin_tip_detection: PinTipDetection

src/mx_bluesky/hyperion/experiment_plans/robot_load_then_centre_plan.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from dodal.devices.backlight import Backlight
1313
from dodal.devices.detector.detector_motion import DetectorMotion
1414
from dodal.devices.eiger import EigerDetector
15-
from dodal.devices.fast_grid_scan import PandAFastGridScan, ZebraFastGridScan
15+
from dodal.devices.fast_grid_scan import PandAFastGridScan, ZebraThreeDFastGridScan
1616
from dodal.devices.flux import Flux
1717
from dodal.devices.focusing_mirror import FocusingMirrorWithStripes, MirrorVoltages
1818
from dodal.devices.i03 import Beamstop
@@ -72,7 +72,7 @@ class RobotLoadThenCentreComposite:
7272
backlight: Backlight
7373
detector_motion: DetectorMotion
7474
eiger: EigerDetector
75-
zebra_fast_grid_scan: ZebraFastGridScan
75+
zebra_fast_grid_scan: ZebraThreeDFastGridScan
7676
flux: Flux
7777
oav: OAV
7878
pin_tip_detection: PinTipDetection

src/mx_bluesky/hyperion/parameters/device_composites.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from dodal.devices.eiger import EigerDetector
1111
from dodal.devices.fast_grid_scan import (
1212
PandAFastGridScan,
13-
ZebraFastGridScan,
13+
ZebraThreeDFastGridScan,
1414
)
1515
from dodal.devices.flux import Flux
1616
from dodal.devices.robot import BartRobot
@@ -52,7 +52,7 @@ class HyperionFlyScanXRayCentreComposite(FlyScanEssentialDevices):
5252
sample_shutter: ZebraShutter
5353
backlight: Backlight
5454
xbpm_feedback: XBPMFeedback
55-
zebra_fast_grid_scan: ZebraFastGridScan
55+
zebra_fast_grid_scan: ZebraThreeDFastGridScan
5656
smargon: Smargon
5757

5858

tests/unit_tests/beamlines/i04/test_i04_grid_detect_then_xray_centre_plan.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from dodal.devices.detector.detector_motion import DetectorMotion
1414
from dodal.devices.eiger import EigerDetector
1515
from dodal.devices.fast_grid_scan import (
16-
ZebraFastGridScan,
16+
ZebraThreeDFastGridScan,
1717
)
1818
from dodal.devices.flux import Flux
1919
from dodal.devices.mx_phase1.beamstop import Beamstop
@@ -51,7 +51,7 @@ def i04_grid_detect_then_xrc_default_params(
5151
backlight: Backlight,
5252
beamstop_phase1: Beamstop,
5353
dcm: BaseDCM,
54-
zebra_fast_grid_scan: ZebraFastGridScan,
54+
zebra_fast_grid_scan: ZebraThreeDFastGridScan,
5555
flux: Flux,
5656
oav: OAV,
5757
pin_tip_detection_with_found_pin: PinTipDetection,

tests/unit_tests/common/experiment_plans/inner_plans/test_do_fgs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from bluesky.simulators import RunEngineSimulator, assert_message_and_return_remaining
88
from bluesky.utils import MsgGenerator
99
from dodal.beamlines.i03 import eiger
10-
from dodal.devices.fast_grid_scan import ZebraFastGridScan
10+
from dodal.devices.fast_grid_scan import ZebraThreeDFastGridScan
1111
from dodal.devices.synchrotron import Synchrotron, SynchrotronMode
1212
from dodal.devices.zocalo.zocalo_results import (
1313
ZOCALO_STAGE_GROUP,
@@ -28,7 +28,7 @@
2828
def fgs_devices(RE):
2929
with init_devices(mock=True):
3030
synchrotron = Synchrotron()
31-
grid_scan_device = ZebraFastGridScan("zebra_fgs")
31+
grid_scan_device = ZebraThreeDFastGridScan("zebra_fgs")
3232

3333
# Eiger done separately as not ophyd-async yet
3434
detector = eiger(mock=True)
@@ -125,7 +125,7 @@ def event(self, doc: Event):
125125
synchrotron = fgs_devices["synchrotron"]
126126
set_mock_value(synchrotron.synchrotron_mode, SynchrotronMode.DEV)
127127
detector = fgs_devices["detector"]
128-
fgs_device: ZebraFastGridScan = fgs_devices["grid_scan_device"]
128+
fgs_device: ZebraThreeDFastGridScan = fgs_devices["grid_scan_device"]
129129

130130
detector.unstage = MagicMock()
131131

tests/unit_tests/common/experiment_plans/test_common_flyscan_xray_centre_plan.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from dodal.devices.detector.det_dim_constants import (
1313
EIGER_TYPE_EIGER2_X_16M,
1414
)
15-
from dodal.devices.fast_grid_scan import ZebraFastGridScan
15+
from dodal.devices.fast_grid_scan import ZebraThreeDFastGridScan
1616
from dodal.devices.smargon import CombinedMove
1717
from dodal.devices.synchrotron import SynchrotronMode
1818
from dodal.devices.zocalo import ZocaloStartInfo
@@ -229,7 +229,7 @@ def test_plan():
229229
def test_GIVEN_scan_already_valid_THEN_wait_for_GRIDSCAN_returns_immediately(
230230
self, patch_sleep: MagicMock, RE: RunEngine
231231
):
232-
test_fgs: ZebraFastGridScan = i03.zebra_fast_grid_scan(
232+
test_fgs: ZebraThreeDFastGridScan = i03.zebra_fast_grid_scan(
233233
connect_immediately=True, mock=True
234234
)
235235

@@ -247,7 +247,7 @@ def test_GIVEN_scan_already_valid_THEN_wait_for_GRIDSCAN_returns_immediately(
247247
def test_GIVEN_scan_not_valid_THEN_wait_for_GRIDSCAN_raises_and_sleeps_called(
248248
self, patch_sleep: MagicMock, RE: RunEngine
249249
):
250-
test_fgs: ZebraFastGridScan = i03.zebra_fast_grid_scan(
250+
test_fgs: ZebraThreeDFastGridScan = i03.zebra_fast_grid_scan(
251251
connect_immediately=True, mock=True
252252
)
253253

@@ -447,7 +447,7 @@ def test_kickoff_and_complete_gridscan_triggers_zocalo(
447447
RE: RunEngine,
448448
fake_fgs_composite: FlyScanEssentialDevices,
449449
dummy_rotation_data_collection_group_info,
450-
zebra_fast_grid_scan: ZebraFastGridScan,
450+
zebra_fast_grid_scan: ZebraThreeDFastGridScan,
451451
):
452452
id_1, id_2 = 100, 200
453453

tests/unit_tests/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from dodal.devices.backlight import Backlight
1616
from dodal.devices.detector.detector_motion import DetectorMotion
1717
from dodal.devices.eiger import EigerDetector
18-
from dodal.devices.fast_grid_scan import PandAFastGridScan, ZebraFastGridScan
18+
from dodal.devices.fast_grid_scan import PandAFastGridScan, ZebraThreeDFastGridScan
1919
from dodal.devices.flux import Flux
2020
from dodal.devices.i03 import Beamstop
2121
from dodal.devices.oav.oav_detector import OAV
@@ -396,7 +396,7 @@ def dummy_rotation_data_collection_group_info():
396396

397397
@pytest.fixture
398398
def beamline_specific(
399-
zebra_fast_grid_scan: ZebraFastGridScan,
399+
zebra_fast_grid_scan: ZebraThreeDFastGridScan,
400400
) -> BeamlineSpecificFGSFeatures:
401401
return BeamlineSpecificFGSFeatures(
402402
setup_trigger_plan=MagicMock(),
@@ -430,7 +430,7 @@ async def grid_detect_xrc_devices(
430430
ophyd_pin_tip_detection: PinTipDetection,
431431
zocalo: ZocaloResults,
432432
synchrotron: Synchrotron,
433-
fast_grid_scan: ZebraFastGridScan,
433+
fast_grid_scan: ZebraThreeDFastGridScan,
434434
s4_slit_gaps: S4SlitGaps,
435435
flux: Flux,
436436
zebra,

0 commit comments

Comments
 (0)