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

Fix: Keysight_34465A overload value 9.9e37 to be np.inf instead #1929

Merged
merged 11 commits into from
Mar 5, 2020

Conversation

lakhotiaharshit
Copy link
Contributor

@lakhotiaharshit lakhotiaharshit commented Feb 25, 2020

In case the DMM tries to measure the voltage value outside the its range, it overloads and throws 9.9e37 instead of throwing an error. Here we substitute this number with np.nan.

Side note: The error query does not throw any error even though the instrument display shows in bold that instrument is overloaded.

  • Test on the instrument

To reproduce the error:
20200224_165145

@jenshnielsen @astafan8

@codecov
Copy link

codecov bot commented Feb 25, 2020

Codecov Report

Merging #1929 into master will decrease coverage by <.01%.
The diff coverage is 50%.

@@            Coverage Diff             @@
##           master    #1929      +/-   ##
==========================================
- Coverage   68.73%   68.72%   -0.01%     
==========================================
  Files         155      155              
  Lines       19791    19798       +7     
==========================================
+ Hits        13603    13607       +4     
- Misses       6188     6191       +3

@jenshnielsen
Copy link
Collaborator

thanks @lakhotiaharshit

Does this work if you read out a buffer with multiple datapoints?

@jenshnielsen
Copy link
Collaborator

What happens with negative voltages. Is that even supported. Does it return a negative value?

@lakhotiaharshit
Copy link
Contributor Author

thanks @lakhotiaharshit
Does this work if you read out a buffer with multiple datapoints?

Yes, I think I have fixed that part in the code. I am also planning to test it on the actual instrument in the evening to have the final confirmation. Do not know about the negative voltage though.

Copy link
Contributor

@astafan8 astafan8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! let know once the final testing on the instrument is done.

wrt, negative values - would be nice to catch it in this PR as well, but i'd say it's a nice-to-have for now.

@lakhotiaharshit
Copy link
Contributor Author

What happens with negative voltages. Is that even supported. Does it return a negative value?

Yes, fixed the PR to support negative voltage overload also.

@jenshnielsen
Copy link
Collaborator

So the question that I didn't really raise but is relevant when you consider positive and negative values is. Should this not return +- inf rather than nan ?

@lakhotiaharshit lakhotiaharshit changed the title Fix: Keysight_34465A overload value 9.9e37 to be np.nan instead Fix: Keysight_34465A overload value +/-9.9e37 to be +/-np.inf instead Feb 26, 2020
@lakhotiaharshit lakhotiaharshit changed the title Fix: Keysight_34465A overload value +/-9.9e37 to be +/-np.inf instead Fix: Keysight_34465A overload value 9.9e37 to be np.inf instead Feb 26, 2020
Copy link
Contributor

@astafan8 astafan8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great! and thanks for the tests!

@lakhotiaharshit lakhotiaharshit self-assigned this Feb 26, 2020
@jenshnielsen
Copy link
Collaborator

Looks great but something seems to be up with the tests.

@lakhotiaharshit
Copy link
Contributor Author

lakhotiaharshit commented Feb 27, 2020

Looks great but something seems to be up with the tests.

Individually all tests are running fine however when we run together all the test after the test below are failing. I do not know the reason at the moment.

@pytest.mark.parametrize("val_volt", ['10, 9.9e37, -9.9e37'])
def test_get_timetrace(driver_volt):
driver_volt.timetrace_npts(3)
voltage = driver_volt.timetrace.get()
assert (voltage == np.array([10.0, np.inf, -np.inf])).all()

@lakhotiaharshit
Copy link
Contributor Author

Following Mikhail's nice suggestion. I have ignored that particular test at the moment. The is marked not to run and a small reason is added. I will open a new card in qcodes debt so that at later point we can fix that test.

@astafan8 astafan8 merged commit 67a7c0c into microsoft:master Mar 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants