-
Couldn't load subscription status.
- Fork 30
Description
instead set_voltage(self, channel, value, unit='mV') use set_voltage(self, channel, value, unit='m').
Makes things easier when comes to abstraction. We can also do some unit conversion based on a new class that we can put inside utils. The conversion is then based on a dict like that one:
_prefix = {'y': 1e-24, # yocto
'z': 1e-21, # zepto
'a': 1e-18, # atto
'f': 1e-15, # femto
'p': 1e-12, # pico
'n': 1e-9, # nano
'u': 1e-6, # micro
'm': 1e-3, # mili
'c': 1e-2, # centi
'd': 1e-1, # deci
'k': 1e3, # kilo
'M': 1e6, # mega
'G': 1e9, # giga
'T': 1e12, # tera
'P': 1e15, # peta
'E': 1e18, # exa
'Z': 1e21, # zetta
'Y': 1e24, # yotta
}
also check http://stackoverflow.com/questions/10969759/python-library-to-convert-between-si-unit-prefixes.