From dfb6ec86b4087e23a40f7e8336a755422bf95625 Mon Sep 17 00:00:00 2001 From: Luciano Bello Date: Tue, 24 Dec 2024 15:54:52 +0100 Subject: [PATCH 1/2] Deprecate show_idle and show_barrier in favor of idle_wires and plot_barriers --- qiskit/pulse/schedule.py | 2 +- qiskit/visualization/pulse_v2/interface.py | 2 +- qiskit/visualization/timeline/interface.py | 4 ++-- releasenotes/notes/followup_11878-839c93ab3029d315.yaml | 6 ++++++ 4 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/followup_11878-839c93ab3029d315.yaml diff --git a/qiskit/pulse/schedule.py b/qiskit/pulse/schedule.py index d4753847b5d2..7b46734a66ba 100644 --- a/qiskit/pulse/schedule.py +++ b/qiskit/pulse/schedule.py @@ -1637,7 +1637,7 @@ def wrapper(*args, **kwargs): return decorator -@deprecate_arg("show_barriers", new_alias="plot_barriers", since="1.1.0", pending=True) +@deprecate_arg("show_barriers", new_alias="plot_barriers", since="1.1.0") @_common_method(Schedule, ScheduleBlock) def draw( self, diff --git a/qiskit/visualization/pulse_v2/interface.py b/qiskit/visualization/pulse_v2/interface.py index 6feb4bc83339..50053a8f0ba3 100644 --- a/qiskit/visualization/pulse_v2/interface.py +++ b/qiskit/visualization/pulse_v2/interface.py @@ -32,7 +32,7 @@ @deprecate_pulse_dependency(moving_to_dynamics=True) -@deprecate_arg("show_barrier", new_alias="plot_barrier", since="1.1.0", pending=True) +@deprecate_arg("show_barrier", new_alias="plot_barrier", since="1.1.0") def draw( program: Union[Waveform, SymbolicPulse, Schedule, ScheduleBlock], style: Optional[Dict[str, Any]] = None, diff --git a/qiskit/visualization/timeline/interface.py b/qiskit/visualization/timeline/interface.py index 686e0fe1d810..c401f142595a 100644 --- a/qiskit/visualization/timeline/interface.py +++ b/qiskit/visualization/timeline/interface.py @@ -30,8 +30,8 @@ from qiskit.utils import deprecate_arg -@deprecate_arg("show_idle", new_alias="idle_wires", since="1.1.0", pending=True) -@deprecate_arg("show_barriers", new_alias="plot_barriers", since="1.1.0", pending=True) +@deprecate_arg("show_idle", new_alias="idle_wires", since="1.1.0") +@deprecate_arg("show_barriers", new_alias="plot_barriers", since="1.1.0") def draw( program: circuit.QuantumCircuit, style: Optional[Dict[str, Any]] = None, diff --git a/releasenotes/notes/followup_11878-839c93ab3029d315.yaml b/releasenotes/notes/followup_11878-839c93ab3029d315.yaml new file mode 100644 index 000000000000..2e73e5a8bbe0 --- /dev/null +++ b/releasenotes/notes/followup_11878-839c93ab3029d315.yaml @@ -0,0 +1,6 @@ +--- +deprecations_visualization: + - | + The parameters ``show_idle`` and ``show_barrier`` in the timeline drawers had been replaced by ``idle_wires`` and ``plot_barriers`` + respectively to match the circuit drawer parameters. Their previous names will be removed in Qiskit 2.0. + The new parameters are fully equivalent. From 5b9a6c777a6f6b50468396cc6116fecbe054ee97 Mon Sep 17 00:00:00 2001 From: Luciano Bello Date: Tue, 24 Dec 2024 16:03:37 +0100 Subject: [PATCH 2/2] skip deprecation for pulses --- qiskit/pulse/schedule.py | 2 +- qiskit/visualization/pulse_v2/interface.py | 2 -- qiskit/visualization/timeline/interface.py | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/qiskit/pulse/schedule.py b/qiskit/pulse/schedule.py index 7b46734a66ba..e6e5141ea646 100644 --- a/qiskit/pulse/schedule.py +++ b/qiskit/pulse/schedule.py @@ -1637,7 +1637,7 @@ def wrapper(*args, **kwargs): return decorator -@deprecate_arg("show_barriers", new_alias="plot_barriers", since="1.1.0") +@deprecate_arg("show_barriers", new_alias="plot_barriers", since="1.4") @_common_method(Schedule, ScheduleBlock) def draw( self, diff --git a/qiskit/visualization/pulse_v2/interface.py b/qiskit/visualization/pulse_v2/interface.py index 50053a8f0ba3..2594b9797df9 100644 --- a/qiskit/visualization/pulse_v2/interface.py +++ b/qiskit/visualization/pulse_v2/interface.py @@ -27,12 +27,10 @@ from qiskit.visualization.exceptions import VisualizationError from qiskit.visualization.pulse_v2 import core, device_info, stylesheet, types from qiskit.exceptions import MissingOptionalLibraryError -from qiskit.utils import deprecate_arg from qiskit.utils.deprecate_pulse import deprecate_pulse_dependency @deprecate_pulse_dependency(moving_to_dynamics=True) -@deprecate_arg("show_barrier", new_alias="plot_barrier", since="1.1.0") def draw( program: Union[Waveform, SymbolicPulse, Schedule, ScheduleBlock], style: Optional[Dict[str, Any]] = None, diff --git a/qiskit/visualization/timeline/interface.py b/qiskit/visualization/timeline/interface.py index c401f142595a..8e9aa8daad9a 100644 --- a/qiskit/visualization/timeline/interface.py +++ b/qiskit/visualization/timeline/interface.py @@ -30,8 +30,8 @@ from qiskit.utils import deprecate_arg -@deprecate_arg("show_idle", new_alias="idle_wires", since="1.1.0") -@deprecate_arg("show_barriers", new_alias="plot_barriers", since="1.1.0") +@deprecate_arg("show_idle", new_alias="idle_wires", since="1.4") +@deprecate_arg("show_barriers", new_alias="plot_barriers", since="1.4") def draw( program: circuit.QuantumCircuit, style: Optional[Dict[str, Any]] = None,