Skip to content
This repository was archived by the owner on Sep 2, 2024. It is now read-only.
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
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
8 changes: 4 additions & 4 deletions src/hyperion/device_setup_plans/read_hardware_for_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/hyperion/experiment_plans/flyscan_xray_centre_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/hyperion/experiment_plans/robot_load_then_centre_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/hyperion/experiment_plans/rotation_scan_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions tests/system_tests/experiment_plans/test_plan_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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)
Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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],
Expand Down Expand Up @@ -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

Expand Down
15 changes: 10 additions & 5 deletions tests/unit_tests/experiment_plans/test_flyscan_xray_centre_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
},
)
Expand Down
4 changes: 2 additions & 2 deletions tests/unit_tests/external_interaction/callbacks/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down