Add exceptions to API documentation#10522
Conversation
|
One or more of the the following people are requested to review this:
|
ccbc524 to
bf42192
Compare
| The (1 - alpha) confidence interval of the specified kind. | ||
|
|
||
| Raises: | ||
| AquaError: If 'mle' is not in self._ret.keys() (i.e. `run` was not called yet). |
There was a problem hiding this comment.
Obviously AquaError is wrong here, but as best as I could tell it was already out-of-date when it was merged in #5517, which seems to have involved some refactoring from old Aqua code that I couldn't be bothered to track down.
There was a problem hiding this comment.
:) I happened to notice this too in qiskit-algorithms as that was prepared for release and it was taken care of there. I figured it had been here for years like this since it was brought over from Aqua and never noticed, and as it was not causing an issue and with algorithms set to be removed I.... (was the same "fix" we did there!)
There was a problem hiding this comment.
Ah, that's good that you'd spotted it on the new repo as well. I had a go at tracking down a point where the result object might have actually raised an error if mle wasn't present, but once it got into needing to find the base of refactored history from Aqua, I just gave up...
There was a problem hiding this comment.
This is from an old (very old) version of the code, where the algorithm classes were still stateful. Back then you had to run the algorithm to generate some info and then this enabled some post processing options.
The big change here is that `QiskitError` is added to the API documentation, which causes 400--500 previously failing Sphinx lookups (stemming from "Raises:" documentation) to now succeed. This commit also corrects several other places where exceptions were not being fully documented (and in several cases makes the imports more convenient as well), and corrects a couple of places with incorrect references to exceptions.
bf42192 to
a2fdddb
Compare
Pull Request Test Coverage Report for Build 5837187759
💛 - Coveralls |
Eric-Arellano
left a comment
There was a problem hiding this comment.
This looks great! Thanks Jake.
The big change here is that `QiskitError` is added to the API documentation, which causes 400--500 previously failing Sphinx lookups (stemming from "Raises:" documentation) to now succeed. This commit also corrects several other places where exceptions were not being fully documented (and in several cases makes the imports more convenient as well), and corrects a couple of places with incorrect references to exceptions. (cherry picked from commit 982807e) # Conflicts: # docs/apidocs/exceptions.rst # qiskit/dagcircuit/__init__.py # qiskit/passmanager/__init__.py # qiskit/transpiler/__init__.py
The big change here is that `QiskitError` is added to the API documentation, which causes 400--500 previously failing Sphinx lookups (stemming from "Raises:" documentation) to now succeed. This commit also corrects several other places where exceptions were not being fully documented (and in several cases makes the imports more convenient as well), and corrects a couple of places with incorrect references to exceptions.
* Add exceptions to API documentation (#10522) The big change here is that `QiskitError` is added to the API documentation, which causes 400--500 previously failing Sphinx lookups (stemming from "Raises:" documentation) to now succeed. This commit also corrects several other places where exceptions were not being fully documented (and in several cases makes the imports more convenient as well), and corrects a couple of places with incorrect references to exceptions. (cherry picked from commit 982807e) # Conflicts: # docs/apidocs/exceptions.rst # qiskit/dagcircuit/__init__.py # qiskit/passmanager/__init__.py # qiskit/transpiler/__init__.py * Fix merge conflicts This commit fixes several merge conflicts in the backport. They were mostly minor differences between main and the stable branch that needed to be corrected. --------- Co-authored-by: Jake Lishman <jake.lishman@ibm.com> Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Summary
The big change here is that
QiskitErroris added to the API documentation, which causes 400--500 previously failing Sphinx lookups (stemming from "Raises:" documentation) to now succeed. This commit also corrects several other places where exceptions were not being fully documented (and in several cases makes the imports more convenient as well), and corrects a couple of places with incorrect references to exceptions.Details and comments
This stemmed from an idle thought I had to turn on
nitpickyin the Sphinx configuration, which emits a warning if any cross-reference fails to resolve. That's probably a longer-term effort: including the ones fixed by this PR, there were 2791 warnings. It might cause some more nuisances with release notes and removals, but we'll have to see how that goes if we decide to actually turn the option on. The principle of making sure that most of our references resolve is good regardless, though.qiskit.algorithmsandqiskit.opfloware both deprecated but emit sizeable numbers of references, and the strategy here is probably just going to be to leave them be, since they're scheduled for removal from this repo anyway.