freeze dataclasses

This commit is contained in:
Onyx and Iris 2025-01-15 10:21:22 +00:00
parent 01d5d9801c
commit 7ede9b1ef3

View File

@ -1,15 +1,16 @@
from dataclasses import dataclass from dataclasses import dataclass
@dataclass @dataclass(frozen=True)
class KindMap: class KindMap:
id_: str
def __str__(self) -> str: def __str__(self) -> str:
return self.id_ return self.id_
@dataclass @dataclass(frozen=True)
class X32KindMap(KindMap): class X32KindMap(KindMap):
id_: str
num_dca: int = 8 num_dca: int = 8
num_strip: int = 32 num_strip: int = 32
num_bus: int = 16 num_bus: int = 16
@ -19,28 +20,25 @@ class X32KindMap(KindMap):
num_headamp: int = 127 num_headamp: int = 127
@dataclass @dataclass(frozen=True)
class XR18KindMap(KindMap): class XR18KindMap(KindMap):
# note ch 17-18 defined as aux return # note ch 17-18 defined as aux return
id_: str
num_dca: int = 4 num_dca: int = 4
num_strip: int = 16 num_strip: int = 16
num_bus: int = 6 num_bus: int = 6
num_fx: int = 4 num_fx: int = 4
@dataclass @dataclass(frozen=True)
class XR16KindMap(KindMap): class XR16KindMap(KindMap):
id_: str
num_dca: int = 4 num_dca: int = 4
num_strip: int = 16 num_strip: int = 16
num_bus: int = 4 num_bus: int = 4
num_fx: int = 4 num_fx: int = 4
@dataclass @dataclass(frozen=True)
class XR12KindMap(KindMap): class XR12KindMap(KindMap):
id_: str
num_dca: int = 4 num_dca: int = 4
num_strip: int = 12 num_strip: int = 12
num_bus: int = 2 num_bus: int = 2
@ -60,4 +58,4 @@ def get(kind_id):
return _kinds[kind_id] return _kinds[kind_id]
all = list(kind for kind in _kinds.values()) all = list(_kinds.values())