jwoehr / qisjob

Qiskit Job Control
Other
32 stars 4 forks source link

supressing warnings? #6

Closed omarcostahamido closed 3 years ago

omarcostahamido commented 3 years ago

everytime I qisjob -h I get at the top:

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: UserWarning: QuantumInspire not installed.
  return f(*args, **kwds)
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: UserWarning: Rigetti Forest not installed.
  return f(*args, **kwds)
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: UserWarning: qiskit-jku-provider not installed.
  return f(*args, **kwds)
(...)

would it be possible to suppress it here and only show the warning if I attempt to use any of those backends without the required prerequisite?

omarcostahamido commented 3 years ago

these are quite annoying, anything I do they print to the console.

jwoehr commented 3 years ago

Yes, I should do that. I got coerced into putting imports at head of file by pylint. They used to be in the branches where the code is called :)

jwoehr commented 3 years ago

Added -w flag

omarcostahamido commented 3 years ago

feel free to close this issue when you feel good about these changes or when you add the release 3.3 (?)