jwoehr / qisjob

Qiskit Job Control
Other
32 stars 4 forks source link

qisjob getting rid of hangs and throwin error instead #10

Closed omarcostahamido closed 3 years ago

omarcostahamido commented 3 years ago

title says it all. I'm not sure I was supposed to have anything in the job list as I've had errors running the simple qasms, but when running qisjob --job it didn't return nor display any useful result besides the usual:

$  qisjob --job
/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)
/Users/user/Documents/QISJOB/lib/python3.7/site-packages/qiskit/providers/ibmq/ibmqfactory.py:192: UserWarning: Timestamps in IBMQ backend properties, jobs, and job results are all now in local time instead of UTC.
  warnings.warn('Timestamps in IBMQ backend properties, jobs, and job results '
jwoehr commented 3 years ago

That only works if you sent a job and want the dict when it comes back. Also, I used to use job_monitor by default but in later revs, if you want that constant update of your queue position, you need the flag --use_job_monitor

omarcostahamido commented 3 years ago

Ok, I sometimes like to be silly to see if it breaks. In this case, and in another one that I just detected (running qisjob will also hang), I think it would be useful to throw an error and let the user know that they are trying to do something that is not possible/doesn't make sense/is not allowed. I've learned a lot doing this (in C++) while working on the microqiskit. And it is just really helpful to be reminded when you make a mistake (which happens).

jwoehr commented 3 years ago

Qisjob reads stdin in absence of file args. We updated README.md to make that clearer.