mabuchilab / Instrumental

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

Add verbose option to list_instruments() #133

Open natezb opened 3 years ago

natezb commented 3 years ago

Uses a separate "verbose" logger that still bubbles up to the root logger. This is intended to list for every driver module (1) whether it could be imported and (2) what instruments it found.

For now the verbose option is enabled by default.

natezb commented 3 years ago

Here's some example output from my system:

[ins] In [3]: list_instruments(verbose=True)
Checking for VISA instruments...
pyvisa could not be imported, skipping VISA modules ['funcgenerators.agilent', 'funcgenerators.rigol', 'funcgenerators.tektronix', 'laserdiodecontrollers.ilx_lightwave', 'lockins.sr844', 'lockins.sr850', 'multimeters.hp', 'powermeters.thorlabs', 'powersupplies.gw_instek', 'scopes.agilent', 'scopes.tektronix', 'spectrumanalyzers.rohde_schwarz', 'tempcontrollers.covesion', 'tempcontrollers.hcphotonics', 'lasers.femto_ferb', 'powermeters.newport', 'wavemeters.burleigh']

Checking non-VISA driver modules...
{cameras.pixelfly}
    Module failed to import, with error <<No module named 'win32event'>>
{cameras.tsi}
    Module failed to import, with error <<cannot parse "DWORD WaitForSingleObject(HANDLE hHandle, DWORD dwMilliseconds);"
<cdef source string>:6:11: before: WaitForSingleObject>>
{cameras.uc480}
    Module failed to import, with error <<No module named 'win32event'>>
{daq.ni}
    Module failed to import, with error <<No module named 'nicelib'>>
{motion._kinesis.ff}
    Module failed to import, with error <<No module named 'nicelib'>>
{motion._kinesis.isc}
    Module failed to import, with error <<No module named 'nicelib'>>
{motion.apt}
    Found instruments []
{motion.ecc100}
/home/nate/projects/Instrumental/instrumental/drivers/motion/ecc100.py:24: UserWarning: Driver 'instrumental.drivers.motion.ecc100' is out of date and incompatible with the current Instrumental core. Pull requests fixing this are welcome.
  warnings.warn(
    Module failed to import, with error <<cannot import name 'oledll' from 'ctypes' (/usr/lib/python3.9/ctypes/__init__.py)>>
{motion.filter_flipper}
    Module failed to import, with error <<No module named 'nicelib'>>
{motion.newmark}
    Module failed to import, with error <<No module named 'visa'>>
{motion.tdc_001}
    Module failed to import, with error <<No module named 'nicelib'>>
{spectrometers.bristol}
    Module failed to import, with error <<module 'ctypes' has no attribute 'WinDLL'>>
{spectrometers.thorlabs_ccs}
    Module failed to import, with error <<No module named 'visa'>>
{cameras.pco}
    Module failed to import, with error <<No module named 'nicelib'>>
{vacuum.sentorr_mod}
    Found instruments []
Out[3]: []