Skip to content

Commit ea3581a

Browse files
committed
Remove type annotations from enum types
These are flagged as an error by pyright as they fields have to be instances of the class.
1 parent 5b798c4 commit ea3581a

File tree

2 files changed

+46
-46
lines changed

2 files changed

+46
-46
lines changed

src/tickit_devices/eiger/eiger_schema.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import logging
22
from dataclasses import dataclass, field
3-
from enum import Enum
3+
from enum import StrEnum
44
from functools import partial
55
from typing import Any, Generic, List, Mapping, Optional, TypeVar
66

@@ -29,29 +29,29 @@ def field_config(**kwargs) -> Mapping[str, Any]:
2929
return dict(**kwargs)
3030

3131

32-
class AccessMode(Enum):
32+
class AccessMode(StrEnum):
3333
"""Possible access modes for field metadata."""
3434

35-
READ_ONLY: str = "r"
36-
WRITE_ONLY: str = "w"
37-
READ_WRITE: str = "rw"
35+
READ_ONLY = "r"
36+
WRITE_ONLY = "w"
37+
READ_WRITE = "rw"
3838

3939

40-
class ValueType(Enum):
40+
class ValueType(StrEnum):
4141
"""Possible value types for field metadata."""
4242

43-
FLOAT: str = "float"
44-
INT: str = "int"
45-
UINT: str = "uint"
46-
STRING: str = "string"
47-
STR_LIST: str = "string[]"
48-
BOOL: str = "bool"
49-
FLOAT_GRID: str = "float[][]"
50-
UINT_GRID: str = "uint[][]"
51-
DATE: str = "date"
52-
DATETIME: str = "datetime"
53-
NONE: str = "none"
54-
STATE: str = "State"
43+
FLOAT = "float"
44+
INT = "int"
45+
UINT = "uint"
46+
STRING = "string"
47+
STR_LIST = "string[]"
48+
BOOL = "bool"
49+
FLOAT_GRID = "float[][]"
50+
UINT_GRID = "uint[][]"
51+
DATE = "date"
52+
DATETIME = "datetime"
53+
NONE = "none"
54+
STATE = "State"
5555

5656

5757
#

src/tickit_devices/eiger/eiger_settings.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -24,34 +24,34 @@
2424
class KA_Energy(Enum):
2525
"""Possible element K-alpha energies for samples."""
2626

27-
Li: float = 54.3
28-
Be: float = 108.5
29-
B: float = 183.3
30-
C: float = 277.0
31-
N: float = 392.4
32-
O: float = 524.9
33-
F: float = 676.8
34-
Ne: float = 848.6
35-
Na: float = 1040.98
36-
Mg: float = 1253.6
37-
Al: float = 1486.7
38-
Si: float = 1739.98
39-
P: float = 2013.7
40-
S: float = 2307.84
41-
Cl: float = 2622.39
42-
Ar: float = 2957.7
43-
K: float = 3313.8
44-
Ca: float = 3691.68
45-
Sc: float = 4090.6
46-
Ti: float = 4510.84
47-
V: float = 4952.2
48-
Cr: float = 5414.72
49-
Mn: float = 5898.75
50-
Fe: float = 6403.84
51-
Co: float = 6930.32
52-
Ni: float = 7478.15
53-
Cu: float = 8047.78
54-
Zn: float = 8638.86
27+
Li = 54.3
28+
Be = 108.5
29+
B = 183.3
30+
C = 277.0
31+
N = 392.4
32+
O = 524.9
33+
F = 676.8
34+
Ne = 848.6
35+
Na = 1040.98
36+
Mg = 1253.6
37+
Al = 1486.7
38+
Si = 1739.98
39+
P = 2013.7
40+
S = 2307.84
41+
Cl = 2622.39
42+
Ar = 2957.7
43+
K = 3313.8
44+
Ca = 3691.68
45+
Sc = 4090.6
46+
Ti = 4510.84
47+
V = 4952.2
48+
Cr = 5414.72
49+
Mn = 5898.75
50+
Fe = 6403.84
51+
Co = 6930.32
52+
Ni = 7478.15
53+
Cu = 8047.78
54+
Zn = 8638.86
5555

5656

5757
@dataclass

0 commit comments

Comments
 (0)