dls-dodal 1.36.2__py3-none-any.whl → 1.37.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 (54) hide show
  1. {dls_dodal-1.36.2.dist-info → dls_dodal-1.37.0.dist-info}/METADATA +4 -4
  2. {dls_dodal-1.36.2.dist-info → dls_dodal-1.37.0.dist-info}/RECORD +54 -38
  3. {dls_dodal-1.36.2.dist-info → dls_dodal-1.37.0.dist-info}/WHEEL +1 -1
  4. dodal/_version.py +2 -2
  5. dodal/beamlines/i02_1.py +37 -0
  6. dodal/beamlines/i03.py +20 -3
  7. dodal/beamlines/i04.py +3 -3
  8. dodal/beamlines/i10.py +179 -7
  9. dodal/beamlines/i22.py +15 -0
  10. dodal/beamlines/i24.py +2 -2
  11. dodal/beamlines/p99.py +6 -2
  12. dodal/common/crystal_metadata.py +3 -3
  13. dodal/common/udc_directory_provider.py +3 -1
  14. dodal/devices/aperturescatterguard.py +3 -0
  15. dodal/devices/apple2_undulator.py +9 -9
  16. dodal/devices/{attenuator.py → attenuator/attenuator.py} +29 -1
  17. dodal/devices/attenuator/filter.py +11 -0
  18. dodal/devices/attenuator/filter_selections.py +72 -0
  19. dodal/devices/bimorph_mirror.py +151 -0
  20. dodal/devices/current_amplifiers/__init__.py +34 -0
  21. dodal/devices/current_amplifiers/current_amplifier.py +103 -0
  22. dodal/devices/current_amplifiers/current_amplifier_detector.py +109 -0
  23. dodal/devices/current_amplifiers/femto.py +143 -0
  24. dodal/devices/current_amplifiers/sr570.py +214 -0
  25. dodal/devices/current_amplifiers/struck_scaler_counter.py +79 -0
  26. dodal/devices/detector/det_dim_constants.py +15 -0
  27. dodal/devices/eiger_odin.py +3 -3
  28. dodal/devices/fast_grid_scan.py +8 -3
  29. dodal/devices/i03/beamstop.py +85 -0
  30. dodal/devices/i04/transfocator.py +67 -53
  31. dodal/devices/i10/i10_setting_data.py +3 -3
  32. dodal/devices/i10/mirrors.py +24 -0
  33. dodal/devices/i10/rasor/rasor_current_amp.py +72 -0
  34. dodal/devices/i10/rasor/rasor_motors.py +62 -0
  35. dodal/devices/i10/rasor/rasor_scaler_cards.py +12 -0
  36. dodal/devices/i10/slits.py +37 -0
  37. dodal/devices/i24/dual_backlight.py +1 -0
  38. dodal/devices/i24/focus_mirrors.py +12 -12
  39. dodal/devices/linkam3.py +2 -2
  40. dodal/devices/p99/sample_stage.py +2 -28
  41. dodal/devices/robot.py +2 -2
  42. dodal/devices/slits.py +29 -7
  43. dodal/devices/tetramm.py +16 -16
  44. dodal/devices/undulator_dcm.py +9 -11
  45. dodal/devices/util/test_utils.py +2 -2
  46. dodal/devices/xspress3/xspress3.py +3 -3
  47. dodal/devices/zebra.py +19 -14
  48. dodal/devices/zocalo/zocalo_interaction.py +2 -1
  49. dodal/devices/zocalo/zocalo_results.py +22 -2
  50. dodal/log.py +2 -2
  51. dodal/plans/wrapped.py +3 -3
  52. {dls_dodal-1.36.2.dist-info → dls_dodal-1.37.0.dist-info}/LICENSE +0 -0
  53. {dls_dodal-1.36.2.dist-info → dls_dodal-1.37.0.dist-info}/entry_points.txt +0 -0
  54. {dls_dodal-1.36.2.dist-info → dls_dodal-1.37.0.dist-info}/top_level.txt +0 -0
dodal/devices/zebra.py CHANGED
@@ -59,28 +59,33 @@ class TrigSource(StrictEnum):
59
59
 
60
60
 
61
61
  class EncEnum(StrictEnum):
62
- Enc1 = "Enc1"
63
- Enc2 = "Enc2"
64
- Enc3 = "Enc3"
65
- Enc4 = "Enc4"
66
- Enc1_4Av = "Enc1-4Av"
62
+ ENC1 = "Enc1"
63
+ ENC2 = "Enc2"
64
+ ENC3 = "Enc3"
65
+ ENC4 = "Enc4"
66
+ ENC1_4AV = "Enc1-4Av"
67
67
 
68
68
 
69
69
  class I03Axes:
70
- SMARGON_X1 = EncEnum.Enc1
71
- SMARGON_Y = EncEnum.Enc2
72
- SMARGON_Z = EncEnum.Enc3
73
- OMEGA = EncEnum.Enc4
70
+ SMARGON_X1 = EncEnum.ENC1
71
+ SMARGON_Y = EncEnum.ENC2
72
+ SMARGON_Z = EncEnum.ENC3
73
+ OMEGA = EncEnum.ENC4
74
74
 
75
75
 
76
76
  class I24Axes:
77
- VGON_Z = EncEnum.Enc1
78
- OMEGA = EncEnum.Enc2
79
- VGON_X = EncEnum.Enc3
80
- VGON_YH = EncEnum.Enc4
77
+ VGON_Z = EncEnum.ENC1
78
+ OMEGA = EncEnum.ENC2
79
+ VGON_X = EncEnum.ENC3
80
+ VGON_YH = EncEnum.ENC4
81
81
 
82
82
 
83
83
  class RotationDirection(StrictEnum):
84
+ """
85
+ Defines for a swept angle whether the scan width (sweep) is to be added or subtracted from
86
+ the initial angle to obtain the final angle.
87
+ """
88
+
84
89
  POSITIVE = "Positive"
85
90
  NEGATIVE = "Negative"
86
91
 
@@ -281,7 +286,7 @@ class LogicGateConfiguration:
281
286
  for input, (source, invert) in enumerate(
282
287
  zip(self.sources, self.invert, strict=False)
283
288
  ):
284
- input_strings.append(f"INP{input+1}={'!' if invert else ''}{source}")
289
+ input_strings.append(f"INP{input + 1}={'!' if invert else ''}{source}")
285
290
 
286
291
  return ", ".join(input_strings)
287
292
 
@@ -55,7 +55,8 @@ class ZocaloTrigger:
55
55
  intended to be used in bluesky callback classes. To get results from zocalo back
56
56
  into a plan, use the ZocaloResults ophyd device.
57
57
 
58
- see https://github.com/DiamondLightSource/dodal/wiki/How-to-Interact-with-Zocalo"""
58
+ see https://diamondlightsource.github.io/dodal/main/how-to/zocalo.html for
59
+ more information about zocalo."""
59
60
 
60
61
  def __init__(self, environment: str = ZOCALO_ENV):
61
62
  self.zocalo_environment: str = environment
@@ -11,7 +11,7 @@ import workflows.recipe
11
11
  import workflows.transport
12
12
  from bluesky.protocols import Triggerable
13
13
  from bluesky.utils import Msg
14
- from deepdiff import DeepDiff
14
+ from deepdiff.diff import DeepDiff
15
15
  from ophyd_async.core import (
16
16
  Array1D,
17
17
  AsyncStatus,
@@ -53,6 +53,26 @@ ZOCALO_STAGE_GROUP = "clear zocalo queue"
53
53
 
54
54
 
55
55
  class XrcResult(TypedDict):
56
+ """
57
+ Information about a diffracting centre.
58
+
59
+ NOTE: the coordinate systems of centre_of_mass and max_voxel/bounding_box are not
60
+ the same; centre_of_mass coordinates are continuous whereas max_voxel and bounding_box
61
+ coordinates are discrete.
62
+ Attributes:
63
+ centre_of_mass: The position of the centre of mass of the crystal, adjusted so that
64
+ grid box centres lie on integer grid coordinates, such that a 1x1x1 crystal detected in
65
+ a single grid box at 0, 0, 0, has c.o.m. of 0, 0, 0, not 0.5, 0.5, 0.5
66
+ max_voxel: Position of the voxel with the maximum count, in integer coordinates
67
+ max_count: max count achieved in a single voxel for the crystal
68
+ n_voxels: Number of voxels (aka grid boxes) in the diffracting centre
69
+ total_count: Total of above-threshold spot counts in the labelled voxels
70
+ bounding_box: The rectangular prism that bounds the crystal, expressed
71
+ as the volume of whole boxes as a half-open range i.e such that
72
+ p1 = (x1, y1, z1) <= p < p2 = (x2, y2, z2) and
73
+ p2 - p1 gives the dimensions in whole voxels.
74
+ """
75
+
56
76
  centre_of_mass: list[float]
57
77
  max_voxel: list[int]
58
78
  max_count: int
@@ -133,7 +153,7 @@ class ZocaloResults(StandardReadable, Triggerable):
133
153
  self.use_cpu_and_gpu = use_cpu_and_gpu
134
154
 
135
155
  self.centre_of_mass, self._com_setter = soft_signal_r_and_setter(
136
- Array1D[np.uint64], name="centre_of_mass"
156
+ Array1D[np.float64], name="centre_of_mass"
137
157
  )
138
158
  self.bounding_box, self._bounding_box_setter = soft_signal_r_and_setter(
139
159
  Array1D[np.uint64], name="bounding_box"
dodal/log.py CHANGED
@@ -152,7 +152,7 @@ def set_up_graylog_handler(logger: Logger, host: str, port: int):
152
152
  def set_up_INFO_file_handler(logger, path: Path, filename: str):
153
153
  """Set up a file handler for the logger, at INFO level, which will keep 30 days
154
154
  of logs, rotating once per day. Creates the directory if necessary."""
155
- print(f"Logging to INFO file handler {path/filename}")
155
+ print(f"Logging to INFO file handler {path / filename}")
156
156
  path.mkdir(parents=True, exist_ok=True)
157
157
  file_handler = TimedRotatingFileHandler(
158
158
  filename=path / filename, when="MIDNIGHT", backupCount=INFO_LOG_DAYS
@@ -169,7 +169,7 @@ def set_up_DEBUG_memory_handler(
169
169
  log file when it sees a message of severity ERROR. Creates the directory if
170
170
  necessary"""
171
171
  debug_path = path / "debug"
172
- print(f"Logging to DEBUG handler {debug_path/filename}")
172
+ print(f"Logging to DEBUG handler {debug_path / filename}")
173
173
  debug_path.mkdir(parents=True, exist_ok=True)
174
174
  file_handler = TimedRotatingFileHandler(
175
175
  filename=debug_path / filename, when="H", backupCount=DEBUG_LOG_FILES_TO_KEEP
dodal/plans/wrapped.py CHANGED
@@ -49,9 +49,9 @@ def count(
49
49
  Wraps bluesky.plans.count(det, num, delay, md=metadata) exposing only serializable
50
50
  parameters and metadata."""
51
51
  if isinstance(delay, Sequence):
52
- assert (
53
- len(delay) == num - 1
54
- ), f"Number of delays given must be {num - 1}: was given {len(delay)}"
52
+ assert len(delay) == num - 1, (
53
+ f"Number of delays given must be {num - 1}: was given {len(delay)}"
54
+ )
55
55
  metadata = metadata or {}
56
56
  metadata["shape"] = (num,)
57
57
  yield from bp.count(tuple(detectors), num, delay=delay, md=metadata)