forked from Qiskit/qiskit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix deprecation warning of unscheduled circuits in timeline drawer
The warning was previously emitted with a `stacklevel` that blamed the caller of `warnings.warn`, which would not be shown to users with the default warning filters. This moves the stack level up to blame the caller of `timeline_drawer`.
- Loading branch information
1 parent
4e49a56
commit 4eb84cb
Showing
3 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
releasenotes/notes/fix-timeline-draw-unscheduled-warning-873f7a24c6b51e2c.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
deprecations: | ||
- | | ||
Passing a circuit to :func:`qiskit.visualization.timeline_drawer` that does not have scheduled | ||
node start-time information is deprecated. Only circuits that have gone through one of the | ||
scheduling analysis passes (for example :class:`.ALAPScheduleAnalysis` or | ||
:class:`.ASAPScheduleAnalysis`) can be visualised. If you have used one of the old-style | ||
scheduling passes (for example :class:`.ALAPSchedule` or :class:`.ASAPSchedule`), you can | ||
propagate the scheduling information by running:: | ||
from qiskit import transpile | ||
from qiskit.transpiler import InstructionDurations | ||
scheduled = transpile( | ||
my_old_style_circuit, | ||
optimization_level=0, | ||
scheduling_method="alap", | ||
instruction_durations=InstructionDurations(), | ||
) | ||
This behaviour was previously intended to be deprecated in Qiskit 0.37, but due to a bug in the | ||
warning, it was not displayed to users until now. The behaviour will be removed in Qiskit 1.0. |