Skip to content

Add default line length for jupyter#1400

Merged
mtreinish merged 4 commits into
Qiskit:masterfrom
mtreinish:fix-jupyter-line-length
Dec 4, 2018
Merged

Add default line length for jupyter#1400
mtreinish merged 4 commits into
Qiskit:masterfrom
mtreinish:fix-jupyter-line-length

Conversation

@mtreinish
Copy link
Copy Markdown
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
Copy Markdown
Member

1ucian0 commented Dec 3, 2018

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

2018-12-03 12 21 46

Copy link
Copy Markdown
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
Copy Markdown
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