-
-
Notifications
You must be signed in to change notification settings - Fork 125
Prologix support for both USB and ethernet versions #484
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
Conversation
Thanks for the PR. I will do my best to review it by early next week. |
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 left a bunch of minor stylistic comments.
However I think there is one more serious issue related to thread safety that need to be addressed. When setting the gpib_addr of the interface we need to be sure that no thread will modify it before the interface is done doing the job we need it to do.
Co-authored-by: Matthieu Dartiailh <marul@laposte.net>
Co-authored-by: Matthieu Dartiailh <marul@laposte.net>
Co-authored-by: Matthieu Dartiailh <marul@laposte.net>
Co-authored-by: Matthieu Dartiailh <marul@laposte.net>
Co-authored-by: Matthieu Dartiailh <marul@laposte.net>
Co-authored-by: Matthieu Dartiailh <marul@laposte.net>
for more information, see https://pre-commit.ci
Co-authored-by: Matthieu Dartiailh <marul@laposte.net>
…ding stale read data
The mypy failure is logical while waiting for pyvisa/pyvisa#887 the test failure however needs to be addressed (simply by adding the new missing resources). |
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 will do my best to make a complete review next week. But I spotted a couple of oddities.
.pre-commit-config.yaml
Outdated
rev: v0.9.2 | ||
rev: v0.8.6 |
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.
This should be reverted.
CHANGES
Outdated
@@ -17,7 +17,6 @@ PyVISA-py Changelog | |||
specified by host PR #470 | |||
- add support for VI_ATTR_SUPPRESS_END_EN for USB resources PR #449 | |||
- support open_timeout for TCPIP hislip resources PR #430 | |||
- fix serial flow control configuration PR #483 |
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.
The double dash can be corrected but the line should remain.
pyvisa_py/serial.py
Outdated
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.
This should not be reverted.
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.
First sorry for the slow review process.
Overall this looks good. I would just like to avoid storing the prologix interfaces globally. Can you make this change ?
pyvisa_py/gpib.py
Outdated
if parsed.board in prologix.BOARDS: | ||
newcls = prologix.PrologixInstrSession |
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.
Since the boards are registered through the opening of a resource via the resource manager, I think it would make sense to store them on the library linked to the resource manager. To enable this we could modify the signature of the base Session class which we can do since it is not user facing.
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 the suggestion, it's definitely better to eliminate the module-level global. I moved it to a class var instead (in the prologix._PrologixIntfcSession class).
I think that rebasing should fix the typing issue. For the test, I will let you have a look. I will try to merge on Tuesday and make a release after. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #484 +/- ##
==========================================
+ Coverage 24.40% 24.85% +0.44%
==========================================
Files 23 24 +1
Lines 3515 3713 +198
Branches 401 425 +24
==========================================
+ Hits 858 923 +65
- Misses 2651 2782 +131
- Partials 6 8 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Support added for Prologix GPIB adapters, both USB and ethernet. Examples of usage:
import pyvisa
rm = pyvisa.ResourceManager()
prlgx = rm.open_resource("PRLGX-TCPIP::169.254.1.80::INTFC")
instr = rm.open_resource("GPIB::17::INSTR")
instr.query("*IDN?")
Or for USB version:
import pyvisa
rm = pyvisa.ResourceManager()
prlgx = rm.open_resource("PRLGX-ASRL::/dev/cu.usbserialXXX::INTFC")
instr = rm.open_resource("GPIB::17::INSTR")
instr.query("*IDN?")
ruff check . && ruff format -c . --check
with no errors