jckantor / TCLab

Software support for the Temperature Control Laboratory.
Apache License 2.0
13 stars 22 forks source link

Make Labtime have instance properties instead of class properties #96

Closed alchemyst closed 6 years ago

alchemyst commented 6 years ago

I'm putting this in a separate branch and doing a pull request in case you have a compelling argument for using class variables instead of just instance variables for Labtime. These modifications work in all the notebooks which use labtime and all the tests pass.

If you think it is important to have only one set of times, it is also possible to modify the interface in such a way that doing Labtime() will always give you a reference to the tclab.labtime.labtime instance, but I can think of more cases where it may be useful to have different Labtime instances than where we need all instances to be synced. Since there is a simple way of getting the "standard" labtime instance (from tclab import labtime), I think this just makes everything simpler.

I've also slipped a lastsleep property which is useful when seeing how much time clock is spending in sleep as a first step toward allowing better feedback about how close we are to losing sync.