|
7 | 7 | import traceback |
8 | 8 | from abc import ABC, abstractmethod |
9 | 9 | from dataclasses import dataclass |
10 | | -from typing import Annotated, Any, Callable, Generic, Literal, Type, TypeVar, cast |
| 10 | +from typing import Annotated, Any, Callable, ClassVar, Generic, Literal, Type, TypeVar, cast |
11 | 11 |
|
12 | 12 | import yaml |
13 | 13 | from pydantic import BaseModel, field_validator, model_validator |
@@ -59,7 +59,7 @@ class BeamlineStateConfig(BaseModel): |
59 | 59 | Base Configuration for a beamline state. |
60 | 60 | """ |
61 | 61 |
|
62 | | - state_type: str | None = "BeamlineState" |
| 62 | + state_type: ClassVar[str] = "BeamlineState" |
63 | 63 |
|
64 | 64 | name: Annotated[ |
65 | 65 | str, |
@@ -92,7 +92,7 @@ class DeviceStateConfig(BeamlineStateConfig): |
92 | 92 | Configuration for a device-based beamline state. |
93 | 93 | """ |
94 | 94 |
|
95 | | - state_type: str | None = "DeviceBeamlineState" |
| 95 | + state_type: ClassVar[str] = "DeviceBeamlineState" |
96 | 96 |
|
97 | 97 | device: Annotated[ |
98 | 98 | DeviceBase | str, |
@@ -157,7 +157,7 @@ class DeviceWithinLimitsStateConfig(DeviceStateConfig): |
157 | 157 | Configuration for a device within limits beamline state. |
158 | 158 | """ |
159 | 159 |
|
160 | | - state_type: str | None = "DeviceWithinLimitsState" |
| 160 | + state_type: ClassVar[str] = "DeviceWithinLimitsState" |
161 | 161 |
|
162 | 162 | low_limit: Annotated[ |
163 | 163 | float | None, |
@@ -248,7 +248,7 @@ class AggregatedStateConfig(BeamlineStateConfig): |
248 | 248 | Keys of the states dictionary are the labels of the different states. |
249 | 249 | """ |
250 | 250 |
|
251 | | - state_type: str | None = "AggregatedState" |
| 251 | + state_type: ClassVar[str] = "AggregatedState" |
252 | 252 |
|
253 | 253 | states: dict[str, SubDeviceStateConfig] |
254 | 254 |
|
|
0 commit comments