Closed billtubbs closed 5 years ago
Is there a reason why the Q1 and Q2 attributes were not set up as straight-forward properties?
I was expecting something like this:
@property def Q1(self): """Get TCLab heater power Q1.""" return self.send_and_receive('R1', float) @Q1.setter def Q1(self, val): """Set TCLab heater power Q1 (limited to 0-100).""" msg = command('Q1', clip(val)) self.send_and_receive(msg, float)
Then setting/getting would be more intuitive I think:
tcl = tclab.TCLab() tcl.Q1 = 100 print(tcl.Q1)
Maybe it's too late to change this now. If so, no worries.
The reason for this is/was actually to maintain parity with the Matlab interface. If you'd prefer to interact with properties, you can use U1 and U2.
U1
U2
Oh I see, that makes sense. Thanks, I will use U1 and U2.
Is there a reason why the Q1 and Q2 attributes were not set up as straight-forward properties?
I was expecting something like this:
Then setting/getting would be more intuitive I think:
Maybe it's too late to change this now. If so, no worries.