You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm finding the implementation of properties like this a bit confusing:
@propertydefpulse_mode(self):
""" Toggle Pulse Mode On and Off (1=On) """self._pulse_mode=self._write_cmd('?PUL')[0]
returnself._pulse_mode@pulse_mode.setterdefset_pulse_mode(self, mode=0):
""" Toggle Pulse Mode On and Off (1=On) """self._pulse_mode=self._write_cmd('PUL', str(mode))[0]
Based on the name, I would expect set_pulse_mode to be a function taking mode as an argument, for example:
laser.set_pulse_mode(mode=1)
Instead, set_pulse_mode is a property setter and needs to be used as:
laser.set_pulse_mode=1
I would suggest renaming set_pulse_mode to pulse_mode as in:
@propertydefpulse_mode(self):
""" Toggle Pulse Mode On and Off (1=On) """self._pulse_mode=self._write_cmd('?PUL')[0]
returnself._pulse_mode@pulse_mode.setterdefpulse_mode(self, mode=0):
""" Toggle Pulse Mode On and Off (1=On) """self._pulse_mode=self._write_cmd('PUL', str(mode))[0]
The Laser's are still missing the abstract class implementation.
Commands that should be here:
The text was updated successfully, but these errors were encountered: