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

Improve error messages on failed control-flow transpilation #9049

Merged
merged 3 commits into from
Apr 17, 2023

Conversation

jakelishman
Copy link
Member

Summary

As part of this, it became convenient for the Error transpiler pass to be able to accept an arbitrary property_set -> str callable function to generate the message, rather than just relying on fixed formatting strings.

Details and comments

Fix #8921.

The new handling in the Error transpiler pass technically makes this ineligible for backporting, as it's a new feature in a technically public class (albeit not one I think anyone else will necessarily be using). I could make this change stable by making the error message worse, or potentially temporarily making a new internal Error pass purely for this use-case.

As part of this, it became convenient for the `Error` transpiler pass to
be able to accept an arbitrary `property_set -> str` callable function
to generate the message, rather than just relying on fixed formatting
strings.
@jakelishman jakelishman added the Changelog: New Feature Include in the "Added" section of the changelog label Nov 1, 2022
@jakelishman jakelishman requested a review from a team as a code owner November 1, 2022 17:23
@qiskit-bot
Copy link
Collaborator

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

One or more of the the following people are requested to review this:

  • @Qiskit/terra-core

@coveralls
Copy link

coveralls commented Nov 1, 2022

Pull Request Test Coverage Report for Build 4568419805

  • 23 of 24 (95.83%) changed or added relevant lines in 2 files are covered.
  • 180 unchanged lines in 11 files lost coverage.
  • Overall coverage increased (+0.02%) to 85.4%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/transpiler/passes/utils/error.py 6 7 85.71%
Files with Coverage Reduction New Missed Lines %
crates/accelerate/src/sabre_swap/layer.rs 1 96.64%
qiskit/circuit/tools/pi_check.py 1 91.23%
qiskit/transpiler/passes/calibration/pulse_gate.py 1 95.45%
qiskit/pulse/library/waveform.py 3 91.67%
qiskit/pulse/instructions/instruction.py 6 86.09%
qiskit/pulse/transforms/alignments.py 8 94.08%
qiskit/pulse/library/symbolic_pulses.py 16 94.79%
qiskit/pulse/calibration_entries.py 20 87.65%
qiskit/transpiler/target.py 27 94.46%
qiskit/compiler/transpiler.py 31 89.89%
Totals Coverage Status
Change from base Build 4564463001: 0.02%
Covered Lines: 67354
Relevant Lines: 78869

💛 - Coveralls

@jakelishman jakelishman added this to the 0.24.0 milestone Mar 30, 2023
@kdk kdk self-assigned this Apr 6, 2023
@kdk kdk added the mod: transpiler Issues and PRs related to Transpiler label Apr 17, 2023
@kdk kdk added this pull request to the merge queue Apr 17, 2023
Merged via the queue into Qiskit:main with commit f51a93f Apr 17, 2023
@jakelishman jakelishman deleted the controlflow-error-message branch April 17, 2023 23:57
king-p3nguin pushed a commit to king-p3nguin/qiskit-terra that referenced this pull request May 22, 2023
)

* Improve error messages on failed control-flow transpilation

As part of this, it became convenient for the `Error` transpiler pass to
be able to accept an arbitrary `property_set -> str` callable function
to generate the message, rather than just relying on fixed formatting
strings.

* Fix lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: New Feature Include in the "Added" section of the changelog mod: transpiler Issues and PRs related to Transpiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Better error messages for transpiler basis-translation failures
4 participants