Skip to content

Commit

Permalink
add some todos
Browse files Browse the repository at this point in the history
  • Loading branch information
jenshnielsen committed Feb 3, 2024
1 parent 22f0d02 commit 8efe93b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/qcodes/parameters/parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ def _set_manual_parameter(x: ParamRawDataType) -> ParamRawDataType:
mylogger.debug(
"Setting raw value of parameter: %s to %s", self.full_name, x
)
# TODO this really should set the cache via raw value
# at the moment set_raw does nothing on a manual parameter
return x

if instrument is not None and bind_to_instrument:
Expand Down Expand Up @@ -275,7 +277,7 @@ def _set_manual_parameter(x: ParamRawDataType) -> ParamRawDataType:
)

exec_str_ask = getattr(instrument, "ask", None) if instrument else None

# TODO this should be a method like above
# mypy does not allow setting a method
self.get_raw = Command( # type: ignore[method-assign]
arg_count=0,
Expand All @@ -292,6 +294,7 @@ def _set_manual_parameter(x: ParamRawDataType) -> ParamRawDataType:
" set_raw is an error."
)
elif not self.settable and set_cmd is not False:
# TODO We should also wrap this with a MethodType like get above
if set_cmd is None:
self.set_raw: Callable[..., Any] = _set_manual_parameter
else:
Expand All @@ -305,6 +308,7 @@ def _set_manual_parameter(x: ParamRawDataType) -> ParamRawDataType:
exec_str_write = (
getattr(instrument, "write", None) if instrument else None
)
# TODO this should also be a method
self.set_raw = Command(
arg_count=1, cmd=set_cmd, exec_str=exec_str_write
)
Expand Down
1 change: 1 addition & 0 deletions src/qcodes/parameters/parameter_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,7 @@ def get_wrapper(*args: Any, **kwargs: Any) -> ParamDataType:

return get_wrapper

# TODO should be updated like _get_wrapper
def _wrap_set(self, set_function: Callable[..., None]) -> Callable[..., None]:
@wraps(set_function)
def set_wrapper(value: ParamDataType, **kwargs: Any) -> None:
Expand Down

0 comments on commit 8efe93b

Please sign in to comment.