-
Notifications
You must be signed in to change notification settings - Fork 332
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
Add support for Hewlett Packard 8753E VNA #1004
base: master
Are you sure you want to change the base?
Conversation
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.
Thank you very much for your contribution. I commented on your code.
A few general points to consider:
- You might add yourself to the
authors.txt
file - Please add documentation files (see https://pymeasure.readthedocs.io/en/latest/dev/adding_instruments/instrument.html#adding-documentation) for the API documentation
Answers to your questions:
- "How do I handle default Prologix parameters": You have to define them in your personal code, not in pymeasure, as pymeasure defines the parameters for the instrument communication, such that anyone might use the device independent of the adapter, see the init part.
- "I am not sure if I should be using asrl or gpib for pyvisa.constants.InterfaceType since its a serial device connecting to GPIB.":
gpib
as that is the device connection. - "Unfortunately, it seems like if I am not defining the Prologix settings and commanding them when using the VNA, there will be unexpected behavior or it will timeout/error out.": You have to create your
PrologixAdapter
with the correct settings beforehand. - "If I utilize default Prologix GPIB-USB adapter parameters for one instrument, is the functionality to change these parameters on the fly for other instruments in place? IE, if I need '++auto 1' for one instrument but not another, with pymeasure send the command to the adapter if I communicate to alternating instruments and remember when it needs to change it?": You have to manage your PrologixAdapter yourself.
- "Are we allowed to utilize cached properties to save time on communicating?" Right now we do not use them. In case they might be good, we could discuss it. I've seen you cache the id/serial_number, but I don't see the point of caching, as you read these data rarely.
If you have more questions, don't hesitate to ask.
… for adding HP8753E using Python 3.12
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.
A second round of comments.
Thanks for your work, which is already in a good state.
Is there a way to change the branch to merge from? I have somehow completely hosed my git clone and cannot update/sync my copied repo with the changes made in pymeasure:master since opening this. Otherwise I'll just copy out my code, nuke my fork repo, refork the repo and create a branch before putting my code back in so I can sync upstream changes. |
You cannot change the branch name to be merged from. You can, however use different commits in the branch:
|
… Hewlett Packard Instrument Files.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1004 +/- ##
==========================================
+ Coverage 58.16% 58.47% +0.30%
==========================================
Files 259 262 +3
Lines 17934 18257 +323
==========================================
+ Hits 10432 10676 +244
- Misses 7502 7581 +79
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
…st to match another one in the same folder for the docs.
…8753E:2: WARNING: Field list ends without a blank line; unexpected unindent.` https://stackoverflow.com/questions/61888521/python-sphinx-warning-definition-list-ends-without-a-blank-line-unexpected-uni
As I see it, I think there are two/three items still needing to get addressed before you would accept this pull request.
|
Don't worry about less than 100% patch coverage. |
… the docstring instead of trying to do a f-string.
I think I am close to done with all the requests made and just need answers to the last 3 unresolved conversations to finish. |
Hey @Sionwage, |
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.
Thanks for your contribution.
I mentioned some incosistencies and mainly documentation issues. The instrument looks already good.
I noticed quite a lot dynamic properties. Do you intend to use them as dynamic properties or is it "just in case"?
…xture using the --device-address flag. Also adjusted the sleep delays for allowing the VNA to catch up.
…ing ending on a blank line
…e `test_hp8753e_with_device_scan_single`
There are different configurations for the 8753E so this allows others to override the defaults set for their instrument. |
Not sure how to resolve Otherwise I think everything has been addressed now. |
prologix = PrologixAdapter(resource_name=prologix_address, visa_library="@py", auto=1) | ||
# need to ensure `eot_enable` is set to zero otherwise you will have to read twice to | ||
# get rid of the extra new line character | ||
prologix.write("++eot_enable 0") | ||
vna = HP8753E(adapter=prologix.gpib(int(gpib_address))) |
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.
By the way, you do not need to create a PrologixAdapter and then call gpib
.
The following two options result in the same behavior:
temp_adapter = PrologixAdapter(resource_name)
adapter = temp_adapter.gpib(gpib_address)
# or
adapter = PrologixAdapter(resource_name, gpib_address)
# this test will wear out the mechanical relays and should be run only as necessary | ||
@pytest.mark.skip |
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.
You can add a reason to the skip:
# this test will wear out the mechanical relays and should be run only as necessary | |
@pytest.mark.skip | |
@pytest.mark.skip(reason="This test will wear out the mechanical relays and should be run only as necessary") |
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.
Some comments.
Yes, it comes good together, we're almost done.
:param max_power: Optional set the maximum validator for `HP8753E.power` on initialization | ||
(float in dBm). | ||
""" |
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.
I think that is the culprit for the warning.
For such a list, sphinx expects the last line to start with :param
or an empty line, so you could do:
- either move
(float ind dBm).
to the end of the previous line 53 (such that the last line starts with:param...
- or add an empty line before the end of the docstring.
We have a line length limit of 100, so the first option should work.
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.
Please revert the changes in this file.
PRs should be based on the master branch and merge there.
The v0.14 branch is there to write the changelog for the next release.
I would like to add a basic HP8753E VNA support to pymeasure.
The functionality is not ready but I would like feedback as I go and there are some specifics for coding I would like assistance with finding documentation on how to handle these.
How do I handle default Prologix GPIB-USB adapter parameters to work with this device?
I found these pages that address how to handle read/write terminations and other parameters for the various adapters but I am unsure how to apply this to the prologix gpib-usb adapter I utilize.
I am not sure if I should be using
asrl
orgpib
forpyvisa.constants.InterfaceType
since its a serial device connecting to GPIB.Unfortunately, it seems like if I am not defining the Prologix settings and commanding them when using the VNA, there will be unexpected behavior or it will timeout/error out.
It looks like it is addressed here but not implemented here Handle Prologix USB to GPIB pyvisa/pyvisa#112
If I utilize default Prologix GPIB-USB adapter parameters for one instrument, is the functionality to change these parameters on the fly for other instruments in place? IE, if I need '++auto 1' for one instrument but not another, with pymeasure send the command to the adapter if I communicate to alternating instruments and remember when it needs to change it?
The Update graphical.rst #112 issue makes it look like different parameters needed with the Prologix adapter for multiple instruments are not handled yet with pymeasure or pyvisa.
Are we allowed to utilize cached properties to save time on communicating?
My to-do list of actions still needed to polish this for others to use is:
__init__
block to__new__
?__version
andif __name__=="__main__":
blocks