Skip to content

Commit

Permalink
Clarify todo
Browse files Browse the repository at this point in the history
  • Loading branch information
jenshnielsen committed Mar 4, 2024
1 parent 5129d95 commit f9fa4ff
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/qcodes/parameters/parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def _set_manual_parameter(
)
elif not self.gettable and get_cmd is not False:
if get_cmd is None:
# mypy does not allow setting a method
# ignore typeerror since mypy does not allow setting a method dynamically
self.get_raw = MethodType(_get_manual_parameter, self) # type: ignore[method-assign]
else:
if isinstance(get_cmd, str) and instrument is None:
Expand All @@ -278,8 +278,9 @@ def _set_manual_parameter(
)

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
# TODO get_raw should also be a method here. This should probably be done by wrapping
# it with MethodType like above
# ignore typeerror since mypy does not allow setting a method dynamically
self.get_raw = Command( # type: ignore[method-assign]
arg_count=0,
cmd=get_cmd,
Expand All @@ -296,6 +297,7 @@ def _set_manual_parameter(
)
elif not self.settable and set_cmd is not False:
if set_cmd is None:
# ignore typeerror since mypy does not allow setting a method dynamically
self.set_raw = MethodType(_set_manual_parameter, self) # type: ignore[method-assign]
else:
if isinstance(set_cmd, str) and instrument is None:
Expand All @@ -308,7 +310,9 @@ def _set_manual_parameter(
exec_str_write = (
getattr(instrument, "write", None) if instrument else None
)
# TODO this should also be a method
# TODO get_raw should also be a method here. This should probably be done by wrapping
# it with MethodType like above
# ignore typeerror since mypy does not allow setting a method dynamically
self.set_raw = Command( # type: ignore[method-assign]
arg_count=1, cmd=set_cmd, exec_str=exec_str_write
)
Expand Down

0 comments on commit f9fa4ff

Please sign in to comment.