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
WIP : Fix outdated pyvisa calls #409
Conversation
Great fix. I don't have a device close to me to test myself. Maybe @JAnderson419 can comment if needed. |
I'm afraid I won't be much help on the instrument testing front in the short term as I am away from the lab until January, but I can definitely test on the PNA in our lab once I get back (FW 9.32 I think). I did notice that the documentation for the VI module is broken and it looks like it would require running the notebook on a machine connected to a VNA. This is not related to the changes made in this PR specifically, but I wonder if it would be worth adding tests for the module to run coverage while connected to a local instrument, and then merging that coverage into the main report run by CI? It gets a little tricky with the various versions of VISA and instrument firmware versions, but it might give users more confidence in the VI module and/or allow us to crowd-source a list of supported hardware from users to put in the docs. |
I managed to get in to the lab today and test with our PNA which revealed a couple of bugs (all related to the pyvisa update) so I'll update this PR. I'll also investigate updating that documentation. |
Hi @cafeclimber. Did you make some progresses on that? |
I used the latest version of scikit-rf and pyvisa to connect to PNA, but it did not work. So we tried different version combinations of scikit-rf and pyvisa. 1. unconnectedscikit-rf v0.22.1 2. unconnectedscikit-rf v0.14.9 3. connectablescikit-rf v0.22.1
|
If you're able, could you try using my fork here and let me know what issues you have? It's still incomplete but I am actively trying to rewrite the VI module. |
Using your fork, the following worked correctly in python 3.9.
Python 3.9.0 Note that the following error occurred in python 3.10. This post seems to be close to the error. |
The Python 10 error due to Iterable was fixed in PR #674. Maybe the fork should be sychronized to the current master to include this fix. |
I'll get on this ASAP! |
Out of curiosity, what interface were you connecting to the PNA with? TCP/IP worked great for me but for anything else, I ran in to ask kinds of driver issues. |
I connected via ethernet and used tcpip, I did not try GPIB as I do not have the cable. |
Sorry if I am posting to the wrong place. The specific location of the error is here.
The cause seems to be the separation of the ascii and binary versions due to changes in pyvisa.
|
@jeanbiego Yeah this is really what motivated my forking the repo. There seems to have been a breaking change in PyVisa several years ago that scikit-rf did not update with. I saw this as an opportunity to update unify the virtual instrument module. I'm actively PhDing but can try to work on getting my fork more updated / mature as I have free time. I had asked in the Slack a while ago if the path I was heading down with my fork was okay with those most involved in maintaining the VI module, but I haven't heard much back. |
@jeanbiego In the short term, if you need to fix your issue, you could clone my fork and implement the calset upload yourself by copying the code from the original VI module but updating the |
@cafeclimber Thank you. I will try your advice. |
An error occurred when sending set values to PNA using the following code.
PNA error : The cause of this seems to be I doubt if the above report can be pyvisa related, so please let me know if I should make a separate issue. |
Hey @jeanbiego. Are you using my fork (specifically the vi branch)? I don't see the function you mentioned in that branch. The way I've designed the refactor, there should be no calls to If you still run into an issue using that branch, please let me know / provide the full stack trace and I'll try to make an update asap. If it's related to the current upstream skrf vi module, please file a new issue. Thanks! |
I prepared a test environment with venv and installed scikit-rf there with And, there is no error on the python side, so there is no stack trace. |
Ah that was my mistake not telling you. That pulls the main branch. I've been working on the vi branch which you can install with
(I'm not positive about that syntax as I've never installed something with extras tags and from a specific branch on GitHub 😳) |
|
Update methods in the virtual instrument module which called deprecated pyvisa methods. This included updating
skrf/vi/scpi/parser.py
to create two methods forquery_value
entries in the command tree of every SCPI yaml file.Addresses #407 and #393