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

Refactor Keysight 344xxA code and small fixes #1169

Merged
merged 12 commits into from
Jul 23, 2018

Conversation

YakBizzarro
Copy link
Contributor

Fix code for Keysight 34461A and split the driver depending on the model, like in #772
Also it automatically detect if the digitizer option is installed.

@WilliamHPNielsen @jenshnielsen

"""
Instrument class for Keysight 34460A, 34461A, 34465A and 34470A multimeters.

Tested with: 34461A, 34465A.
Copy link
Contributor

Choose a reason for hiding this comment

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

is it possible to test the driver on 34460A and 34470A as well?

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, I have only a 34461A. The 34465A was tested by the original author.
Anyway they should work, they are very similar


# SYSTEM
self.add_parameter('error',
label='Error message',
Copy link
Contributor

Choose a reason for hiding this comment

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

according to errorparser implementation, this "Parameter" returns not only the message, but also the error code. In order to avoid confusion with the usage of this Parameter, and to avoid abuse of Parameter class as such, could you please make this a method of this class (basically making errorparser a method)?

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 problem

@@ -186,6 +170,12 @@ def __init__(self, name, address, utility_freq=50, silent=False,
####################################
# PARAMETERS

self.add_parameter('line_frequency',
Copy link
Contributor

Choose a reason for hiding this comment

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

should the values of this parameter be limited to vals=vals.Enum(50, 60)?

####################################
# PARAMETERS

self.add_parameter('line_frequency',
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall the values of this parameter be limited to vals=vals.Enum(50, 60)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think, it has only a get, you can't set it. Do we need validator in this case?

Copy link
Contributor

Choose a reason for hiding this comment

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

oh, no, but then please add set_cmd=False to the add_parameter call - this way you show that setting is indeed not possible. You could also add a dosctring= argument where you explain that "the instrument returns the frequency of the grid that it is plugged into" or smth.

Copy link
Contributor

@astafan8 astafan8 Jul 20, 2018

Choose a reason for hiding this comment

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

btw, sorry for misinformation, set_cmd is False by default, so no need for explicitly adding it. But thanks for adding it anyway.

Copy link
Contributor

Choose a reason for hiding this comment

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

But the line frequency is now needed in the Keysight_34465A.yaml file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, I added it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Something else for merging?

@codecov
Copy link

codecov bot commented Jul 20, 2018

Codecov Report

Merging #1169 into master will increase coverage by 0.11%.
The diff coverage is 58.33%.

@@            Coverage Diff            @@
##           master   #1169      +/-   ##
=========================================
+ Coverage   79.78%   79.9%   +0.11%     
=========================================
  Files          48      49       +1     
  Lines        6664    6673       +9     
=========================================
+ Hits         5317    5332      +15     
+ Misses       1347    1341       -6

@WilliamHPNielsen
Copy link
Contributor

WilliamHPNielsen commented Jul 23, 2018

@YakBizzarro, nothing more is needed, I think we're good to merge. I'll just wait for CI.

Copy link
Contributor

@WilliamHPNielsen WilliamHPNielsen left a comment

Choose a reason for hiding this comment

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

Fine stuff right here.

@WilliamHPNielsen WilliamHPNielsen merged commit 437da4c into microsoft:master Jul 23, 2018
@YakBizzarro
Copy link
Contributor Author

Great, thank you!

giulioungaretti pushed a commit that referenced this pull request Jul 23, 2018
Merge: 0f85dfd 14f92c7
Author: William H.P. Nielsen <whpn@mailbox.org>

    Merge pull request #1169 from YakBizzarro/keysight_344xxA
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.

None yet

4 participants