dls-dodal 1.65.0__py3-none-any.whl → 1.66.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 (59) hide show
  1. {dls_dodal-1.65.0.dist-info → dls_dodal-1.66.0.dist-info}/METADATA +3 -4
  2. {dls_dodal-1.65.0.dist-info → dls_dodal-1.66.0.dist-info}/RECORD +56 -50
  3. dodal/_version.py +2 -2
  4. dodal/beamlines/aithre.py +21 -2
  5. dodal/beamlines/i03.py +23 -3
  6. dodal/beamlines/i04.py +18 -3
  7. dodal/beamlines/i05.py +28 -1
  8. dodal/beamlines/i06.py +62 -0
  9. dodal/beamlines/i07.py +20 -0
  10. dodal/beamlines/i09_1.py +7 -2
  11. dodal/beamlines/i10_optics.py +18 -8
  12. dodal/beamlines/i18.py +3 -3
  13. dodal/beamlines/i22.py +3 -3
  14. dodal/beamlines/p38.py +3 -3
  15. dodal/devices/aithre_lasershaping/goniometer.py +26 -9
  16. dodal/devices/aperturescatterguard.py +3 -2
  17. dodal/devices/apple2_undulator.py +89 -44
  18. dodal/devices/areadetector/plugins/mjpg.py +10 -3
  19. dodal/devices/beamsize/__init__.py +0 -0
  20. dodal/devices/beamsize/beamsize.py +6 -0
  21. dodal/devices/detector/det_resolution.py +4 -2
  22. dodal/devices/fast_grid_scan.py +14 -2
  23. dodal/devices/i03/beamsize.py +35 -0
  24. dodal/devices/i03/constants.py +7 -0
  25. dodal/devices/i03/undulator_dcm.py +2 -2
  26. dodal/devices/i04/beamsize.py +45 -0
  27. dodal/devices/i04/murko_results.py +36 -26
  28. dodal/devices/i04/transfocator.py +23 -29
  29. dodal/devices/i07/id.py +38 -0
  30. dodal/devices/i09_1_shared/__init__.py +6 -2
  31. dodal/devices/i09_1_shared/hard_undulator_functions.py +85 -21
  32. dodal/devices/i10/i10_apple2.py +22 -316
  33. dodal/devices/i17/i17_apple2.py +7 -4
  34. dodal/devices/ipin.py +20 -2
  35. dodal/devices/motors.py +19 -3
  36. dodal/devices/mx_phase1/beamstop.py +31 -12
  37. dodal/devices/oav/oav_calculations.py +9 -4
  38. dodal/devices/oav/oav_detector.py +65 -7
  39. dodal/devices/oav/oav_parameters.py +3 -1
  40. dodal/devices/oav/oav_to_redis_forwarder.py +18 -15
  41. dodal/devices/oav/pin_image_recognition/__init__.py +5 -1
  42. dodal/devices/oav/pin_image_recognition/utils.py +23 -1
  43. dodal/devices/oav/snapshots/snapshot_with_grid.py +8 -2
  44. dodal/devices/oav/utils.py +16 -6
  45. dodal/devices/robot.py +17 -7
  46. dodal/devices/scintillator.py +36 -14
  47. dodal/devices/smargon.py +2 -3
  48. dodal/devices/thawer.py +7 -45
  49. dodal/devices/undulator.py +152 -68
  50. dodal/devices/util/lookup_tables_apple2.py +390 -0
  51. dodal/plans/load_panda_yaml.py +9 -0
  52. dodal/plans/verify_undulator_gap.py +2 -2
  53. dodal/beamline_specific_utils/i03.py +0 -17
  54. dodal/testing/__init__.py +0 -3
  55. dodal/testing/setup.py +0 -67
  56. {dls_dodal-1.65.0.dist-info → dls_dodal-1.66.0.dist-info}/WHEEL +0 -0
  57. {dls_dodal-1.65.0.dist-info → dls_dodal-1.66.0.dist-info}/entry_points.txt +0 -0
  58. {dls_dodal-1.65.0.dist-info → dls_dodal-1.66.0.dist-info}/licenses/LICENSE +0 -0
  59. {dls_dodal-1.65.0.dist-info → dls_dodal-1.66.0.dist-info}/top_level.txt +0 -0
@@ -3,12 +3,12 @@ from typing import Protocol, runtime_checkable
3
3
  from bluesky import plan_stubs as bps
4
4
 
5
5
  from dodal.devices.common_dcm import DoubleCrystalMonochromatorBase
6
- from dodal.devices.undulator import Undulator
6
+ from dodal.devices.undulator import UndulatorInKeV
7
7
 
8
8
 
9
9
  @runtime_checkable
10
10
  class CheckUndulatorDevices(Protocol):
11
- undulator: Undulator
11
+ undulator: UndulatorInKeV
12
12
  dcm: DoubleCrystalMonochromatorBase
13
13
 
14
14
 
@@ -1,17 +0,0 @@
1
- from dataclasses import dataclass
2
-
3
- I03_BEAM_HEIGHT_UM = 20.0
4
- I03_BEAM_WIDTH_UM = 80.0
5
-
6
-
7
- @dataclass
8
- class BeamSize:
9
- x_um: float | None
10
- y_um: float | None
11
-
12
-
13
- def beam_size_from_aperture(aperture_size: float | None):
14
- return BeamSize(
15
- min(aperture_size, I03_BEAM_WIDTH_UM) if aperture_size else None,
16
- I03_BEAM_HEIGHT_UM if aperture_size else None,
17
- )
dodal/testing/__init__.py DELETED
@@ -1,3 +0,0 @@
1
- from .setup import patch_all_motors, patch_motor
2
-
3
- __all__ = ["patch_motor", "patch_all_motors"]
dodal/testing/setup.py DELETED
@@ -1,67 +0,0 @@
1
- from contextlib import ExitStack
2
-
3
- from ophyd_async.core import Device
4
- from ophyd_async.epics.motor import Motor
5
- from ophyd_async.testing import (
6
- callback_on_mock_put,
7
- set_mock_value,
8
- )
9
-
10
-
11
- def patch_motor(
12
- motor: Motor,
13
- initial_position: float = 0,
14
- deadband: float = 0.001,
15
- velocity: float = 3,
16
- max_velocity: float = 5,
17
- low_limit_travel: float = float("-inf"),
18
- high_limit_travel: float = float("inf"),
19
- ):
20
- """
21
- Patch a mock motor with sensible default values so that it can still be used in
22
- tests and plans without running into errors as default values are zero.
23
-
24
- Parameters:
25
- motor: The mock motor to set mock values with.
26
- initial_position: The default initial position of the motor to be set.
27
- deadband: The tolerance between readback value and demand setpoint which the
28
- motor is considered at position.
29
- velocity: Requested move speed when the mock motor moves.
30
- max_velocity: The maximum allowable velocity that can be set for the motor.
31
- low_limit_travel: The lower limit that the motor can move to.
32
- high_limit_travel: The higher limit that the motor can move to.
33
- """
34
- set_mock_value(motor.user_setpoint, initial_position)
35
- set_mock_value(motor.user_readback, initial_position)
36
- set_mock_value(motor.deadband, deadband)
37
- set_mock_value(motor.motor_done_move, 1)
38
- set_mock_value(motor.velocity, velocity)
39
- set_mock_value(motor.max_velocity, max_velocity)
40
- set_mock_value(motor.low_limit_travel, low_limit_travel)
41
- set_mock_value(motor.high_limit_travel, high_limit_travel)
42
- return callback_on_mock_put(
43
- motor.user_setpoint,
44
- lambda pos, *args, **kwargs: set_mock_value(motor.user_readback, pos),
45
- )
46
-
47
-
48
- def patch_all_motors(parent_device: Device):
49
- """
50
- Check all children of a device and patch any motors with mock values.
51
-
52
- Parameters:
53
- parent_device: The device that hold motor(s) as children.
54
- """
55
- motors = []
56
-
57
- def recursively_find_motors(device: Device):
58
- for _, child_device in device.children():
59
- if isinstance(child_device, Motor):
60
- motors.append(child_device)
61
- recursively_find_motors(child_device)
62
-
63
- recursively_find_motors(parent_device)
64
- motor_patch_stack = ExitStack()
65
- for motor in motors:
66
- motor_patch_stack.enter_context(patch_motor(motor))
67
- return motor_patch_stack