mabuchilab / Instrumental

Python-based instrumentation library from the Mabuchi Lab.
http://instrumental-lib.readthedocs.org/
GNU General Public License v3.0
117 stars 77 forks source link

`import visa` -> `import pyvisa as visa` #165

Closed doddgray closed 7 months ago

doddgray commented 12 months ago

The goal of this pull request simply to replace all instances of import visa with import pyvisa as visa, which is required for use with the current PyVISA release. This change fixed my ability to identify visa instruments with instrumental.

Let me know if any changes are needed. Thanks!

natezb commented 12 months ago

Cool, thanks. Would you be able to modify this to just import pyvisa to make this more standard? The corresponding references to visa would then obviously also have to be changed to pyvisa to match

doddgray commented 12 months ago

Sure, I can do that. I felt a bit unsure whether all mentions of visa (sometimes strings, kwargs, keys in dicts etc.) in the code base could safely be changed to pyvisa. But I will give this a try.

natezb commented 12 months ago

I would generally start with the files you've modified here, and probably not modify any strings unless it clearly makes sense to.

You may be able to use a refactor tool in your editor to change import visa to import pyvisa and update all the references.

doddgray commented 8 months ago

after a short break i finally made the suggested changes. That is,

Am I missing anything?

robotanik commented 8 months ago

Since I tried to use it, I noticed the change is still missing in the drivers/spectrometers/thorlabs_ccs.py file. You may have to check for all instances of from visa import as well.