Lenty / SLiCAP_python

Open-source version of SLiCAP, implemented in python
Other
33 stars 15 forks source link

Changed the storage class 'device' to a frozen dataclass 'Device'. #47

Closed JokinSB closed 2 months ago

JokinSB commented 1 year ago

The class SLiCAPprotos.device is used as a record/struct, instantiated only to store data in the DEVICESdictionary. Better use a dataclass (less code, automatic __init__, __repr__ and __eq__). Set frozen=True as devices should be read-only. Option slots (to save memory) only available in Python 3.10+, so not used (yet).

File DEVICES.pp contains the pretty-printed DEVICES dictionary, for further use in testing.