diff --git a/qcodes/instrument/channel.py b/qcodes/instrument/channel.py index 9868effa5af..5802544cb43 100644 --- a/qcodes/instrument/channel.py +++ b/qcodes/instrument/channel.py @@ -80,7 +80,7 @@ def __init__(self, self._channels = channels self._param_name = param_name - def get(self) -> tuple: + def get_raw(self) -> tuple: """ Return a tuple containing the data from each of the channels in the list @@ -88,7 +88,7 @@ def get(self) -> tuple: return tuple(chan.parameters[self._param_name].get() for chan in self._channels) - def set(self, value): + def set_raw(self, value): """ Set all parameters to this value diff --git a/qcodes/instrument/parameter.py b/qcodes/instrument/parameter.py index b2ca23817ca..0f5e6428e63 100644 --- a/qcodes/instrument/parameter.py +++ b/qcodes/instrument/parameter.py @@ -1425,8 +1425,11 @@ def __init__(self, name, instrument=None, class ManualParameter(Parameter): def __init__(self, name, instrument=None, initial_value=None, **kwargs): + """ + A simple alias for a parameter that does not have a set or + a get function. Useful for parameters that do not have a direct + instrument mapping. + """ super().__init__(name=name, instrument=instrument, get_cmd=None, set_cmd=None, initial_value=initial_value, **kwargs) - warnings.warn('Parameter {}: `ManualParameter` is deprecated, use ' - '`Parameter` instead with `set_cmd=None`.'.format(self)) diff --git a/qcodes/instrument_drivers/devices.py b/qcodes/instrument_drivers/devices.py index e255120569b..6c561781385 100644 --- a/qcodes/instrument_drivers/devices.py +++ b/qcodes/instrument_drivers/devices.py @@ -72,12 +72,12 @@ def __init__(self, # extend metadata self._meta_attrs.extend(["division_value"]) - def set(self, value: Union[int, float]) -> None: + def set_raw(self, value: Union[int, float]) -> None: instrument_value = value * self.division_value self._save_val(value) self.v1.set(instrument_value) - def get(self) -> Union[int, float]: + def get_raw(self) -> Union[int, float]: """ Returns: number: value at which was set at the sample diff --git a/qcodes/tests/instrument_mocks.py b/qcodes/tests/instrument_mocks.py index 6e03ad68236..c6b0518941e 100644 --- a/qcodes/tests/instrument_mocks.py +++ b/qcodes/tests/instrument_mocks.py @@ -173,7 +173,7 @@ def __init__(self, **kwargs): shapes = tuple(np.shape(v) for v in self._return) super().__init__(name='multigetter', names=names, shapes=shapes) - def get(self): + def get_raw(self): return self._return @@ -201,7 +201,7 @@ def __init__(self, instrument=None, name='testparameter'): setpoint_names=setpoint_names, setpoint_units=setpoint_units) - def get(self): + def get_raw(self): items = (np.zeros(5), np.ones(5)) self._save_val(items) return items @@ -231,7 +231,7 @@ def __init__(self, instrument=None, name='testparameter'): setpoint_names=setpoint_names, setpoint_units=setpoint_units) - def get(self): + def get_raw(self): item = np.ones(5) + 1 self._save_val(item) return item diff --git a/qcodes/tests/test_loop.py b/qcodes/tests/test_loop.py index 1716e2aabd3..ac098571e1a 100644 --- a/qcodes/tests/test_loop.py +++ b/qcodes/tests/test_loop.py @@ -482,7 +482,7 @@ def __init__(self, *args, count=1, msg=None, **kwargs): # also need a _signal_queue, but that has to be added later super().__init__(*args, **kwargs) - def get(self): + def get_raw(self): self._count -= 1 if self._count <= 0: raise _QcodesBreak diff --git a/qcodes/tests/test_parameter.py b/qcodes/tests/test_parameter.py index 57dc15caf87..0c4dc37e5c7 100644 --- a/qcodes/tests/test_parameter.py +++ b/qcodes/tests/test_parameter.py @@ -21,7 +21,7 @@ def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self._get_count = 0 - def get(self): + def get_raw(self): self._get_count += 1 self._save_val(42) return 42 @@ -287,7 +287,7 @@ def __init__(self, return_val, *args, **kwargs): self._get_count = 0 super().__init__(*args, **kwargs) - def get(self): + def get_raw(self): self._get_count += 1 self._save_val(self._return_val) return self._return_val @@ -295,7 +295,7 @@ def get(self): class SettableArray(SimpleArrayParam): # this is not allowed - just created to raise an error in the test below - def set(self, v): + def set_raw(self, v): self.v = v @@ -418,7 +418,7 @@ def __init__(self, return_val, *args, **kwargs): self._get_count = 0 super().__init__(*args, **kwargs) - def get(self): + def get_raw(self): self._get_count += 1 self._save_val(self._return_val) return self._return_val @@ -427,7 +427,7 @@ def get(self): class SettableMulti(SimpleMultiParam): # this is not fully suported - just created to raise a warning in the test below. # We test that the warning is raised - def set(self, v): + def set_raw(self, v): print("Calling set") self.v = v