Skip to content
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

Add default line length for jupyter #1400

Merged
merged 4 commits into from
Dec 4, 2018

Conversation

mtreinish
Copy link
Member

Summary

When running the text circuit drawer in jupyter the default line length
was being setting with the get_terminal_size() call. However this was
returning the size of the terminal used to launch jupyter, not the cell
size. So this could cause issues if your terminal is much smaller or
much larger than the cell size. To fix this issue this commit adds a
default of 80 characters for the default line length when running in
jupyter so it'll always fit in the cell.

Details and comments

When running the text circuit drawer in jupyter the default line length
was being setting with the get_terminal_size() call. However this was
returning the size of the terminal used to launch jupyter, not the cell
size. So this could cause issues if your terminal is much smaller or
much larger than the cell size. To fix this issue this commit adds a
default of 80 characters for the default line length when running in
jupyter so it'll always fit in the cell.
@1ucian0
Copy link
Member

1ucian0 commented Dec 3, 2018

What about add horizontal scrolling? What do you think @jaygambetta ?

2018-12-03 12 21 46

Copy link
Member

@1ucian0 1ucian0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add this behavior case in the docstring?

@jaygambetta
Copy link
Member

i am good with what you and @mtreinish decided

@mtreinish mtreinish merged commit 6cf5ad5 into Qiskit:master Dec 4, 2018
@mtreinish mtreinish deleted the fix-jupyter-line-length branch December 4, 2018 16:35
lia-approves pushed a commit to edasgupta/qiskit-terra that referenced this pull request Jul 30, 2019
When running the text circuit drawer in jupyter the default line length
was being setting with the get_terminal_size() call. However this was
returning the size of the terminal used to launch jupyter, not the cell
size. So this could cause issues if your terminal is much smaller or
much larger than the cell size. To fix this issue this commit adds a
default of 80 characters for the default line length when running in
jupyter so it'll always fit in the cell.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants