Skip to content

Commit e3ec09d

Browse files
authored
Roll back bluesky version (#1083)
* Revert "Update bluesky and pin pyright (#1072)" This reverts commit a3b1b8c. * Pin pyright version * Actually pin the version
1 parent a3b1b8c commit e3ec09d

22 files changed

+57
-65
lines changed

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ dependencies = [
1616
"click",
1717
"ophyd",
1818
"ophyd-async >= 0.9.0a2",
19-
"bluesky",
19+
"bluesky == 1.13.0",
2020
"pyepics",
2121
"dataclasses-json",
2222
"pillow",

src/dodal/devices/aperturescatterguard.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def load_positions_from_beamline_parameters(
123123
}
124124

125125

126-
class ApertureScatterguard(StandardReadable, Movable[ApertureValue], Preparable):
126+
class ApertureScatterguard(StandardReadable, Movable, Preparable):
127127
"""Move the aperture and scatterguard assembly in a safe way. There are two ways to
128128
interact with the device depending on if you want simplicity or move flexibility.
129129

src/dodal/devices/apple2_undulator.py

+8-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import abc
22
import asyncio
33
from dataclasses import dataclass
4-
from typing import Any, Generic, TypeVar
4+
from typing import Any
55

66
import numpy as np
77
from bluesky.protocols import Movable
@@ -21,8 +21,6 @@
2121

2222
from dodal.log import LOGGER
2323

24-
T = TypeVar("T")
25-
2624

2725
class UndulatorGateStatus(StrictEnum):
2826
OPEN = "Open"
@@ -101,7 +99,7 @@ async def estimate_motor_timeout(
10199
return abs((target_pos - cur_pos) * 2.0 / vel) + 1
102100

103101

104-
class SafeUndulatorMover(StandardReadable, Movable[T], Generic[T]):
102+
class SafeUndulatorMover(StandardReadable, Movable):
105103
"""A device that will check it's safe to move the undulator before moving it and
106104
wait for the undulator to be safe again before calling the move complete.
107105
"""
@@ -117,7 +115,7 @@ def __init__(self, set_move: SignalW, prefix: str, name: str = ""):
117115
super().__init__(name)
118116

119117
@AsyncStatus.wrap
120-
async def set(self, value: T) -> None:
118+
async def set(self, value) -> None:
121119
LOGGER.info(f"Setting {self.name} to {value}")
122120
await self.raise_if_cannot_move()
123121
await self._set_demand_positions(value)
@@ -127,7 +125,7 @@ async def set(self, value: T) -> None:
127125
await wait_for_value(self.gate, UndulatorGateStatus.CLOSE, timeout=timeout)
128126

129127
@abc.abstractmethod
130-
async def _set_demand_positions(self, value: T) -> None:
128+
async def _set_demand_positions(self, value) -> None:
131129
"""Set the demand positions on the device without actually hitting move."""
132130

133131
@abc.abstractmethod
@@ -141,7 +139,7 @@ async def raise_if_cannot_move(self) -> None:
141139
raise RuntimeError(f"{self.name} is already in motion.")
142140

143141

144-
class UndulatorGap(SafeUndulatorMover[float]):
142+
class UndulatorGap(SafeUndulatorMover):
145143
"""A device with a collection of epics signals to set Apple 2 undulator gap motion.
146144
Only PV used by beamline are added the full list is here:
147145
/dls_sw/work/R3.14.12.7/support/insertionDevice/db/IDGapVelocityControl.template
@@ -187,7 +185,7 @@ def __init__(self, prefix: str, name: str = ""):
187185
self.user_readback = epics_signal_r(float, prefix + "CURRGAPD")
188186
super().__init__(self.set_move, prefix, name)
189187

190-
async def _set_demand_positions(self, value: float) -> None:
188+
async def _set_demand_positions(self, value) -> None:
191189
await self.user_setpoint.set(str(value))
192190

193191
async def get_timeout(self) -> float:
@@ -236,7 +234,7 @@ def __init__(self, prefix: str, infix: str, name: str = ""):
236234
super().__init__(name=name)
237235

238236

239-
class UndulatorPhaseAxes(SafeUndulatorMover[Apple2PhasesVal]):
237+
class UndulatorPhaseAxes(SafeUndulatorMover):
240238
"""
241239
A collection of 4 phase Motor to make up the full id phase motion. We are using the diamond pv convention.
242240
e.g. top_outer == Q1
@@ -292,7 +290,7 @@ async def get_timeout(self) -> float:
292290
return np.max(timeouts)
293291

294292

295-
class UndulatorJawPhase(SafeUndulatorMover[float]):
293+
class UndulatorJawPhase(SafeUndulatorMover):
296294
"""
297295
A JawPhase movable, this is use for moving the jaw phase which is use to control the
298296
linear arbitrary polarisation but only one some of the beamline.

src/dodal/devices/attenuator/attenuator.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def __init__(self, prefix: str, name: str = "") -> None:
2929
super().__init__(name)
3030

3131

32-
class BinaryFilterAttenuator(ReadOnlyAttenuator, Movable[float]):
32+
class BinaryFilterAttenuator(ReadOnlyAttenuator, Movable):
3333
"""The attenuator will insert filters into the beam to reduce its transmission.
3434
In this attenuator, each filter can be in one of two states: IN or OUT
3535

src/dodal/devices/backlight.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class BacklightPosition(StrictEnum):
1515
OUT = "Out"
1616

1717

18-
class Backlight(StandardReadable, Movable[BacklightPosition]):
18+
class Backlight(StandardReadable, Movable):
1919
"""Simple device to trigger the pneumatic in/out."""
2020

2121
TIME_TO_MOVE_S = 1.0 # Tested using a stopwatch on the beamline 09/2024

src/dodal/devices/bimorph_mirror.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class BimorphMirrorStatus(StrictEnum):
4141
ERROR = "Error"
4242

4343

44-
class BimorphMirrorChannel(StandardReadable, Movable[float], EpicsDevice):
44+
class BimorphMirrorChannel(StandardReadable, Movable, EpicsDevice):
4545
"""Collection of PVs comprising a single bimorph channel.
4646
4747
Attributes:
@@ -66,7 +66,7 @@ async def set(self, value: float):
6666
await self.output_voltage.set(value)
6767

6868

69-
class BimorphMirror(StandardReadable, Movable[Mapping[int, float]]):
69+
class BimorphMirror(StandardReadable, Movable):
7070
"""Class to represent CAENels Bimorph Mirrors.
7171
7272
Attributes:

src/dodal/devices/hutch_shutter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ async def shutter_safe_to_operate(self) -> bool:
5555
return interlock_state == HUTCH_SAFE_FOR_OPERATIONS
5656

5757

58-
class HutchShutter(StandardReadable, Movable[ShutterDemand]):
58+
class HutchShutter(StandardReadable, Movable):
5959
"""Device to operate the hutch shutter.
6060
6161
When a demand is sent, the device should first check the hutch status \

src/dodal/devices/i10/i10_apple2.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def update_lookuptable(self):
175175
self._available_pol = list(self.lookup_tables["Gap"].keys())
176176

177177

178-
class I10Apple2PGM(StandardReadable, Movable[float]):
178+
class I10Apple2PGM(StandardReadable, Movable):
179179
"""
180180
Compound device to set both ID and PGM energy at the sample time,poly_deg
181181
@@ -211,7 +211,7 @@ async def set(self, value: float) -> None:
211211
)
212212

213213

214-
class I10Apple2Pol(StandardReadable, Movable[str]):
214+
class I10Apple2Pol(StandardReadable, Movable):
215215
"""
216216
Compound device to set polorisation of ID.
217217
"""
@@ -240,7 +240,7 @@ async def set(self, value: str) -> None:
240240
) # Move id to new polarisation
241241

242242

243-
class LinearArbitraryAngle(StandardReadable, Movable[SupportsFloat]):
243+
class LinearArbitraryAngle(StandardReadable, Movable):
244244
"""
245245
Device to set polorisation angle of the ID. Linear Arbitrary Angle (laa)
246246
is the direction of the magnetic field which can be change by varying the jaw_phase

src/dodal/devices/i19/shutter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class HutchState(str, Enum):
1818
INVALID = "INVALID"
1919

2020

21-
class HutchConditionalShutter(StandardReadable, Movable[ShutterDemand]):
21+
class HutchConditionalShutter(StandardReadable, Movable):
2222
""" I19-specific device to operate the hutch shutter.
2323
2424
This device evaluates the hutch state value to work out which of the two I19 \

src/dodal/devices/i24/pmac.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ async def trigger(self):
7171
await self.signal_ref().set(self.cmd_string, wait=True)
7272

7373

74-
class PMACStringLaser(Device, Movable[LaserSettings]):
74+
class PMACStringLaser(Device, Movable):
7575
"""Set the pmac_string to control the laser."""
7676

7777
def __init__(
@@ -90,7 +90,7 @@ async def set(
9090
await self._signal_ref().set(value.value)
9191

9292

93-
class PMACStringEncReset(Device, Movable[EncReset]):
93+
class PMACStringEncReset(Device, Movable):
9494
"""Set a pmac_string to control the encoder channels in the controller."""
9595

9696
def __init__(

src/dodal/devices/oav/oav_detector.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def _get_correct_zoom_string(zoom: str) -> str:
2929
return zoom
3030

3131

32-
class ZoomController(StandardReadable, Movable[str]):
32+
class ZoomController(StandardReadable, Movable):
3333
"""
3434
Device to control the zoom level. This should be set like
3535
o = OAV(name="oav")

src/dodal/devices/pressure_jump_cell.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class AllValvesControlState:
7676
valve_6: FastValveControlRequest | None = None
7777

7878

79-
class AllValvesControl(StandardReadable, Movable[AllValvesControlState]):
79+
class AllValvesControl(StandardReadable, Movable):
8080
"""
8181
valves 2, 4, 7, 8 are not controlled by the IOC,
8282
as they are under manual control.
@@ -151,9 +151,7 @@ async def set(self, value: AllValvesControlState):
151151
)
152152

153153

154-
class ValveControl(
155-
StandardReadable, Movable[ValveControlRequest | ValveOpenSeqRequest]
156-
):
154+
class ValveControl(StandardReadable, Movable):
157155
def __init__(self, prefix: str, name: str = "") -> None:
158156
with self.add_children_as_readables():
159157
self.close = epics_signal_rw(ValveControlRequest, prefix + ":CON")
@@ -172,9 +170,7 @@ def set(self, value: ValveControlRequest | ValveOpenSeqRequest) -> AsyncStatus:
172170
return set_status
173171

174172

175-
class FastValveControl(
176-
StandardReadable, Movable[FastValveControlRequest | ValveOpenSeqRequest]
177-
):
173+
class FastValveControl(StandardReadable, Movable):
178174
def __init__(self, prefix: str, name: str = "") -> None:
179175
with self.add_children_as_readables():
180176
self.close = epics_signal_rw(FastValveControlRequest, prefix + ":CON")

src/dodal/devices/robot.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ async def raise_if_error(self, raise_from: Exception):
5252
raise RobotLoadFailed(int(error_code), error_string) from raise_from
5353

5454

55-
class BartRobot(StandardReadable, Movable[SampleLocation]):
55+
class BartRobot(StandardReadable, Movable):
5656
"""The sample changing robot."""
5757

5858
# How long to wait for the robot if it is busy soaking/drying

src/dodal/devices/thawer.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from asyncio import Task, create_task, sleep
22

3-
from bluesky.protocols import Movable, Stoppable
3+
from bluesky.protocols import Stoppable
44
from ophyd_async.core import (
55
AsyncStatus,
66
Device,
@@ -21,18 +21,18 @@ class ThawerStates(StrictEnum):
2121
ON = "On"
2222

2323

24-
class ThawingTimer(Device, Stoppable, Movable[float]):
24+
class ThawingTimer(Device, Stoppable):
2525
def __init__(self, control_signal: SignalRW[ThawerStates]) -> None:
2626
self._control_signal_ref = Reference(control_signal)
2727
self._thawing_task: Task | None = None
2828
super().__init__("thaw_for_time_s")
2929

3030
@AsyncStatus.wrap
31-
async def set(self, value: float):
31+
async def set(self, time_to_thaw_for: float):
3232
await self._control_signal_ref().set(ThawerStates.ON)
3333
if self._thawing_task and not self._thawing_task.done():
3434
raise ThawingException("Thawing task already in progress")
35-
self._thawing_task = create_task(sleep(value))
35+
self._thawing_task = create_task(sleep(time_to_thaw_for))
3636
try:
3737
await self._thawing_task
3838
finally:

src/dodal/devices/undulator.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def _get_closest_gap_for_energy(
4646
return table[1][idx]
4747

4848

49-
class Undulator(StandardReadable, Movable[float]):
49+
class Undulator(StandardReadable, Movable):
5050
"""
5151
An Undulator-type insertion device, used to control photon emission at a given
5252
beam energy.

src/dodal/devices/undulator_dcm.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
ENERGY_TIMEOUT_S: float = 30.0
1313

1414

15-
class UndulatorDCM(StandardReadable, Movable[float]):
15+
class UndulatorDCM(StandardReadable, Movable):
1616
"""
1717
Composite device to handle changing beamline energies, wraps the Undulator and the
1818
DCM. The DCM has a motor which controls the beam energy, when it moves, the

src/dodal/devices/util/epics_util.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def call_func(func: Callable[[], StatusBase]) -> StatusBase:
114114
return func()
115115

116116

117-
class SetWhenEnabled(OphydAsyncDevice, Movable[int]):
117+
class SetWhenEnabled(OphydAsyncDevice, Movable):
118118
"""A device that sets the proc field of a PV when it becomes enabled."""
119119

120120
def __init__(self, name: str = "", prefix: str = ""):

src/dodal/devices/zebra/zebra.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from enum import Enum
55
from functools import partialmethod
66

7-
from bluesky.protocols import Movable
87
from ophyd_async.core import (
98
AsyncStatus,
109
DeviceVector,
@@ -75,7 +74,7 @@ class SoftInState(StrictEnum):
7574
NO = "No"
7675

7776

78-
class ArmingDevice(StandardReadable, Movable[ArmDemand]):
77+
class ArmingDevice(StandardReadable):
7978
"""A useful device that can abstract some of the logic of arming.
8079
Allows a user to just call arm.set(ArmDemand.ARM)"""
8180

@@ -95,8 +94,8 @@ async def _set_armed(self, demand: ArmDemand):
9594
return
9695

9796
@AsyncStatus.wrap
98-
async def set(self, value: ArmDemand):
99-
await asyncio.wait_for(self._set_armed(value), timeout=self.TIMEOUT)
97+
async def set(self, demand: ArmDemand):
98+
await asyncio.wait_for(self._set_armed(demand), timeout=self.TIMEOUT)
10099

101100

102101
class PositionCompare(StandardReadable):

src/dodal/devices/zebra/zebra_controlled_shutter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class ZebraShutterControl(StrictEnum):
1919
AUTO = "Auto"
2020

2121

22-
class ZebraShutter(StandardReadable, Movable[ZebraShutterState]):
22+
class ZebraShutter(StandardReadable, Movable):
2323
"""The shutter on most MX beamlines is controlled by the zebra.
2424
2525
Internally in the zebra there are two AND gates, one for manual control and one for

0 commit comments

Comments
 (0)