Skip to content
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

Conversation

astafan8
Copy link
Contributor

@astafan8 astafan8 commented Oct 23, 2019

Because it is to be deprecated and a new API is to be used (likely, parameter.get_cache_raw()).

Drivers altered:

  • SR830
  • Alazar (partially)

Won't do in this PR:

  • Finish cleaning Alazar driver, for some functionalities really the raw_value of a parameter is needed. Since raw_value is not yet deprecated and is used only for "getting" the raw value, then let's keep it for now. In the future, getting raw_value should probably subsituted with new API that i introduced here Add get_raw_value to GetLatest of Parameter #1787 .

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
Copy link

codecov bot commented Oct 23, 2019

Codecov Report

Merging #1788 into master will not change coverage.
The diff coverage is 0%.

@@           Coverage Diff           @@
##           master    #1788   +/-   ##
=======================================
  Coverage   69.82%   69.82%           
=======================================
  Files         149      149           
  Lines       18666    18666           
=======================================
  Hits        13033    13033           
  Misses       5633     5633

@astafan8 astafan8 marked this pull request as ready for review October 28, 2019 09:57
@astafan8 astafan8 changed the title Avoid getting raw_value attribute of parameters in instruments Avoid getting raw_value attribute of parameters in SR830 and partially Alazar Oct 28, 2019
@@ -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()
Copy link
Contributor

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.

Copy link
Contributor Author

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 :)

@jenshnielsen jenshnielsen merged commit 6edbf48 into microsoft:master Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants