Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b23716b
Lock file maintenance
renovate[bot] Feb 5, 2026
c48ddfe
Remove wait from mapt_config
noemifrisina Feb 4, 2026
e765bab
Remove wait from backlight
noemifrisina Feb 4, 2026
1de1dcf
Fix linting
noemifrisina Feb 5, 2026
9834eee
Pin mysql-connector dependency
noemifrisina Feb 5, 2026
070e585
Update uv.lock
noemifrisina Feb 5, 2026
3f9f020
Remove all wait=True from set, no additional change needed as True is…
noemifrisina Feb 5, 2026
389f41b
Start fixing tests
noemifrisina Feb 5, 2026
c3e0eb2
Merge branch 'main' into renovate/lock-file-maintenance
noemifrisina Feb 5, 2026
0c5bd29
Fix a few more tests
noemifrisina Feb 5, 2026
1cd141d
Fix the obvious ones
noemifrisina Feb 5, 2026
bd0dc88
Missed change
noemifrisina Feb 6, 2026
2e10466
Remove wait=False from tetramm unstage
noemifrisina Feb 6, 2026
c91c0cf
Merge branch 'main' into renovate/lock-file-maintenance
noemifrisina Feb 6, 2026
af58a47
Fix for focusing mirror
rtuck99 Feb 9, 2026
5d9cc39
Fix for apple2 undulator
rtuck99 Feb 9, 2026
7c9a505
Fix bimporph tests
rtuck99 Feb 9, 2026
78692fb
Fix tetramm tests
rtuck99 Feb 9, 2026
0d3344d
Fix motor_util_plans tests
rtuck99 Feb 9, 2026
c2edebf
Fixup incorrect use of group parameter in configure_arm_trigger_and_d…
rtuck99 Feb 9, 2026
75b92a8
Merge remote-tracking branch 'origin/main' into renovate/lock-file-ma…
rtuck99 Feb 9, 2026
8997499
Fix robot unit tests
rtuck99 Feb 9, 2026
41aa1d8
Revert waits on plan stub calls in test_pmac
rtuck99 Feb 9, 2026
5cfbb29
Change to not wait on apple2
rtuck99 Feb 9, 2026
34b51e3
Move gap and phase sets into own async function
rtuck99 Feb 9, 2026
7ba8c48
Ensure task is reachable to prevent it being GC'd
rtuck99 Feb 9, 2026
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 pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,16 @@ dependencies = [
"requests",
"graypy",
"pydantic>=2.0",
"opencv-python-headless", # For pin-tip detection.
"opencv-python-headless", # For pin-tip detection.
"numpy",
"aiofiles",
"aiohttp",
"redis",
"scanspec>=0.7.3",
"pyzmq==27.1.0",
"deepdiff",
"daq-config-server>=v1.1.2", # For getting Configuration settings.
"daq-config-server>=v1.1.2", # For getting Configuration settings.
"mysql-connector-python == 9.5.0", # Can unpin once https://github.com/DiamondLightSource/ispyb-api/pull/244 is merged and released
]

dynamic = ["version"]
Expand Down Expand Up @@ -60,7 +61,7 @@ dev = [
"pytest-timeout",
"pytest-random-order",
"ruff",
"sphinx<7.4.6", # pinned due to https://github.com/sphinx-doc/sphinx/issues/12660
"sphinx<7.4.6", # pinned due to https://github.com/sphinx-doc/sphinx/issues/12660
"sphinx-autobuild",
"sphinx-copybutton",
"sphinxcontrib-mermaid",
Expand Down
2 changes: 1 addition & 1 deletion src/dodal/devices/areadetector/plugins/mjpg.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ async def _save_image(self, image: Image.Image):

await asyncio_save_image(image, path)

await self.last_saved_path.set(path, wait=True)
await self.last_saved_path.set(path)

@AsyncStatus.wrap
async def trigger(self):
Expand Down
2 changes: 1 addition & 1 deletion src/dodal/devices/beamlines/b07_1/ccmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ def _convert_pos_to_ev(self, pos_signal: ChannelCutMonochromatorPositions) -> fl

@AsyncStatus.wrap
async def set(self, value: ChannelCutMonochromatorPositions) -> None:
await self.crystal.set(value, wait=True)
await self.crystal.set(value)
2 changes: 1 addition & 1 deletion src/dodal/devices/beamlines/i11/nx100robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ async def set(self, sample_location: int) -> None:
LOGGER.info(f"Robot already at position {sample_location}")
else:
await self.clear_sample(table_in=False)
await self.next_sample_position.set(sample_location, wait=True)
await self.next_sample_position.set(sample_location)
await self.load_sample(sample_location)
await self.current_sample_position.set(sample_location)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import asyncio
import json
from enum import Enum
from enum import StrEnum
from typing import TypeVar

from aiohttp import ClientSession
Expand All @@ -15,7 +15,7 @@
D = TypeVar("D")


class HutchState(str, Enum):
class HutchState(StrEnum):
EH1 = "EH1"
EH2 = "EH2"

Expand Down
2 changes: 1 addition & 1 deletion src/dodal/devices/beamlines/i19/backlight.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ def __init__(self, prefix: str, name: str = "") -> None:

@AsyncStatus.wrap
async def set(self, value: InOutUpper):
await self.position.set(value, wait=True)
await self.position.set(value)
2 changes: 1 addition & 1 deletion src/dodal/devices/beamlines/i19/pin_col_stages.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ async def _safe_move_in(self, value: _PinColPosition):
LOGGER.info(
f"Moving pinhole and collimator stages to in position: {value.value}"
)
await self.mapt.configuration.select_config.set(value, wait=True)
await self.mapt.configuration.select_config.set(value)
# NOTE. The apply PV will not be used here unless fixed in controls first.
# This is to avoid collisions. A safe move in will move first the pinhole stage
# and then the collimator stage, but apply will try to move all the motors
Expand Down
6 changes: 3 additions & 3 deletions src/dodal/devices/beamlines/i24/dual_backlight.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __init__(self, prefix: str, name: str = "") -> None:

@AsyncStatus.wrap
async def set(self, value: BacklightPositions):
await self.pos_level.set(value, wait=True)
await self.pos_level.set(value)


class DualBacklight(StandardReadable):
Expand Down Expand Up @@ -54,6 +54,6 @@ def __init__(self, prefix: str, name: str = "") -> None:
async def set(self, value: BacklightPositions):
await self.backlight_position.set(value)
if value == BacklightPositions.OUT:
await self.backlight_state.set(OnOffUpper.OFF, wait=True)
await self.backlight_state.set(OnOffUpper.OFF)
else:
await self.backlight_state.set(OnOffUpper.ON, wait=True)
await self.backlight_state.set(OnOffUpper.ON)
14 changes: 7 additions & 7 deletions src/dodal/devices/beamlines/i24/pmac.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from asyncio import sleep
from enum import Enum, IntEnum
from enum import IntEnum, StrEnum

from bluesky.protocols import Flyable, Movable, Triggerable
from ophyd_async.core import (
Expand Down Expand Up @@ -27,7 +27,7 @@ class ScanState(IntEnum):
DONE = 0


class LaserSettings(str, Enum):
class LaserSettings(StrEnum):
"""PMAC strings to switch laser on and off.
Note. On the PMAC, M-variables usually have to do with position compare
set up.
Expand All @@ -42,7 +42,7 @@ class LaserSettings(str, Enum):
LASER_2_OFF = " M812=0 M811=1"


class EncReset(str, Enum):
class EncReset(StrEnum):
"""PMAC strings for position compare on encoder channels in the controller.

For example, for ENC5::
Expand Down Expand Up @@ -72,7 +72,7 @@ def __init__(

@AsyncStatus.wrap
async def trigger(self):
await self.signal_ref().set(self.cmd_string, wait=True)
await self.signal_ref().set(self.cmd_string)


class PMACStringLaser(Device, Movable[LaserSettings]):
Expand Down Expand Up @@ -147,7 +147,7 @@ async def kickoff(self):
wait for the scan status PV to go to 1.
"""
prog_num_str = await self._get_prog_number_string()
await self._signal_ref().set(prog_num_str, wait=True)
await self._signal_ref().set(prog_num_str)
await wait_for_value(
self._status_ref(),
ScanState.RUNNING,
Expand Down Expand Up @@ -185,9 +185,9 @@ def __init__(

@AsyncStatus.wrap
async def trigger(self):
await self._signal_ref().set("A", wait=True)
await self._signal_ref().set("A")
await sleep(1.0) # TODO Check with scientist what this sleep is really for.
await self._signal_ref().set("P2401=0", wait=True)
await self._signal_ref().set("P2401=0")
await wait_for_value(
self._status_ref(),
ScanState.DONE,
Expand Down
2 changes: 1 addition & 1 deletion src/dodal/devices/eurotherm.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def __init__(
@AsyncStatus.wrap
async def set(self, value: float):
"""Set the blower to a specific temperature."""
await self.setpoint.set(value, wait=True)
await self.setpoint.set(value)

async def locate(self) -> Location[float]:
setpoint = await self.setpoint.get_value()
Expand Down
2 changes: 1 addition & 1 deletion src/dodal/devices/focusing_mirror.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ async def set(self, value, *args, **kwargs):
)
# discard the current value (OK) so we can await a subsequent change
await anext(demand_accepted_iterator)
set_status = setpoint_v.set(value, wait=False)
set_status = setpoint_v.set(value)

# The set should always change to SLEW regardless of whether we are
# already at the set point, then change back to OK/FAIL depending on
Expand Down
6 changes: 3 additions & 3 deletions src/dodal/devices/hutch_shutter.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ async def set(self, value: ShutterDemand):
raise ShutterNotSafeToOperateError(
"The hutch has not been locked, not operating shutter."
)
await self.control.set(ShutterDemand.RESET, wait=True)
await self.control.set(value, wait=True)
await self.control.set(ShutterDemand.RESET)
await self.control.set(value)
return await wait_for_value(
self.status, match=ShutterState.OPEN, timeout=DEFAULT_TIMEOUT
)
else:
await self.control.set(value, wait=True)
await self.control.set(value)
return await wait_for_value(
self.status, match=ShutterState.CLOSED, timeout=DEFAULT_TIMEOUT
)
Expand Down
17 changes: 12 additions & 5 deletions src/dodal/devices/insertion_device/apple2_undulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ async def set(self, new_position: float, timeout=DEFAULT_TIMEOUT):
timeout = await self.get_timeout()
LOGGER.info(f"Moving {self.name} to {new_position} with timeout = {timeout}")

await self.set_move.set(value=1, wait=True, timeout=timeout)
await self.set_move.set(value=1, timeout=timeout)
move_status = AsyncStatus(
wait_for_value(self.gate, UndulatorGateStatus.CLOSE, timeout=timeout)
)
Expand Down Expand Up @@ -397,10 +397,17 @@ async def set(self, id_motor_values: Apple2Val) -> None:
LOGGER.info(
f"Moving {self.name} apple2 motors to {id_motor_values}, timeout = {timeout}"
)
await asyncio.gather(
self.gap().set_move.set(value=1, wait=False, timeout=timeout),
self.phase().set_move.set(value=1, wait=False, timeout=timeout),
)

async def initiate_moves():
await asyncio.gather(
self.gap().set_move.set(value=1, timeout=timeout),
self.phase().set_move.set(value=1, timeout=timeout),
)
LOGGER.info("Gap and phase set_move()s completed.")

# assign the task to prevent GC killing it
self._move_task = asyncio.create_task(initiate_moves())

await wait_for_value(
self.gap().gate, UndulatorGateStatus.CLOSE, timeout=timeout
)
4 changes: 2 additions & 2 deletions src/dodal/devices/oav/oav_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ async def set(self, value: str) -> None:
if value != "1.0x":
raise Exception("Attempting to set zoom level of a null zoom controller")
else:
await self.level.set(value, wait=True)
await self.level.set(value)


class BeamCentreForZoom(StandardReadable):
Expand Down Expand Up @@ -114,7 +114,7 @@ def __init__(self, prefix: str, name: str = "") -> None:

@AsyncStatus.wrap
async def set(self, value: str):
await self.level.set(value, wait=True)
await self.level.set(value)
LOGGER.info(
f"Waiting {self.DELAY_BETWEEN_MOTORS_AND_IMAGE_UPDATING_S} seconds for zoom to be noticeable"
)
Expand Down
4 changes: 2 additions & 2 deletions src/dodal/devices/oav/snapshots/snapshot_with_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ async def post_processing(self, image: Image):
)

path = path_join(directory_str, f"{filename_str}_outer_overlay.{IMG_FORMAT}")
await self.last_path_outer.set(path, wait=True)
await self.last_path_outer.set(path)
LOGGER.info(f"Saving grid outer edge at {path}")
await asyncio_save_image(image, path)

Expand All @@ -59,6 +59,6 @@ async def post_processing(self, image: Image):
)

path = path_join(directory_str, f"{filename_str}_grid_overlay.{IMG_FORMAT}")
await self.last_path_full_overlay.set(path, wait=True)
await self.last_path_full_overlay.set(path)
LOGGER.info(f"Saving full grid overlay at {path}")
await asyncio_save_image(image, path)
6 changes: 3 additions & 3 deletions src/dodal/devices/synchrotron.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from enum import Enum
from enum import StrEnum

from ophyd_async.core import (
StandardReadable,
Expand All @@ -9,13 +9,13 @@
from ophyd_async.epics.core import epics_signal_r


class Prefix(str, Enum):
class Prefix(StrEnum):
STATUS = "CS-CS-MSTAT-01:"
TOP_UP = "SR-CS-FILL-01:"
SIGNAL = "SR-DI-DCCT-01:"


class Suffix(str, Enum):
class Suffix(StrEnum):
SIGNAL = "SIGNAL"
MODE = "MODE"
USER_COUNTDOWN = "USERCOUNTDN"
Expand Down
2 changes: 1 addition & 1 deletion src/dodal/devices/tetramm.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ async def wait_for_idle(self):

async def unstage(self):
LOGGER.info("Unstaging TetrAMM")
await self._file_io.acquire.set(False, wait=False)
await self._file_io.acquire.set(False)

async def disarm(self):
# We can't use caput callback as we already used it in arm() and we can't have
Expand Down
6 changes: 3 additions & 3 deletions src/dodal/devices/zocalo/zocalo_results.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import asyncio
from collections.abc import Generator, Sequence
from enum import Enum
from enum import StrEnum
from queue import Empty, Queue
from typing import Any, TypedDict

Expand Down Expand Up @@ -32,13 +32,13 @@ class NoZocaloSubscriptionError(Exception):
pass


class SortKeys(str, Enum):
class SortKeys(StrEnum):
max_count = "max_count"
total_count = "total_count"
n_voxels = "n_voxels"


class ZocaloSource(str, Enum):
class ZocaloSource(StrEnum):
CPU = "CPU"
GPU = "GPU"

Expand Down
4 changes: 2 additions & 2 deletions src/dodal/plans/bimorph.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from collections.abc import Generator
from dataclasses import dataclass
from enum import Enum
from enum import StrEnum
from typing import Any

import bluesky.plan_stubs as bps
Expand All @@ -14,7 +14,7 @@
from dodal.devices.slits import Slits


class SlitDimension(str, Enum):
class SlitDimension(StrEnum):
"""Enum representing the dimensions of a 2d slit.

Used to describe which dimension the pencil beam scan should move across.
Expand Down
16 changes: 10 additions & 6 deletions src/dodal/plans/configure_arm_trigger_and_disarm_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,20 +133,24 @@ def set_mx_settings_pvs(
detector_params.detector_distance
)

yield from bps.abs_set(eiger.drv.detector.beam_center_x, beam_x_pixels, group)
yield from bps.abs_set(eiger.drv.detector.beam_center_y, beam_y_pixels, group)
yield from bps.abs_set(eiger.drv.detector.beam_center_x, beam_x_pixels, group=group)
yield from bps.abs_set(eiger.drv.detector.beam_center_y, beam_y_pixels, group=group)
yield from bps.abs_set(
eiger.drv.detector.detector_distance, detector_params.detector_distance, group
eiger.drv.detector.detector_distance,
detector_params.detector_distance,
group=group,
)

yield from bps.abs_set(
eiger.drv.detector.omega_start, detector_params.omega_start, group
eiger.drv.detector.omega_start, detector_params.omega_start, group=group
)
yield from bps.abs_set(
eiger.drv.detector.omega_increment, detector_params.omega_increment, group
eiger.drv.detector.omega_increment, detector_params.omega_increment, group=group
)
yield from bps.abs_set(
eiger.drv.detector.photon_energy, detector_params.expected_energy_ev, group
eiger.drv.detector.photon_energy,
detector_params.expected_energy_ev,
group=group,
)

if wait:
Expand Down
2 changes: 1 addition & 1 deletion tests/devices/beamlines/i03/test_undulator_dcm.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ async def test_dcm_offset_only_set_when_energy_set_completes(
offset_put.assert_not_called()
release_undulator.set()
await asyncio.wait_for(status, timeout=1)
offset_put.assert_called_with(25.6, wait=True)
offset_put.assert_called_with(25.6)


async def test_energy_set_only_complete_when_all_statuses_are_finished(
Expand Down
Loading