dls-dodal 1.39.0__py3-none-any.whl → 1.41.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. {dls_dodal-1.39.0.dist-info → dls_dodal-1.41.0.dist-info}/METADATA +5 -3
  2. {dls_dodal-1.39.0.dist-info → dls_dodal-1.41.0.dist-info}/RECORD +61 -52
  3. {dls_dodal-1.39.0.dist-info → dls_dodal-1.41.0.dist-info}/WHEEL +1 -1
  4. dodal/_version.py +9 -4
  5. dodal/beamlines/__init__.py +2 -0
  6. dodal/beamlines/adsim.py +3 -2
  7. dodal/beamlines/b01_1.py +3 -3
  8. dodal/beamlines/i03.py +141 -292
  9. dodal/beamlines/i04.py +112 -198
  10. dodal/beamlines/i13_1.py +5 -4
  11. dodal/beamlines/i18.py +124 -0
  12. dodal/beamlines/i19_1.py +74 -0
  13. dodal/beamlines/i19_2.py +61 -0
  14. dodal/beamlines/i20_1.py +37 -22
  15. dodal/beamlines/i22.py +7 -7
  16. dodal/beamlines/i23.py +8 -11
  17. dodal/beamlines/i24.py +100 -145
  18. dodal/beamlines/p38.py +84 -220
  19. dodal/beamlines/p45.py +5 -4
  20. dodal/beamlines/training_rig.py +4 -4
  21. dodal/common/beamlines/beamline_utils.py +2 -3
  22. dodal/common/beamlines/device_helpers.py +3 -1
  23. dodal/devices/aperturescatterguard.py +150 -64
  24. dodal/devices/apple2_undulator.py +89 -114
  25. dodal/devices/attenuator/attenuator.py +1 -1
  26. dodal/devices/backlight.py +1 -1
  27. dodal/devices/bimorph_mirror.py +2 -2
  28. dodal/devices/eiger.py +3 -2
  29. dodal/devices/fast_grid_scan.py +26 -19
  30. dodal/devices/hutch_shutter.py +26 -13
  31. dodal/devices/i10/i10_apple2.py +3 -3
  32. dodal/devices/i10/rasor/rasor_scaler_cards.py +4 -4
  33. dodal/devices/i13_1/merlin.py +4 -3
  34. dodal/devices/i13_1/merlin_controller.py +2 -7
  35. dodal/devices/i18/KBMirror.py +19 -0
  36. dodal/devices/i18/diode.py +17 -0
  37. dodal/devices/i18/table.py +14 -0
  38. dodal/devices/i18/thor_labs_stage.py +12 -0
  39. dodal/devices/i19/__init__.py +0 -0
  40. dodal/devices/i19/shutter.py +57 -0
  41. dodal/devices/i22/nxsas.py +4 -4
  42. dodal/devices/i24/pmac.py +2 -2
  43. dodal/devices/motors.py +2 -2
  44. dodal/devices/oav/oav_detector.py +10 -19
  45. dodal/devices/pressure_jump_cell.py +43 -19
  46. dodal/devices/robot.py +31 -12
  47. dodal/devices/tetramm.py +8 -3
  48. dodal/devices/thawer.py +4 -4
  49. dodal/devices/turbo_slit.py +7 -6
  50. dodal/devices/undulator.py +1 -1
  51. dodal/devices/undulator_dcm.py +1 -1
  52. dodal/devices/util/epics_util.py +1 -1
  53. dodal/devices/zebra/zebra.py +4 -3
  54. dodal/devices/zebra/zebra_controlled_shutter.py +1 -1
  55. dodal/devices/zocalo/zocalo_results.py +21 -4
  56. dodal/plan_stubs/wrapped.py +10 -12
  57. dodal/plans/save_panda.py +30 -14
  58. dodal/utils.py +55 -21
  59. {dls_dodal-1.39.0.dist-info → dls_dodal-1.41.0.dist-info}/LICENSE +0 -0
  60. {dls_dodal-1.39.0.dist-info → dls_dodal-1.41.0.dist-info}/entry_points.txt +0 -0
  61. {dls_dodal-1.39.0.dist-info → dls_dodal-1.41.0.dist-info}/top_level.txt +0 -0
dodal/beamlines/p38.py CHANGED
@@ -4,12 +4,12 @@ from ophyd_async.epics.adaravis import AravisDetector
4
4
  from ophyd_async.fastcs.panda import HDFPanda
5
5
 
6
6
  from dodal.common.beamlines.beamline_utils import (
7
- device_instantiation,
7
+ device_factory,
8
8
  get_path_provider,
9
9
  set_path_provider,
10
10
  )
11
11
  from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
12
- from dodal.common.beamlines.device_helpers import numbered_slits
12
+ from dodal.common.beamlines.device_helpers import HDF5_SUFFIX
13
13
  from dodal.common.crystal_metadata import (
14
14
  MaterialsEnum,
15
15
  make_crystal_metadata_from_material,
@@ -25,9 +25,10 @@ from dodal.devices.tetramm import TetrammDetector
25
25
  from dodal.devices.undulator import Undulator
26
26
  from dodal.devices.watsonmarlow323_pump import WatsonMarlow323Pump
27
27
  from dodal.log import set_beamline as set_log_beamline
28
- from dodal.utils import BeamlinePrefix, get_beamline_name, skip_device
28
+ from dodal.utils import BeamlinePrefix, get_beamline_name
29
29
 
30
30
  BL = get_beamline_name("p38")
31
+ PREFIX = BeamlinePrefix(BL)
31
32
  set_log_beamline(BL)
32
33
  set_utils_beamline(BL)
33
34
 
@@ -45,63 +46,41 @@ set_path_provider(
45
46
  )
46
47
 
47
48
 
48
- def d3(
49
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
50
- ) -> AravisDetector:
51
- return device_instantiation(
52
- AravisDetector,
53
- "d3",
54
- "-DI-DCAM-01:",
55
- wait_for_connection,
56
- fake_with_ophyd_sim,
57
- drv_suffix="DET:",
58
- hdf_suffix="HDF5:",
49
+ @device_factory()
50
+ def d3() -> AravisDetector:
51
+ return AravisDetector(
52
+ f"{PREFIX.beamline_prefix}-DI-DCAM-01:",
59
53
  path_provider=get_path_provider(),
54
+ drv_suffix="DET:",
55
+ fileio_suffix=HDF5_SUFFIX,
60
56
  )
61
57
 
62
58
 
63
59
  # Disconnected
64
- @skip_device()
65
- def d11(
66
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
67
- ) -> AravisDetector:
68
- return device_instantiation(
69
- AravisDetector,
70
- "d11",
71
- "-DI-DCAM-03:",
72
- wait_for_connection,
73
- fake_with_ophyd_sim,
74
- drv_suffix="DET:",
75
- hdf_suffix="HDF5:",
60
+ @device_factory(skip=True)
61
+ def d11() -> AravisDetector:
62
+ return AravisDetector(
63
+ f"{PREFIX.beamline_prefix}-DI-DCAM-03:",
76
64
  path_provider=get_path_provider(),
65
+ drv_suffix="DET:",
66
+ fileio_suffix=HDF5_SUFFIX,
77
67
  )
78
68
 
79
69
 
80
- def d12(
81
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
82
- ) -> AravisDetector:
83
- return device_instantiation(
84
- AravisDetector,
85
- "d12",
86
- "-DI-DCAM-04:",
87
- wait_for_connection,
88
- fake_with_ophyd_sim,
89
- drv_suffix="DET:",
90
- hdf_suffix="HDF5:",
70
+ @device_factory()
71
+ def d12() -> AravisDetector:
72
+ return AravisDetector(
73
+ f"{PREFIX.beamline_prefix}-DI-DCAM-04:",
91
74
  path_provider=get_path_provider(),
75
+ drv_suffix="DET:",
76
+ fileio_suffix=HDF5_SUFFIX,
92
77
  )
93
78
 
94
79
 
95
- def i0(
96
- wait_for_connection: bool = True,
97
- fake_with_ophyd_sim: bool = False,
98
- ) -> TetrammDetector:
99
- return device_instantiation(
100
- TetrammDetector,
101
- "i0",
102
- "-EA-XBPM-01:",
103
- wait_for_connection,
104
- fake_with_ophyd_sim,
80
+ @device_factory()
81
+ def i0() -> TetrammDetector:
82
+ return TetrammDetector(
83
+ f"{PREFIX.beamline_prefix}-EA-XBPM-01:",
105
84
  path_provider=get_path_provider(),
106
85
  )
107
86
 
@@ -113,126 +92,60 @@ def i0(
113
92
  #
114
93
 
115
94
 
116
- def slits_1(
117
- wait_for_connection: bool = True,
118
- fake_with_ophyd_sim: bool = True,
119
- ) -> Slits:
120
- return numbered_slits(
121
- 1,
122
- wait_for_connection,
123
- fake_with_ophyd_sim,
124
- )
95
+ @device_factory(mock=True)
96
+ def slits_1() -> Slits:
97
+ return Slits(f"{PREFIX.beamline_prefix}-AL-SLITS-01:")
125
98
 
126
99
 
127
- def slits_2(
128
- wait_for_connection: bool = True,
129
- fake_with_ophyd_sim: bool = True,
130
- ) -> Slits:
131
- return numbered_slits(
132
- 2,
133
- wait_for_connection,
134
- fake_with_ophyd_sim,
135
- )
100
+ @device_factory(mock=True)
101
+ def slits_2() -> Slits:
102
+ return Slits(f"{PREFIX.beamline_prefix}-AL-SLITS-02:")
136
103
 
137
104
 
138
- def slits_3(
139
- wait_for_connection: bool = True,
140
- fake_with_ophyd_sim: bool = True,
141
- ) -> Slits:
142
- return numbered_slits(
143
- 3,
144
- wait_for_connection,
145
- fake_with_ophyd_sim,
146
- )
105
+ @device_factory(mock=True)
106
+ def slits_3() -> Slits:
107
+ return Slits(f"{PREFIX.beamline_prefix}-AL-SLITS-03:")
147
108
 
148
109
 
149
- def slits_4(
150
- wait_for_connection: bool = True,
151
- fake_with_ophyd_sim: bool = True,
152
- ) -> Slits:
153
- return numbered_slits(
154
- 4,
155
- wait_for_connection,
156
- fake_with_ophyd_sim,
157
- )
110
+ @device_factory(mock=True)
111
+ def slits_4() -> Slits:
112
+ return Slits(f"{PREFIX.beamline_prefix}-AL-SLITS-04:")
158
113
 
159
114
 
160
- def slits_5(
161
- wait_for_connection: bool = True,
162
- fake_with_ophyd_sim: bool = True,
163
- ) -> Slits:
164
- return numbered_slits(
165
- 5,
166
- wait_for_connection,
167
- fake_with_ophyd_sim,
168
- )
115
+ @device_factory(mock=True)
116
+ def slits_5() -> Slits:
117
+ return Slits(f"{PREFIX.beamline_prefix}-AL-SLITS-05:")
169
118
 
170
119
 
171
- def slits_6(
172
- wait_for_connection: bool = True,
173
- fake_with_ophyd_sim: bool = True,
174
- ) -> Slits:
175
- return numbered_slits(
176
- 6,
177
- wait_for_connection,
178
- fake_with_ophyd_sim,
179
- )
120
+ @device_factory(mock=True)
121
+ def slits_6() -> Slits:
122
+ return Slits(f"{PREFIX.beamline_prefix}-AL-SLITS-06:")
180
123
 
181
124
 
182
- def fswitch(
183
- wait_for_connection: bool = True,
184
- fake_with_ophyd_sim: bool = True,
185
- ) -> FSwitch:
186
- return device_instantiation(
187
- FSwitch,
188
- "fswitch",
189
- "-MO-FSWT-01:",
190
- wait_for_connection,
191
- fake_with_ophyd_sim,
125
+ @device_factory(mock=True)
126
+ def fswitch() -> FSwitch:
127
+ return FSwitch(
128
+ f"{PREFIX.beamline_prefix}-MO-FSWT-01:",
192
129
  lens_geometry="paraboloid",
193
130
  cylindrical=True,
194
131
  lens_material="Beryllium",
195
132
  )
196
133
 
197
134
 
198
- def vfm(
199
- wait_for_connection: bool = True,
200
- fake_with_ophyd_sim: bool = True,
201
- ) -> FocusingMirror:
202
- return device_instantiation(
203
- FocusingMirror,
204
- "vfm",
205
- "-OP-KBM-01:VFM:",
206
- wait_for_connection,
207
- fake_with_ophyd_sim,
208
- )
135
+ @device_factory(mock=True)
136
+ def vfm() -> FocusingMirror:
137
+ return FocusingMirror(f"{PREFIX.beamline_prefix}-OP-KBM-01:VFM:")
209
138
 
210
139
 
211
- def hfm(
212
- wait_for_connection: bool = True,
213
- fake_with_ophyd_sim: bool = True,
214
- ) -> FocusingMirror:
215
- return device_instantiation(
216
- FocusingMirror,
217
- "hfm",
218
- "-OP-KBM-01:HFM:",
219
- wait_for_connection,
220
- fake_with_ophyd_sim,
221
- )
140
+ @device_factory(mock=True)
141
+ def hfm() -> FocusingMirror:
142
+ return FocusingMirror(f"{PREFIX.beamline_prefix}-OP-KBM-01:HFM:")
222
143
 
223
144
 
224
- def dcm(
225
- wait_for_connection: bool = True,
226
- fake_with_ophyd_sim: bool = True,
227
- ) -> DoubleCrystalMonochromator:
228
- return device_instantiation(
229
- DoubleCrystalMonochromator,
230
- "dcm",
231
- f"{BeamlinePrefix(BL).beamline_prefix}-MO-DCM-01:",
232
- wait_for_connection,
233
- fake_with_ophyd_sim,
234
- bl_prefix=False,
235
- temperature_prefix=f"{BeamlinePrefix(BL).beamline_prefix}-DI-DCM-01:",
145
+ @device_factory(mock=True)
146
+ def dcm() -> DoubleCrystalMonochromator:
147
+ return DoubleCrystalMonochromator(
148
+ temperature_prefix=f"{PREFIX.beamline_prefix}-DI-DCM-01:",
236
149
  crystal_1_metadata=make_crystal_metadata_from_material(
237
150
  MaterialsEnum.Si, (1, 1, 1)
238
151
  ),
@@ -242,105 +155,56 @@ def dcm(
242
155
  )
243
156
 
244
157
 
245
- def undulator(
246
- wait_for_connection: bool = True,
247
- fake_with_ophyd_sim: bool = True,
248
- ) -> Undulator:
249
- return device_instantiation(
250
- Undulator,
251
- "undulator",
252
- f"{BeamlinePrefix(BL).insertion_prefix}-MO-SERVC-01:",
253
- wait_for_connection,
254
- fake_with_ophyd_sim,
255
- bl_prefix=False,
158
+ @device_factory(mock=True)
159
+ def undulator() -> Undulator:
160
+ return Undulator(
161
+ f"{PREFIX.insertion_prefix}-MO-SERVC-01:",
256
162
  poles=80,
257
163
  length=2.0,
258
164
  )
259
165
 
260
166
 
261
- # Must find which PandA IOC(s) are compatible
262
167
  # Must document what PandAs are physically connected to
263
168
  # See: https://github.com/bluesky/ophyd-async/issues/284
264
- @skip_device()
265
- def panda1(
266
- wait_for_connection: bool = True,
267
- fake_with_ophyd_sim: bool = False,
268
- ) -> HDFPanda:
269
- return device_instantiation(
270
- HDFPanda,
271
- "panda1",
272
- "-EA-PANDA-01:",
273
- wait_for_connection,
274
- fake_with_ophyd_sim,
169
+ @device_factory(skip=True)
170
+ def panda1() -> HDFPanda:
171
+ return HDFPanda(
172
+ f"{PREFIX.beamline_prefix}-EA-PANDA-01:",
275
173
  path_provider=get_path_provider(),
276
174
  )
277
175
 
278
176
 
279
- @skip_device()
280
- def panda2(
281
- wait_for_connection: bool = True,
282
- fake_with_ophyd_sim: bool = False,
283
- ) -> HDFPanda:
284
- return device_instantiation(
285
- HDFPanda,
286
- "panda2",
287
- "-EA-PANDA-02:",
288
- wait_for_connection,
289
- fake_with_ophyd_sim,
177
+ @device_factory(skip=True)
178
+ def panda2() -> HDFPanda:
179
+ return HDFPanda(
180
+ f"{PREFIX.beamline_prefix}-EA-PANDA-02:",
290
181
  path_provider=get_path_provider(),
291
182
  )
292
183
 
293
184
 
294
- @skip_device()
295
- def panda3(
296
- wait_for_connection: bool = True,
297
- fake_with_ophyd_sim: bool = False,
298
- ) -> HDFPanda:
299
- return device_instantiation(
300
- HDFPanda,
301
- "panda3",
302
- "-EA-PANDA-03:",
303
- wait_for_connection,
304
- fake_with_ophyd_sim,
185
+ @device_factory(skip=True)
186
+ def panda3() -> HDFPanda:
187
+ return HDFPanda(
188
+ f"{PREFIX.beamline_prefix}-EA-PANDA-03:",
305
189
  path_provider=get_path_provider(),
306
190
  )
307
191
 
308
192
 
309
- @skip_device()
310
- def linkam(
311
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
312
- ) -> Linkam3:
313
- return device_instantiation(
314
- Linkam3,
315
- "linkam",
316
- f"{BeamlinePrefix(BL).insertion_prefix}-EA-LINKM-02:",
317
- wait_for_connection,
318
- fake_with_ophyd_sim,
319
- )
193
+ @device_factory(skip=True)
194
+ def linkam() -> Linkam3:
195
+ return Linkam3(f"{PREFIX.beamline_prefix}-EA-LINKM-02:")
320
196
 
321
197
 
322
- def ppump(
323
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = True
324
- ) -> WatsonMarlow323Pump:
198
+ @device_factory()
199
+ def ppump() -> WatsonMarlow323Pump:
325
200
  """Peristaltic Pump"""
326
- return device_instantiation(
327
- WatsonMarlow323Pump,
328
- "ppump",
329
- "-EA-PUMP-01:",
330
- wait_for_connection,
331
- fake_with_ophyd_sim,
332
- )
201
+ return WatsonMarlow323Pump(f"{PREFIX.beamline_prefix}-EA-PUMP-01:")
333
202
 
334
203
 
335
- def high_pressure_xray_cell(
336
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
337
- ) -> PressureJumpCell:
338
- return device_instantiation(
339
- PressureJumpCell,
340
- "high_pressure_xray_cell",
341
- f"{BeamlinePrefix(BL).insertion_prefix}-EA",
342
- wait_for_connection,
343
- fake_with_ophyd_sim,
204
+ @device_factory()
205
+ def high_pressure_xray_cell() -> PressureJumpCell:
206
+ return PressureJumpCell(
207
+ f"{PREFIX.beamline_prefix}-EA",
344
208
  cell_prefix="-HPXC-01:",
345
209
  adc_prefix="-ADC",
346
210
  )
dodal/beamlines/p45.py CHANGED
@@ -9,6 +9,7 @@ from dodal.common.beamlines.beamline_utils import (
9
9
  set_path_provider,
10
10
  )
11
11
  from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
12
+ from dodal.common.beamlines.device_helpers import DET_SUFFIX, HDF5_SUFFIX
12
13
  from dodal.common.visit import StaticVisitPathProvider
13
14
  from dodal.devices.p45 import Choppers, TomoStageWithStretchAndSkew
14
15
  from dodal.log import set_beamline as set_log_beamline
@@ -60,8 +61,8 @@ def det(
60
61
  "-EA-MAP-01:",
61
62
  wait_for_connection,
62
63
  fake_with_ophyd_sim,
63
- drv_suffix="DET:",
64
- hdf_suffix="HDF5:",
64
+ drv_suffix=DET_SUFFIX,
65
+ fileio_suffix=HDF5_SUFFIX,
65
66
  path_provider=get_path_provider(),
66
67
  )
67
68
 
@@ -77,8 +78,8 @@ def diff(
77
78
  "-EA-DIFF-01:",
78
79
  wait_for_connection,
79
80
  fake_with_ophyd_sim,
80
- drv_suffix="DET:",
81
- hdf_suffix="HDF5:",
81
+ drv_suffix=DET_SUFFIX,
82
+ fileio_suffix=HDF5_SUFFIX,
82
83
  path_provider=get_path_provider(),
83
84
  )
84
85
 
@@ -9,7 +9,7 @@ from dodal.common.beamlines.beamline_utils import (
9
9
  set_path_provider,
10
10
  )
11
11
  from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
12
- from dodal.common.beamlines.device_helpers import HDF5_PREFIX
12
+ from dodal.common.beamlines.device_helpers import DET_SUFFIX, HDF5_SUFFIX
13
13
  from dodal.common.visit import LocalDirectoryServiceClient, StaticVisitPathProvider
14
14
  from dodal.devices.training_rig.sample_stage import TrainingRigSampleStage
15
15
  from dodal.log import set_beamline as set_log_beamline
@@ -34,7 +34,7 @@ set_utils_beamline(BL)
34
34
  set_path_provider(
35
35
  StaticVisitPathProvider(
36
36
  BL,
37
- Path("/data"),
37
+ Path("/exports/mybeamline/data/2025"),
38
38
  client=LocalDirectoryServiceClient(),
39
39
  )
40
40
  )
@@ -50,8 +50,8 @@ def det() -> AravisDetector:
50
50
  return AravisDetector(
51
51
  f"{PREFIX.beamline_prefix}-EA-DET-01:",
52
52
  path_provider=get_path_provider(),
53
- drv_suffix="DET:",
54
- hdf_suffix=HDF5_PREFIX,
53
+ drv_suffix=DET_SUFFIX,
54
+ fileio_suffix=HDF5_SUFFIX,
55
55
  )
56
56
 
57
57
 
@@ -13,7 +13,6 @@ from dodal.common.types import UpdatingPathProvider
13
13
  from dodal.utils import (
14
14
  AnyDevice,
15
15
  BeamlinePrefix,
16
- D,
17
16
  DeviceInitializationController,
18
17
  SkipType,
19
18
  skip_device,
@@ -141,8 +140,8 @@ def device_factory(
141
140
  SkipType,
142
141
  "mark the factory to be (conditionally) skipped when beamline is imported by external program",
143
142
  ] = False,
144
- ) -> Callable[[Callable[[], D]], DeviceInitializationController[D]]:
145
- def decorator(factory: Callable[[], D]) -> DeviceInitializationController[D]:
143
+ ) -> Callable[[Callable[[], T]], DeviceInitializationController[T]]:
144
+ def decorator(factory: Callable[[], T]) -> DeviceInitializationController[T]:
146
145
  return DeviceInitializationController(
147
146
  factory,
148
147
  use_factory_name,
@@ -2,7 +2,9 @@ from dodal.common.beamlines.beamline_utils import device_instantiation
2
2
  from dodal.devices.slits import Slits
3
3
  from dodal.utils import skip_device
4
4
 
5
- HDF5_PREFIX = "HDF5:"
5
+ HDF5_SUFFIX = "HDF5:"
6
+ CAM_SUFFIX = "CAM:"
7
+ DET_SUFFIX = "DET:"
6
8
 
7
9
 
8
10
  @skip_device()