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

remove draw(..., line_length, ...) (deprecated after #3108) #4507

Merged
merged 8 commits into from
Jun 18, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions qiskit/circuit/quantumcircuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ def qasm(self, formatted=False, filename=None):
return string_temp

def draw(self, output=None, scale=0.7, filename=None, style=None,
interactive=False, line_length=None, plot_barriers=True,
interactive=False, plot_barriers=True,
reverse_bits=False, justify=None, vertical_compression='medium', idle_wires=True,
with_layout=True, fold=None, ax=None, initial_state=False, cregbundle=False):
"""Draw the quantum circuit.
Expand Down Expand Up @@ -798,13 +798,6 @@ def draw(self, output=None, scale=0.7, filename=None, style=None,
supporting this). Note when used with either the `text` or the
`latex_source` output type this has no effect and will be
silently ignored.
line_length (int): Deprecated; see `fold` which supersedes this
option. Sets the length of the lines generated by `text` output
type. This is useful when the drawing does not fit in the console.
If None (default), it will try to guess the console width using
``shutil.get_terminal_size()``. However, if you're running in
jupyter, the default line length is set to 80 characters. If you
don't want pagination at all, set ``line_length=-1``.
reverse_bits (bool): When set to True, reverse the bit order inside
registers for the output visualization.
plot_barriers (bool): Enable/disable drawing barriers in the output
Expand Down Expand Up @@ -974,7 +967,6 @@ def draw(self, output=None, scale=0.7, filename=None, style=None,
filename=filename, style=style,
output=output,
interactive=interactive,
line_length=line_length,
plot_barriers=plot_barriers,
reverse_bits=reverse_bits,
justify=justify,
Expand Down
15 changes: 1 addition & 14 deletions qiskit/visualization/circuit_visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def circuit_drawer(circuit,
style=None,
output=None,
interactive=False,
line_length=None,
plot_barriers=True,
reverse_bits=False,
justify=None,
Expand Down Expand Up @@ -99,13 +98,6 @@ def circuit_drawer(circuit,
supporting this). Note when used with either the `text` or the
`latex_source` output type this has no effect and will be silently
ignored.
line_length (int): Deprecated, see `fold` which supersedes this option.
Sets the length of the lines generated by `text` output type.
This useful when the drawing does not fit in the console. If None
(default), it will try to guess the console width using
``shutil.get_terminal_size()``. However, if you're running in
jupyter the default line length is set to 80 characters. If you
don't want pagination at all, set ``line_length=-1``.
reverse_bits (bool): When set to True reverse the bit order inside
registers for the output visualization.
plot_barriers (bool): Enable/disable drawing barriers in the output
Expand Down Expand Up @@ -282,7 +274,6 @@ def circuit_drawer(circuit,

if output == 'text':
return _text_circuit_drawer(circuit, filename=filename,
line_length=line_length,
reverse_bits=reverse_bits,
plot_barriers=plot_barriers,
justify=justify,
Expand Down Expand Up @@ -411,7 +402,7 @@ def qx_color_scheme():
# -----------------------------------------------------------------------------


def _text_circuit_drawer(circuit, filename=None, line_length=None, reverse_bits=False,
def _text_circuit_drawer(circuit, filename=None, reverse_bits=False,
plot_barriers=True, justify=None, vertical_compression='high',
idle_wires=True, with_layout=True, fold=None, initial_state=True,
cregbundle=False):
Expand All @@ -420,7 +411,6 @@ def _text_circuit_drawer(circuit, filename=None, line_length=None, reverse_bits=
Args:
circuit (QuantumCircuit): Input circuit
filename (str): optional filename to write the result
line_length (int): Deprecated. See `fold`.
reverse_bits (bool): Rearrange the bits in reverse order.
plot_barriers (bool): Draws the barriers when they are there.
justify (str) : `left`, `right` or `none`. Defaults to `left`. Says how
Expand Down Expand Up @@ -449,9 +439,6 @@ def _text_circuit_drawer(circuit, filename=None, line_length=None, reverse_bits=
layout = circuit._layout
else:
layout = None
if line_length:
warn('The parameter "line_length" is being replaced by "fold"', DeprecationWarning, 3)
fold = line_length
text_drawing = _text.TextDrawing(qregs, cregs, ops, layout=layout, initial_state=initial_state,
cregbundle=cregbundle)
text_drawing.plotbarriers = plot_barriers
Expand Down