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/i03.py CHANGED
@@ -2,6 +2,7 @@ from ophyd_async.fastcs.panda import HDFPanda
2
2
 
3
3
  from dodal.common.beamlines.beamline_parameters import get_beamline_parameters
4
4
  from dodal.common.beamlines.beamline_utils import (
5
+ device_factory,
5
6
  device_instantiation,
6
7
  get_path_provider,
7
8
  set_path_provider,
@@ -17,7 +18,6 @@ from dodal.devices.attenuator.attenuator import BinaryFilterAttenuator
17
18
  from dodal.devices.backlight import Backlight
18
19
  from dodal.devices.cryostream import CryoStream
19
20
  from dodal.devices.dcm import DCM
20
- from dodal.devices.detector import DetectorParams
21
21
  from dodal.devices.detector.detector_motion import DetectorMotion
22
22
  from dodal.devices.diamond_filter import DiamondFilter, I03Filters
23
23
  from dodal.devices.eiger import EigerDetector
@@ -49,7 +49,7 @@ from dodal.devices.zebra.zebra_constants_mapping import (
49
49
  from dodal.devices.zebra.zebra_controlled_shutter import ZebraShutter
50
50
  from dodal.devices.zocalo import ZocaloResults
51
51
  from dodal.log import set_beamline as set_log_beamline
52
- from dodal.utils import BeamlinePrefix, get_beamline_name, skip_device
52
+ from dodal.utils import BeamlinePrefix, get_beamline_name
53
53
 
54
54
  ZOOM_PARAMS_FILE = (
55
55
  "/dls_sw/i03/software/gda/configurations/i03-config/xml/jCameraManZoomLevels.xml"
@@ -69,81 +69,59 @@ I03_ZEBRA_MAPPING = ZebraMapping(
69
69
  AND_GATE_FOR_AUTO_SHUTTER=2,
70
70
  )
71
71
 
72
+ PREFIX = BeamlinePrefix(BL)
72
73
 
73
- def aperture_scatterguard(
74
- wait_for_connection: bool = True,
75
- fake_with_ophyd_sim: bool = False,
76
- ) -> ApertureScatterguard:
74
+
75
+ @device_factory()
76
+ def aperture_scatterguard() -> ApertureScatterguard:
77
77
  """Get the i03 aperture and scatterguard device, instantiate it if it hasn't already
78
78
  been. If this is called when already instantiated in i03, it will return the existing
79
79
  object.
80
80
  """
81
81
  params = get_beamline_parameters()
82
- return device_instantiation(
83
- device_factory=ApertureScatterguard,
84
- name="aperture_scatterguard",
85
- prefix="",
86
- wait=wait_for_connection,
87
- fake=fake_with_ophyd_sim,
82
+ return ApertureScatterguard(
83
+ prefix=PREFIX.beamline_prefix,
88
84
  loaded_positions=load_positions_from_beamline_parameters(params),
89
85
  tolerances=AperturePosition.tolerances_from_gda_params(params),
90
86
  )
91
87
 
92
88
 
93
- def attenuator(
94
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
95
- ) -> BinaryFilterAttenuator:
89
+ @device_factory()
90
+ def attenuator() -> BinaryFilterAttenuator:
96
91
  """Get the i03 attenuator device, instantiate it if it hasn't already been.
97
92
  If this is called when already instantiated in i03, it will return the existing object.
98
93
  """
99
- return device_instantiation(
100
- BinaryFilterAttenuator,
101
- "attenuator",
102
- "-EA-ATTN-01:",
103
- wait_for_connection,
104
- fake_with_ophyd_sim,
105
- )
94
+ return BinaryFilterAttenuator(f"{PREFIX.beamline_prefix}-EA-ATTN-01:")
106
95
 
107
96
 
108
- def beamstop(
109
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
110
- ) -> Beamstop:
97
+ @device_factory()
98
+ def beamstop() -> Beamstop:
111
99
  """Get the i03 beamstop device, instantiate it if it hasn't already been.
112
100
  If this is called when already instantiated in i03, it will return the existing object.
113
101
  """
114
- return device_instantiation(
115
- Beamstop,
116
- "beamstop",
117
- "-MO-BS-01:",
118
- wait_for_connection,
119
- fake_with_ophyd_sim,
102
+ return Beamstop(
103
+ prefix=f"{PREFIX.beamline_prefix}-MO-BS-01:",
104
+ name="beamstop",
120
105
  beamline_parameters=get_beamline_parameters(),
121
106
  )
122
107
 
123
108
 
124
- def dcm(wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False) -> DCM:
109
+ @device_factory()
110
+ def dcm() -> DCM:
125
111
  """Get the i03 DCM device, instantiate it if it hasn't already been.
126
112
  If this is called when already instantiated in i03, it will return the existing object.
127
113
  """
128
- return device_instantiation(
129
- DCM,
114
+ return DCM(
115
+ f"{PREFIX.beamline_prefix}-MO-DCM-01:",
130
116
  "dcm",
131
- "-MO-DCM-01:",
132
- wait_for_connection,
133
- fake_with_ophyd_sim,
134
117
  )
135
118
 
136
119
 
137
- @skip_device(lambda: BL == "s03")
138
- def vfm(
139
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
140
- ) -> FocusingMirrorWithStripes:
141
- return device_instantiation(
142
- device_factory=FocusingMirrorWithStripes,
120
+ @device_factory(skip=BL == "s03")
121
+ def vfm() -> FocusingMirrorWithStripes:
122
+ return FocusingMirrorWithStripes(
123
+ prefix=f"{PREFIX.beamline_prefix}-OP-VFM-01:",
143
124
  name="vfm",
144
- prefix="-OP-VFM-01:",
145
- wait=wait_for_connection,
146
- fake=fake_with_ophyd_sim,
147
125
  bragg_to_lat_lut_path=DAQ_CONFIGURATION_PATH
148
126
  + "/lookup/BeamLineEnergy_DCM_VFM_x_converter.txt",
149
127
  x_suffix="LAT",
@@ -151,439 +129,310 @@ def vfm(
151
129
  )
152
130
 
153
131
 
154
- @skip_device(lambda: BL == "s03")
155
- def mirror_voltages(
156
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
157
- ) -> MirrorVoltages:
158
- return device_instantiation(
159
- device_factory=MirrorVoltages,
132
+ @device_factory(skip=BL == "s03")
133
+ def mirror_voltages() -> MirrorVoltages:
134
+ return MirrorVoltages(
160
135
  name="mirror_voltages",
161
- prefix="-MO-PSU-01:",
162
- wait=wait_for_connection,
163
- fake=fake_with_ophyd_sim,
136
+ prefix=f"{PREFIX.beamline_prefix}-MO-PSU-01:",
164
137
  daq_configuration_path=DAQ_CONFIGURATION_PATH,
165
138
  )
166
139
 
167
140
 
168
- def backlight(
169
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
170
- ) -> Backlight:
141
+ @device_factory()
142
+ def backlight() -> Backlight:
171
143
  """Get the i03 backlight device, instantiate it if it hasn't already been.
172
144
  If this is called when already instantiated in i03, it will return the existing object.
173
145
  """
174
- return device_instantiation(
175
- device_factory=Backlight,
176
- name="backlight",
177
- prefix="",
178
- wait=wait_for_connection,
179
- fake=fake_with_ophyd_sim,
180
- )
146
+ return Backlight(prefix=PREFIX.beamline_prefix, name="backlight")
181
147
 
182
148
 
183
- @skip_device(lambda: BL == "s03")
184
- def detector_motion(
185
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
186
- ) -> DetectorMotion:
149
+ @device_factory(skip=BL == "s03")
150
+ def detector_motion() -> DetectorMotion:
187
151
  """Get the i03 detector motion device, instantiate it if it hasn't already been.
188
152
  If this is called when already instantiated in i03, it will return the existing object.
189
153
  """
190
- return device_instantiation(
191
- device_factory=DetectorMotion,
154
+ return DetectorMotion(
155
+ prefix=PREFIX.beamline_prefix,
192
156
  name="detector_motion",
193
- prefix="",
194
- wait=wait_for_connection,
195
- fake=fake_with_ophyd_sim,
196
157
  )
197
158
 
198
159
 
199
- @skip_device(lambda: BL == "s03")
200
- def eiger(
201
- wait_for_connection: bool = True,
202
- fake_with_ophyd_sim: bool = False,
203
- params: DetectorParams | None = None,
204
- ) -> EigerDetector:
160
+ @device_factory(skip=BL == "s03")
161
+ def eiger(mock: bool = False) -> EigerDetector:
205
162
  """Get the i03 Eiger device, instantiate it if it hasn't already been.
206
163
  If this is called when already instantiated in i03, it will return the existing object.
207
- If called with params, will update those params to the Eiger object.
208
164
  """
209
165
 
210
- def set_params(eiger: EigerDetector):
211
- if params is not None:
212
- eiger.set_detector_parameters(params)
213
-
214
166
  return device_instantiation(
215
167
  device_factory=EigerDetector,
216
168
  name="eiger",
217
169
  prefix="-EA-EIGER-01:",
218
- wait=wait_for_connection,
219
- fake=fake_with_ophyd_sim,
220
- post_create=set_params,
170
+ wait=False,
171
+ fake=mock,
221
172
  )
222
173
 
223
174
 
224
- def zebra_fast_grid_scan(
225
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
226
- ) -> ZebraFastGridScan:
175
+ @device_factory()
176
+ def zebra_fast_grid_scan() -> ZebraFastGridScan:
227
177
  """Get the i03 zebra_fast_grid_scan device, instantiate it if it hasn't already been.
228
178
  If this is called when already instantiated in i03, it will return the existing object.
229
179
  """
230
- return device_instantiation(
231
- device_factory=ZebraFastGridScan,
180
+ return ZebraFastGridScan(
181
+ prefix=f"{PREFIX.beamline_prefix}-MO-SGON-01:",
232
182
  name="zebra_fast_grid_scan",
233
- prefix="-MO-SGON-01:",
234
- wait=wait_for_connection,
235
- fake=fake_with_ophyd_sim,
236
183
  )
237
184
 
238
185
 
239
- def panda_fast_grid_scan(
240
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
241
- ) -> PandAFastGridScan:
186
+ @device_factory()
187
+ def panda_fast_grid_scan() -> PandAFastGridScan:
242
188
  """Get the i03 panda_fast_grid_scan device, instantiate it if it hasn't already been.
243
189
  If this is called when already instantiated in i03, it will return the existing object.
244
190
  This is used instead of the zebra_fast_grid_scan device when using the PandA.
245
191
  """
246
- return device_instantiation(
247
- device_factory=PandAFastGridScan,
192
+ return PandAFastGridScan(
193
+ prefix=f"{PREFIX.beamline_prefix}-MO-SGON-01:",
248
194
  name="panda_fast_grid_scan",
249
- prefix="-MO-SGON-01:",
250
- wait=wait_for_connection,
251
- fake=fake_with_ophyd_sim,
252
195
  )
253
196
 
254
197
 
255
- @skip_device(lambda: BL == "s03")
198
+ @device_factory(skip=BL == "s03")
256
199
  def oav(
257
- wait_for_connection: bool = True,
258
- fake_with_ophyd_sim: bool = False,
259
200
  params: OAVConfig | None = None,
260
201
  ) -> OAV:
261
202
  """Get the i03 OAV device, instantiate it if it hasn't already been.
262
203
  If this is called when already instantiated in i03, it will return the existing object.
263
204
  """
264
- return device_instantiation(
265
- OAV,
266
- "oav",
267
- "-DI-OAV-01:",
268
- wait_for_connection,
269
- fake_with_ophyd_sim,
205
+ return OAV(
206
+ prefix=f"{PREFIX.beamline_prefix}-DI-OAV-01:",
207
+ name="oav",
270
208
  config=params or OAVConfig(ZOOM_PARAMS_FILE, DISPLAY_CONFIG),
271
209
  )
272
210
 
273
211
 
274
- @skip_device(lambda: BL == "s03")
275
- def pin_tip_detection(
276
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
277
- ) -> PinTipDetection:
212
+ @device_factory(skip=BL == "s03")
213
+ def pin_tip_detection() -> PinTipDetection:
278
214
  """Get the i03 pin tip detection device, instantiate it if it hasn't already been.
279
215
  If this is called when already instantiated in i03, it will return the existing object.
280
216
  """
281
- return device_instantiation(
282
- PinTipDetection,
217
+ return PinTipDetection(
218
+ f"{PREFIX.beamline_prefix}-DI-OAV-01:",
283
219
  "pin_tip_detection",
284
- "-DI-OAV-01:",
285
- wait_for_connection,
286
- fake_with_ophyd_sim,
287
220
  )
288
221
 
289
222
 
290
- def smargon(
291
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
292
- ) -> Smargon:
223
+ @device_factory()
224
+ def smargon() -> Smargon:
293
225
  """Get the i03 Smargon device, instantiate it if it hasn't already been.
294
226
  If this is called when already instantiated in i03, it will return the existing object.
295
227
  """
296
- return device_instantiation(
297
- Smargon,
298
- "smargon",
299
- "-MO-SGON-01:",
300
- wait_for_connection,
301
- fake_with_ophyd_sim,
302
- )
228
+ return Smargon(f"{PREFIX.beamline_prefix}-MO-SGON-01:", "smargon")
303
229
 
304
230
 
305
- def s4_slit_gaps(
306
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
307
- ) -> S4SlitGaps:
231
+ @device_factory()
232
+ def s4_slit_gaps() -> S4SlitGaps:
308
233
  """Get the i03 s4_slit_gaps device, instantiate it if it hasn't already been.
309
234
  If this is called when already instantiated in i03, it will return the existing object.
310
235
  """
311
- return device_instantiation(
312
- S4SlitGaps,
236
+ return S4SlitGaps(
237
+ f"{PREFIX.beamline_prefix}-AL-SLITS-04:",
313
238
  "s4_slit_gaps",
314
- "-AL-SLITS-04:",
315
- wait_for_connection,
316
- fake_with_ophyd_sim,
317
239
  )
318
240
 
319
241
 
320
- @skip_device(lambda: BL == "s03")
321
- def synchrotron(
322
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
323
- ) -> Synchrotron:
242
+ @device_factory(skip=BL == "s03")
243
+ def synchrotron() -> Synchrotron:
324
244
  """Get the i03 synchrotron device, instantiate it if it hasn't already been.
325
245
  If this is called when already instantiated in i03, it will return the existing object.
326
246
  """
327
- return device_instantiation(
328
- Synchrotron,
329
- "synchrotron",
330
- "",
331
- wait_for_connection,
332
- fake_with_ophyd_sim,
333
- bl_prefix=False,
334
- )
247
+ return Synchrotron("", "synchrotron")
335
248
 
336
249
 
337
- def undulator(
338
- wait_for_connection: bool = True,
339
- fake_with_ophyd_sim: bool = False,
340
- daq_configuration_path: str | None = None,
341
- ) -> Undulator:
250
+ @device_factory()
251
+ def undulator(daq_configuration_path: str | None = None) -> Undulator:
342
252
  """Get the i03 undulator device, instantiate it if it hasn't already been.
343
253
  If this is called when already instantiated in i03, it will return the existing object.
344
254
  """
345
- return device_instantiation(
346
- Undulator,
347
- "undulator",
255
+ return Undulator(
348
256
  f"{BeamlinePrefix(BL).insertion_prefix}-MO-SERVC-01:",
349
- wait_for_connection,
350
- fake_with_ophyd_sim,
351
- bl_prefix=False,
257
+ name="undulator",
352
258
  # evaluate here not as parameter default to enable post-import mocking
353
259
  id_gap_lookup_table_path=f"{daq_configuration_path or DAQ_CONFIGURATION_PATH}/lookup/BeamLine_Undulator_toGap.txt",
354
260
  )
355
261
 
356
262
 
357
- def undulator_dcm(
358
- wait_for_connection: bool = True,
359
- fake_with_ophyd_sim: bool = False,
360
- daq_configuration_path: str | None = None,
361
- ) -> UndulatorDCM:
263
+ @device_factory()
264
+ def undulator_dcm(daq_configuration_path: str | None = None) -> UndulatorDCM:
362
265
  """Get the i03 undulator DCM device, instantiate it if it hasn't already been.
363
266
  If this is called when already instantiated in i03, it will return the existing object.
364
267
  """
365
- return device_instantiation(
366
- UndulatorDCM,
268
+ # evaluate here not as parameter default to enable post-import mocking
269
+ undulator_singleton = (
270
+ undulator(daq_configuration_path=daq_configuration_path)
271
+ if daq_configuration_path and daq_configuration_path != DAQ_CONFIGURATION_PATH
272
+ else undulator()
273
+ )
274
+ return UndulatorDCM(
367
275
  name="undulator_dcm",
368
- prefix="",
369
- wait=wait_for_connection,
370
- fake=fake_with_ophyd_sim,
371
- undulator=undulator(
372
- wait_for_connection,
373
- fake_with_ophyd_sim,
374
- daq_configuration_path=daq_configuration_path,
375
- ),
376
- dcm=dcm(wait_for_connection, fake_with_ophyd_sim),
377
- # evaluate here not as parameter default to enable post-import mocking
276
+ prefix=PREFIX.beamline_prefix,
277
+ undulator=undulator_singleton,
278
+ dcm=dcm(),
378
279
  daq_configuration_path=daq_configuration_path or DAQ_CONFIGURATION_PATH,
379
280
  )
380
281
 
381
282
 
382
- def zebra(wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False) -> Zebra:
283
+ @device_factory()
284
+ def zebra() -> Zebra:
383
285
  """Get the i03 zebra device, instantiate it if it hasn't already been.
384
286
  If this is called when already instantiated in i03, it will return the existing object.
385
287
  """
386
- return device_instantiation(
387
- Zebra,
388
- "zebra",
389
- "-EA-ZEBRA-01:",
390
- wait_for_connection,
391
- fake_with_ophyd_sim,
288
+ return Zebra(
289
+ name="zebra",
290
+ prefix=f"{PREFIX.beamline_prefix}-EA-ZEBRA-01:",
392
291
  mapping=I03_ZEBRA_MAPPING,
393
292
  )
394
293
 
395
294
 
396
- def xspress3mini(
397
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
398
- ) -> Xspress3:
295
+ @device_factory()
296
+ def xspress3mini() -> Xspress3:
399
297
  """Get the i03 Xspress3Mini device, instantiate it if it hasn't already been.
400
298
  If this is called when already instantiated in i03, it will return the existing object.
401
299
  """
402
- return device_instantiation(
403
- Xspress3,
300
+ return Xspress3(
301
+ f"{PREFIX.beamline_prefix}-EA-XSP3-01:",
404
302
  "xspress3mini",
405
- "-EA-XSP3-01:",
406
- wait_for_connection,
407
- fake_with_ophyd_sim,
408
303
  )
409
304
 
410
305
 
411
- def panda(
412
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
413
- ) -> HDFPanda:
306
+ @device_factory()
307
+ def panda() -> HDFPanda:
414
308
  """Get the i03 panda device, instantiate it if it hasn't already been.
415
309
  If this is called when already instantiated in i03, it will return the existing object.
416
310
  """
417
- return device_instantiation(
418
- HDFPanda,
419
- "panda",
420
- "-EA-PANDA-01:",
421
- wait_for_connection,
422
- fake_with_ophyd_sim,
311
+ return HDFPanda(
312
+ f"{PREFIX.beamline_prefix}-EA-PANDA-01:",
423
313
  path_provider=get_path_provider(),
314
+ name="panda",
424
315
  )
425
316
 
426
317
 
427
- @skip_device(lambda: BL == "s03")
428
- def sample_shutter(
429
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
430
- ) -> ZebraShutter:
318
+ @device_factory(skip=BL == "s03")
319
+ def sample_shutter() -> ZebraShutter:
431
320
  """Get the i03 sample shutter device, instantiate it if it hasn't already been.
432
321
  If this is called when already instantiated in i03, it will return the existing object.
433
322
  """
434
- return device_instantiation(
435
- ZebraShutter,
323
+ return ZebraShutter(
324
+ f"{PREFIX.beamline_prefix}-EA-SHTR-01:",
436
325
  "sample_shutter",
437
- "-EA-SHTR-01:",
438
- wait_for_connection,
439
- fake_with_ophyd_sim,
440
326
  )
441
327
 
442
328
 
443
- @skip_device(lambda: BL == "s03")
444
- def flux(wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False) -> Flux:
329
+ @device_factory(skip=BL == "s03")
330
+ def flux() -> Flux:
445
331
  """Get the i03 flux device, instantiate it if it hasn't already been.
446
332
  If this is called when already instantiated in i03, it will return the existing object.
447
333
  """
448
- return device_instantiation(
449
- Flux,
334
+ return Flux(
335
+ f"{PREFIX.beamline_prefix}-MO-FLUX-01:",
450
336
  "flux",
451
- "-MO-FLUX-01:",
452
- wait_for_connection,
453
- fake_with_ophyd_sim,
454
337
  )
455
338
 
456
339
 
457
- def xbpm_feedback(
458
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
459
- ) -> XBPMFeedback:
340
+ @device_factory()
341
+ def xbpm_feedback() -> XBPMFeedback:
460
342
  """Get the i03 XBPM feeback device, instantiate it if it hasn't already been.
461
343
  If this is called when already instantiated in i03, it will return the existing object.
462
344
  """
463
- return device_instantiation(
464
- XBPMFeedback,
345
+ return XBPMFeedback(
346
+ PREFIX.beamline_prefix,
465
347
  "xbpm_feedback",
466
- "",
467
- wait_for_connection,
468
- fake_with_ophyd_sim,
469
348
  )
470
349
 
471
350
 
472
- def zocalo(
473
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
474
- ) -> ZocaloResults:
351
+ @device_factory()
352
+ def zocalo() -> ZocaloResults:
475
353
  """Get the i03 ZocaloResults device, instantiate it if it hasn't already been.
476
354
  If this is called when already instantiated in i03, it will return the existing object.
477
355
  """
478
- return device_instantiation(
479
- ZocaloResults,
480
- "zocalo",
481
- "",
482
- wait_for_connection,
483
- fake_with_ophyd_sim,
356
+ return ZocaloResults(
357
+ name="zocalo",
358
+ prefix=PREFIX.beamline_prefix,
484
359
  )
485
360
 
486
361
 
487
- def robot(
488
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
489
- ) -> BartRobot:
362
+ @device_factory()
363
+ def robot() -> BartRobot:
490
364
  """Get the i03 robot device, instantiate it if it hasn't already been.
491
365
  If this is called when already instantiated in i03, it will return the existing object.
492
366
  """
493
- return device_instantiation(
494
- BartRobot,
367
+ return BartRobot(
495
368
  "robot",
496
- "-MO-ROBOT-01:",
497
- wait_for_connection,
498
- fake_with_ophyd_sim,
369
+ f"{PREFIX.beamline_prefix}-MO-ROBOT-01:",
499
370
  )
500
371
 
501
372
 
502
- def webcam(
503
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
504
- ) -> Webcam:
373
+ @device_factory()
374
+ def webcam() -> Webcam:
505
375
  """Get the i03 webcam, instantiate it if it hasn't already been.
506
376
  If this is called when already instantiated in i03, it will return the existing object.
507
377
  """
508
- return device_instantiation(
509
- Webcam,
378
+ return Webcam(
510
379
  "webcam",
511
- "",
512
- wait_for_connection,
513
- fake_with_ophyd_sim,
380
+ PREFIX.beamline_prefix,
514
381
  url="http://i03-webcam1/axis-cgi/jpg/image.cgi",
515
382
  )
516
383
 
517
384
 
518
- def thawer(
519
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
520
- ) -> Thawer:
385
+ @device_factory()
386
+ def thawer() -> Thawer:
521
387
  """Get the i03 thawer, instantiate it if it hasn't already been.
522
388
  If this is called when already instantiated in i03, it will return the existing object.
523
389
  """
524
- return device_instantiation(
525
- Thawer,
390
+ return Thawer(
391
+ f"{PREFIX.beamline_prefix}-EA-THAW-01",
526
392
  "thawer",
527
- "-EA-THAW-01",
528
- wait_for_connection,
529
- fake_with_ophyd_sim,
530
393
  )
531
394
 
532
395
 
533
- def lower_gonio(
534
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
535
- ) -> XYZPositioner:
396
+ @device_factory()
397
+ def lower_gonio() -> XYZPositioner:
536
398
  """Get the i03 lower gonio device, instantiate it if it hasn't already been.
537
399
  If this is called when already instantiated in i03, it will return the existing object.
538
400
  """
539
- return device_instantiation(
540
- XYZPositioner,
401
+ return XYZPositioner(
402
+ f"{PREFIX.beamline_prefix}-MO-GONP-01:",
541
403
  "lower_gonio",
542
- "-MO-GONP-01:",
543
- wait_for_connection,
544
- fake_with_ophyd_sim,
545
404
  )
546
405
 
547
406
 
548
- def cryo_stream(
549
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
550
- ) -> CryoStream:
407
+ @device_factory()
408
+ def cryo_stream() -> CryoStream:
551
409
  """Get the i03 cryostream device, instantiate it if it hasn't already been.
552
410
  If this is called when already instantiated in i03, it will return the existing object.
553
411
  """
554
- return device_instantiation(
555
- CryoStream,
412
+ return CryoStream(
413
+ PREFIX.beamline_prefix,
556
414
  "cryo_stream",
557
- "",
558
- wait_for_connection,
559
- fake_with_ophyd_sim,
560
415
  )
561
416
 
562
417
 
563
- def diamond_filter(
564
- wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
565
- ) -> DiamondFilter[I03Filters]:
418
+ @device_factory()
419
+ def diamond_filter() -> DiamondFilter[I03Filters]:
566
420
  """Get the i03 diamond filter device, instantiate it if it hasn't already been.
567
421
  If this is called when already instantiated in i03, it will return the existing object.
568
422
  """
569
- return device_instantiation(
570
- DiamondFilter[I03Filters],
571
- "diamond_filter",
572
- "-MO-FLTR-01:",
573
- wait_for_connection,
574
- fake_with_ophyd_sim,
423
+ return DiamondFilter[I03Filters](
424
+ prefix=f"{PREFIX.beamline_prefix}-MO-FLTR-01:",
425
+ name="diamond_filter",
575
426
  data_type=I03Filters,
576
427
  )
577
428
 
578
429
 
579
- def qbpm(wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False) -> QBPM:
430
+ @device_factory()
431
+ def qbpm() -> QBPM:
580
432
  """Get the i03 qbpm device, instantiate it if it hasn't already been.
581
433
  If this is called when already instantiated in i03, it will return the existing object.
582
434
  """
583
- return device_instantiation(
584
- QBPM,
435
+ return QBPM(
436
+ f"{PREFIX.beamline_prefix}-DI-QBPM-01:",
585
437
  "qbpm",
586
- "-DI-QBPM-01:",
587
- wait_for_connection,
588
- fake_with_ophyd_sim,
589
438
  )