-
Notifications
You must be signed in to change notification settings - Fork 61
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
Allow Circuit.draw
to display string directly
#1434
Conversation
for more information, see https://pre-commit.ci
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1434 +/- ##
==========================================
- Coverage 97.11% 97.09% -0.03%
==========================================
Files 81 81
Lines 11679 11684 +5
==========================================
+ Hits 11342 11344 +2
- Misses 337 340 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@renatomello following Python standards, I'd propose to use However, notice that this would be a breaking change, as all the assignment to the result of So, we could also schedule |
for more information, see https://pre-commit.ci
@renatomello a9bca8 is exactly what I meant. I'm not sure why you're prepending the underscores: I know that Other than that, the only bit missing to this PR is to convert the already converted usages, since now |
right now |
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right now
print(circuit.draw())
still works as before andcircuit.display
works in-place, However,circuit.draw
raises a warning saying that it will work in-place in the future.
Yes, that's correct, I perfectly agree with you.
It's just that some statements print(circuit.draw())
have been replaced by just circuit.draw()
. While, since you're now preserving the old behavior, they should be unchanged (or invoke .display()
instead)
Co-authored-by: Alessandro Candido <[email protected]>
This PR proposes enabling the
Circuit.draw
method to print the circuit without having to wrap it inside aprint()
call. Example:Checklist: