Skip to content

Commit

Permalink
Merge pull request #457 from jenshnielsen/fix/units_deprecated
Browse files Browse the repository at this point in the history
Fix/units deprecated
  • Loading branch information
jenshnielsen authored Jan 23, 2017
2 parents 8ef675d + 10f1c87 commit 72185ea
Show file tree
Hide file tree
Showing 18 changed files with 131 additions and 131 deletions.
4 changes: 2 additions & 2 deletions qcodes/instrument_drivers/Harvard/Decadac.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def __init__(self, name, port, slot, timeout=2, baudrate=9600,
set_cmd=partial(self._setvoltage,
channel=channelno),
label='Voltage',
units='V')
unit='V')

self.add_parameter('ch{}_voltrange'.format(channelno),
get_cmd=partial(self._getvoltrange, channelno),
Expand All @@ -80,7 +80,7 @@ def __init__(self, name, port, slot, timeout=2, baudrate=9600,
get_cmd=partial(self._getoffset, channelno),
set_cmd=partial(self._setoffset, channelno),
label='Channel {} offset'.format(channelno),
units='V',
unit='V',
docstring="""
The offset is applied to the channel.
E.g. if ch1_offset = 1 and ch_voltage
Expand Down
8 changes: 4 additions & 4 deletions qcodes/instrument_drivers/QuTech/IVVI.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def __init__(self, name, address, reset=False, numdacs=16, dac_step=10,
parameter_class=ManualParameter,
initial_value=0.05,
label='DAC set sleep',
units='s',
unit='s',
vals=Numbers(0),
docstring=('When check_setpoints is set to True, '
'this is the waiting time between the'
Expand All @@ -96,9 +96,9 @@ def __init__(self, name, address, reset=False, numdacs=16, dac_step=10,
parameter_class=ManualParameter,
initial_value=0.025,
label='DAC read buffer sleep',
units='s',
unit='s',
vals=Numbers(0),
docstring=('While recieving bytes from the IVVI, '
docstring=('While receiving bytes from the IVVI, '
'sleeping is done in multiples of this '
'value. Change to a lower value for '
'a shorter minimum time to wait.'))
Expand All @@ -111,7 +111,7 @@ def __init__(self, name, address, reset=False, numdacs=16, dac_step=10,
self.add_parameter(
'dac{}'.format(i),
label='Dac {} (mV)'.format(i),
units='mV',
unit='mV',
get_cmd=self._gen_ch_get_func(self._get_dac, i),
set_cmd=self._gen_ch_set_func(self._set_dac, i),
vals=vals.Numbers(-2000, 2000),
Expand Down
8 changes: 4 additions & 4 deletions qcodes/instrument_drivers/agilent/Agilent_34400A.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ def __init__(self, name, address, **kwargs):
get_parser=float,
set_cmd=self._set_resolution,
label='Resolution',
units='V')
unit='V')

self.add_parameter('volt',
get_cmd='READ?',
label='Voltage',
get_parser=float,
units='V')
unit='V')

self.add_parameter('fetch',
get_cmd='FETCH?',
label='Voltage',
get_parser=float,
units='V',
unit='V',
snapshot_get=False,
docstring=('Reads the data you asked for, i.e. '
'after an `init_measurement()` you can '
Expand All @@ -59,7 +59,7 @@ def __init__(self, name, address, **kwargs):
set_cmd=self._set_NPLC,
vals=Enum(*NPLC_list),
label='Integration time',
units='NPLC')
unit='NPLC')

self.add_parameter('terminals',
get_cmd='ROUT:TERM?')
Expand Down
6 changes: 3 additions & 3 deletions qcodes/instrument_drivers/agilent/E8527D.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ def __init__(self, name, address, step_attenuator=False, **kwargs):

self.add_parameter(name='frequency',
label='Frequency',
units='Hz',
unit='Hz',
get_cmd='FREQ:CW?',
set_cmd='FREQ:CW' + ' {:.4f}',
get_parser=float,
set_parser=float,
vals=vals.Numbers(1e5, 20e9))
self.add_parameter(name='phase',
label='Phase',
units='deg',
unit='deg',
get_cmd='PHASE?',
set_cmd='PHASE' + ' {:.8f}',
get_parser=self.rad_to_deg,
Expand All @@ -38,7 +38,7 @@ def __init__(self, name, address, step_attenuator=False, **kwargs):
min_power = -135 if step_attenuator else -20
self.add_parameter(name='power',
label='Power',
units='dBm',
unit='dBm',
get_cmd='POW:AMPL?',
set_cmd='POW:AMPL' + ' {:.4f}',
get_parser=float,
Expand Down
14 changes: 7 additions & 7 deletions qcodes/instrument_drivers/agilent/HP33210A.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,42 @@ def __init__(self, name, address, reset=False, **kwargs):

self.add_parameter(name='frequency',
label='Frequency',
units='Hz',
unit='Hz',
get_cmd='FREQ?',
set_cmd='FREQ {:.3f}',
get_parser=float,
vals=vals.Numbers(10e-3, 10e6))
self.add_parameter(name='amplitude',
label='Amplitude',
units='V',
unit='V',
get_cmd='VOLT?',
set_cmd='VOLT {:.3f}',
get_parser=float,
vals=vals.Numbers(10e-3, 10))
self.add_parameter(name='offset',
label='Offset',
units='V',
unit='V',
get_cmd='VOLT:OFFS?',
set_cmd='VOLT:OFFS {:.2f}',
get_parser=float,
vals=vals.Numbers(-4.99, 4.99))
self.add_parameter(name='phase',
label='Burst phase',
units='deg',
unit='deg',
get_cmd='BURS:PHAS?',
set_cmd='BURS:PHAS {:.2f}',
get_parser=float,
vals=vals.Numbers(0, 360))
self.add_parameter(name='symmetry',
label='Symmetry',
units='%',
unit='%',
get_cmd='FUNC:RAMP:SYMM?',
set_cmd='FUNC:RAMP:SYMM {:.1f}',
get_parser=float,
vals=vals.Numbers(0, 100))
self.add_parameter(name='duty',
label='Duty',
units='%',
unit='%',
get_cmd='FUNC:SQU:DCYC?',
set_cmd='FUNC:SQU:DCYC {:.1f}',
get_parser=float,
Expand All @@ -64,7 +64,7 @@ def __init__(self, name, address, reset=False, **kwargs):
val_mapping={'OFF': '0', 'ON': '1'})
self.add_parameter(name='load',
label='Output load impedance',
units='ohms',
unit='ohms',
get_cmd='OUTP:LOAD?',
set_cmd='OUTP:LOAD {:.1f}',
get_parser=float,
Expand Down
8 changes: 4 additions & 4 deletions qcodes/instrument_drivers/ithaco/Ithaco_1211.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def __init__(self, name, **kwargs):
parameter_class=ManualParameter,
initial_value=1e-8,
label='Sensitivity',
units='A/V',
unit='A/V',
vals=Enum(1e-11, 1e-10, 1e-09, 1e-08, 1e-07,
1e-06, 1e-05, 1e-4, 1e-3))

Expand All @@ -82,22 +82,22 @@ def __init__(self, name, **kwargs):
parameter_class=ManualParameter,
initial_value=1,
label='Sensitivity factor',
units=None,
unit=None,
vals=Enum(0.1, 1, 10))

self.add_parameter('suppression',
parameter_class=ManualParameter,
initial_value=1e-7,
label='Suppression',
units='A',
unit='A',
vals=Enum(1e-10, 1e-09, 1e-08, 1e-07, 1e-06,
1e-05, 1e-4, 1e-3))

self.add_parameter('risetime',
parameter_class=ManualParameter,
initial_value=0.3,
label='Rise Time',
units='msec',
unit='msec',
vals=Enum(0.01, 0.03, 0.1, 0.3, 1, 3, 10, 30,
100, 300, 1000))

Expand Down
20 changes: 10 additions & 10 deletions qcodes/instrument_drivers/oxford/mercuryiPS.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,37 +109,37 @@ def __init__(self, name, address=None, port=None, axes=None, **kwargs):
self.add_parameter('radius',
get_cmd=self._get_r,
set_cmd=self._set_r,
units='|B|')
unit='|B|')
self.add_parameter('theta',
get_cmd=self._get_theta,
set_cmd=self._set_theta,
units='rad')
unit='rad')
self.add_parameter('phi',
get_cmd=self._get_phi,
set_cmd=self._set_phi,
units='rad')
unit='rad')

for ax in self.axes:
self.add_parameter(ax.lower()+'_fld',
get_cmd=partial(self._get_fld, ax, 'FLD'),
set_cmd=partial(self._ramp_to_setpoint,
ax, 'FSET'),
label='B'+ax.lower(),
units='T')
unit='T')
self.add_parameter(ax.lower()+'_fldC',
get_cmd=partial(self._get_fld,
ax, 'CURR'),
set_cmd=partial(self._ramp_to_setpoint,
ax, 'CSET'),
label='B'+ax.lower(),
units='T')
unit='T')
self.add_parameter(ax.lower()+'_fld_wait',
get_cmd=partial(self._get_fld,
ax, 'CURR'),
set_cmd=partial(self._ramp_to_setpoint_and_wait,
ax, 'CSET'),
label='B'+ax.lower(),
units='T')
unit='T')
self.add_parameter(ax.lower()+'_ACTN',
get_cmd=partial(
self._get_cmd,
Expand All @@ -149,19 +149,19 @@ def __init__(self, name, address=None, port=None, axes=None, **kwargs):
self.add_parameter(ax.lower()+'_setpoint',
get_cmd=partial(self._get_fld, ax, 'FSET'),
set_cmd=partial(self._set_fld, ax, 'FSET'),
units='T')
unit='T')
self.add_parameter(ax.lower()+'_setpointC',
get_cmd=partial(self._get_fld, ax, 'CSET'),
set_cmd=partial(self._set_fld, ax, 'CSET'),
units='T')
unit='T')
self.add_parameter(ax.lower()+'_rate',
get_cmd=partial(self._get_fld, ax, 'RFST'),
set_cmd=partial(self._set_fld, ax, 'RFST'),
units='T/m')
unit='T/m')
self.add_parameter(ax.lower()+'_rateC',
get_cmd=partial(self._get_fld, ax, 'RCST'),
set_cmd=partial(self._set_fld, ax, 'RCST'),
units='T/m')
unit='T/m')

self.connect_message()

Expand Down
12 changes: 6 additions & 6 deletions qcodes/instrument_drivers/oxford/triton.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ def __init__(self, name, address=None, port=None, terminator='\r\n',

self.add_parameter(name='pid_setpoint',
label='PID temperature setpoint',
units='K',
unit='K',
get_cmd=partial(self._get_control_param, 'TSET'),
set_cmd=partial(self._set_control_param, 'TSET'))

self.add_parameter(name='pid_rate',
label='PID ramp rate',
units='K/min',
unit='K/min',
get_cmd=partial(self._get_control_param,
'RAMP:RATE'),
set_cmd=partial(self._set_control_param,
Expand All @@ -87,7 +87,7 @@ def __init__(self, name, address=None, port=None, terminator='\r\n',
label='PID heater range',
# TODO: The units in the software are mA, how to
# do this correctly?
units='mA',
unit='mA',
get_cmd=partial(self._get_control_param, 'RANGE'),
set_cmd=partial(self._set_control_param, 'RANGE'),
vals=Enum(*self._heater_range_curr))
Expand Down Expand Up @@ -158,15 +158,15 @@ def _get_named_channels(self):
alias, chan = rep.split(':')[-2:]
self.chan_alias[alias] = chan
self.add_parameter(name=alias,
units='K',
unit='K',
get_cmd='READ:DEV:%s:TEMP:SIG:TEMP' % chan,
get_parser=self._parse_temp)

def _get_pressure_channels(self):
for i in range(1, 7):
chan = 'P%d' % i
self.add_parameter(name=chan,
units='bar',
unit='bar',
get_cmd='READ:DEV:%s:PRES:SIG:PRES' % chan,
get_parser=self._parse_pres)

Expand All @@ -184,7 +184,7 @@ def _get_temp_channels(self, file):
name = config.get(section, '"m_lpszname"').strip("\"")
self.chan_temps[chan] = {'name': name, 'value': None}
self.add_parameter(name=chan,
units='K',
unit='K',
get_cmd='READ:DEV:%s:TEMP:SIG:TEMP' % chan,
get_parser=self._parse_temp)

Expand Down
Loading

0 comments on commit 72185ea

Please sign in to comment.