-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid getting raw_value attribute of parameters in SR830 and partially Alazar #1788
Avoid getting raw_value attribute of parameters in SR830 and partially Alazar #1788
Conversation
fixed for the following parameters: - external_sample_rate - sample_rate - buffers_per_acquisition - samples_per_record - records_per_buffer - allocated_buffers - buffers_per_acquisition - buffer_timeout
Codecov Report
@@ Coverage Diff @@
## master #1788 +/- ##
=======================================
Coverage 69.82% 69.82%
=======================================
Files 149 149
Lines 18666 18666
=======================================
Hits 13033 13033
Misses 5633 5633 |
…bute-of-parameter
…bute-of-parameter
…bute-of-parameter
…bute-of-parameter
…bute-of-parameter
…bute-of-parameter
@@ -572,12 +572,16 @@ def decrement_sensitivity(self): | |||
return self._change_sensitivity(-1) | |||
|
|||
def _change_sensitivity(self, dn): | |||
_ = self.sensitivity.get() | |||
n = int(self.sensitivity.raw_value) | |||
sensitivity = self.sensitivity.get() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason why you are using the explicit .get()
here? I think we could inline this call and remove the variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no reason really. let me inline, shoud still be readable :)
Because it is to be deprecated and a new API is to be used (likely,
parameter.get_cache_raw()
).Drivers altered:
Won't do in this PR:
raw_value
of a parameter is needed. Sinceraw_value
is not yet deprecated and is used only for "getting" the raw value, then let's keep it for now. In the future, gettingraw_value
should probably subsituted with new API that i introduced here Add get_raw_value to GetLatest of Parameter #1787 .