-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
dag_drawer should check the existence of filename extension #3099
Comments
Hi @we-taper , thanks for reporting, and I agree the conflicting error messages are confusing. It looks like the error catching around https://github.com/Qiskit/qiskit-terra/blob/d090eca91dc1afdb68f563885c4ccf13b31de20e/qiskit/visualization/dag_visualization.py#L91 could be refined to either inspect the raised |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Newcomer here, recently started learning QisKit. Would not mind taking a crack at this. |
go for it @Rajan117! I've assigned to you, let us know if you have any questions |
Thanks. q = QuantumRegister(3, 'q') dag = circuit_to_dag(circ) But I instead get this error. I assume I have done something wrong in setting up my test environment but unsure how, followed the official QisKit YouTube guide. |
I will be honest, I have had a lot of issues in setting up test environments to attempt fixing issues. Is there an easy way to do it? |
It's best to follow the steps outlined here for the best way to set up your environment (including |
Thanks! Will give this another go over the weekend then :) |
unassigning due to lack of activity. |
I think the message is pretty clear now. |
thanks for checking if this is still valid @iuliazidaru! However I think the error is still not very user friendly and it would be good if we could catch it better in the |
@javabster Please assign the issue to me. |
Information
What is the current behavior?
If a filename without extension is passed to the function
dag_drawer
, this line reports two errors:This is confusing because the second error thrown by Qiskit is not the cause of the problem.
Steps to reproduce the problem
Try
dag_drawer(dag, filename='abc')
What is the expected behavior?
Make the error catching better.
Suggested solutions
We could either catch this error by reading and filtering the error message, or we could check the existence of the filename's extension, and provide a default one.
The text was updated successfully, but these errors were encountered: