unitaryfund / mitiq

Mitiq is an open source toolkit for implementing error mitigation techniques on most current intermediate-scale quantum computers.
https://mitiq.readthedocs.io
GNU General Public License v3.0
358 stars 157 forks source link

Understand unwanted inclusion of docstring of imported function #639

Closed nathanshammah closed 3 years ago

nathanshammah commented 3 years ago

Pre-Report Checklist

Issue Description

The pull request on the first part of the Clifford Data Regression methods, #601 has had a test of the docs failing apparently due to a docstring in which the actual code run of the example does not match the expected outcome. However, the docstring does not seem present in the Mitiq codebase, but would seem to be picked up by some backtracking of imported python / numpy functions.

Moreover, the API-doc showed in the docstring a part that would seem to belong to the imported function.

How to Reproduce

The CI error is shown in https://github.com/unitaryfund/mitiq/pull/601/checks?check_run_id=2254832392.

The docstring being picked up by Sphinx in the API-doc was due to the code in #601 by @L-P-B before the changes in the code base at this commit by @maikthomas.

The inclusion of the docstring could be reproduced by running make docs locally before the commit above, which builds the documentation with sphinx. Here is a screenshot of the API-doc:

ctd
rmlarose commented 3 years ago

Closing as the issue is no longer present - I think this is outdated.