Lenty / SLiCAP_python

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

Changed the storage class 'model' to a frozen dataclass 'Model'. #46

Closed JokinSB closed 2 months ago

JokinSB commented 1 year ago

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

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