|
7 | 7 | Any, |
8 | 8 | NamedTuple, |
9 | 9 | Optional, |
| 10 | + TypedDict, |
10 | 11 | ) |
11 | 12 |
|
12 | 13 | import numpy as np |
@@ -51,6 +52,14 @@ def __eq__(self, _value: object) -> bool: |
51 | 52 | return self.config == _value |
52 | 53 | return super().__eq__(_value) |
53 | 54 |
|
| 55 | + if TYPE_CHECKING: |
| 56 | + |
| 57 | + class Kwargs(TypedDict, total=False): |
| 58 | + """Type for the kwargs passed to the channel.""" |
| 59 | + |
| 60 | + config: str |
| 61 | + group: str |
| 62 | + |
54 | 63 |
|
55 | 64 | class SLMImage(UseqModel): |
56 | 65 | """SLM Image in a MDA event. |
@@ -97,6 +106,15 @@ def __eq__(self, other: object) -> bool: |
97 | 106 | and np.array_equal(self.data, other.data) |
98 | 107 | ) |
99 | 108 |
|
| 109 | + if TYPE_CHECKING: |
| 110 | + |
| 111 | + class Kwargs(TypedDict, total=False): |
| 112 | + """Type for the kwargs passed to the SLM image.""" |
| 113 | + |
| 114 | + data: npt.ArrayLike |
| 115 | + device: Optional[str] |
| 116 | + exposure: Optional[float] |
| 117 | + |
100 | 118 |
|
101 | 119 | class PropertyTuple(NamedTuple): |
102 | 120 | """Three-tuple capturing a device, property, and value. |
@@ -244,3 +262,24 @@ def _validate_channel(cls, val: Any) -> Any: |
244 | 262 | _sx = field_serializer("x_pos", mode="plain")(_float_or_none) |
245 | 263 | _sy = field_serializer("y_pos", mode="plain")(_float_or_none) |
246 | 264 | _sz = field_serializer("z_pos", mode="plain")(_float_or_none) |
| 265 | + |
| 266 | + if TYPE_CHECKING: |
| 267 | + |
| 268 | + class Kwargs(TypedDict, total=False): |
| 269 | + """Type for the kwargs passed to the MDA event.""" |
| 270 | + |
| 271 | + index: dict[str, int] |
| 272 | + channel: Channel | Channel.Kwargs |
| 273 | + exposure: float |
| 274 | + min_start_time: float |
| 275 | + pos_name: str |
| 276 | + x_pos: float |
| 277 | + y_pos: float |
| 278 | + z_pos: float |
| 279 | + slm_image: SLMImage | SLMImage.Kwargs | npt.ArrayLike |
| 280 | + sequence: MDASequence | dict |
| 281 | + properties: list[tuple[str, str, Any]] |
| 282 | + metadata: dict |
| 283 | + action: AnyAction |
| 284 | + keep_shutter_open: bool |
| 285 | + reset_event_timer: bool |
0 commit comments