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

Replace raising QiskitError by AlgorithmError #41

Merged
merged 2 commits into from
Aug 15, 2023
Merged

Replace raising QiskitError by AlgorithmError #41

merged 2 commits into from
Aug 15, 2023

Conversation

woodsp-ibm
Copy link
Member

@woodsp-ibm woodsp-ibm commented Aug 10, 2023

Summary

In a couple of places QiskitError was directly raised. Normally the algorithms raise an AlgorithmError so given algorithms has been moved out of Qiskit, to better distinguish the exception to algorithms, and to make it consistent with elsewhere I changed the couple of places to raise AlgorithmError instead.

Resolves #30

Details and comments

As AlgorithmError extends QiskitError its unlikely that this has any impact on anyone. I added a release note in case. Indeed the test_pvqd unit test, that checked an error condition continued to work unchanged - though I did change it to AlgorithmError as that is really what should be expected now.

Of course I ran tests, and built html locally and it was all good.... such a small change.... I did not run lint!

tools/check_copyright.py:1:0: R0401: Cyclic import (qiskit_algorithms -> qiskit_algorithms.minimum_eigensolvers -> qiskit_algorithms.minimum_eigensolvers.adapt_vqe) (cyclic-import)

@coveralls
Copy link

Pull Request Test Coverage Report for Build 5824240848

  • 4 of 7 (57.14%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 89.994%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit_algorithms/minimum_eigensolvers/adapt_vqe.py 1 2 50.0%
qiskit_algorithms/optimizers/snobfit.py 1 2 50.0%
qiskit_algorithms/time_evolvers/pvqd/pvqd.py 2 3 66.67%
Totals Coverage Status
Change from base Build 5692627482: 0.0%
Covered Lines: 6395
Relevant Lines: 7106

💛 - Coveralls

Copy link
Collaborator

@Cryoris Cryoris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Cryoris Cryoris merged commit 9964449 into qiskit-community:main Aug 15, 2023
13 checks passed
@woodsp-ibm woodsp-ibm deleted the exception branch August 15, 2023 13:28
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.

Raising QiskitError
3 participants