fermi-ad / acsys-python

Python module to access the Fermilab Control System
MIT License
8 stars 4 forks source link

Use Data Classes to more easily manage our classes #31

Open beauremus opened 3 years ago

beauremus commented 3 years ago

Data Classes provide a simple and reliable way to implement a class with a standard set of features. Here's a demo, https://youtu.be/vBH6GRJ1REM.

This is dependent on a minimum Python version of 3.7.

rneswold commented 3 years ago

The video also mentions an attr package, which may work for Python 3.6.

beauremus commented 3 years ago

It’s rigorously tested on Python 2.7, 3.5+, and PyPy.

So let's explore using attrs. https://www.attrs.org/

rneswold commented 3 years ago

ItemData and ItemStatus are two classes that come to mind that might benefit from this. Maybe the event class in the SYNC library, too. I don't think DPM or DPMContext would benefit.