Skip to content

Sccarda/python docs update#3131

Merged
ScottCarda-MS merged 28 commits intomainfrom
sccarda/PythonDocsUpdate
Apr 20, 2026
Merged

Sccarda/python docs update#3131
ScottCarda-MS merged 28 commits intomainfrom
sccarda/PythonDocsUpdate

Conversation

@ScottCarda-MS
Copy link
Copy Markdown
Contributor

@ScottCarda-MS ScottCarda-MS commented Apr 17, 2026

This is a fairly large PR to over-hall the doc strings in the qsharp python package. This standardizes the doc string format to use the Sphynx syntax recognized by our documentation-generating/publishing pipeline.

Since this is a large refactoring, I recommend reviewing the changes via commit. The some commits that add new documentation content are:

You can also take a look at the preview of the generated docs here:
https://review.learn.microsoft.com/en-us/python/qsharp/qsharp?view=qsharp-py&branch=pr-en-us-105

Notes:

  • While this PR does update and standardize some qdk package doc strings, the package as a whole is not yet ready for generated documentation pages. Updating these doc strings in code is still useful as these doc strings appear on hover in development.
  • There are some structural changes to our API that are needed to make public some types and functions. Until this is done some doc references will be broken xref links. These are already present in our documentation. A future PR will be used to update our API to make the relevant content public and accessible to the doc-gen tool to fix these links.

@ScottCarda-MS ScottCarda-MS marked this pull request as ready for review April 17, 2026 23:17
@ScottCarda-MS ScottCarda-MS requested a review from Copilot April 20, 2026 16:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR standardizes Python docstrings across the qsharp and qdk Python packages to use Sphinx/reST field-list syntax, improving the generated documentation output and hover help in editors.

Changes:

  • Refactors module/class/function docstrings to Sphinx/reST format (:param:, :return:, :rtype:, :raises:) across qsharp and qdk.
  • Clarifies and expands several public-facing docstrings (interop layers, estimator params types, noisy simulator stubs).
  • Adds/updates small packaging hygiene items (e.g., new ignores in .gitignore, __all__ in qsharp.interop.qiskit).

Reviewed changes

Copilot reviewed 40 out of 41 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
source/qdk_package/src/qdk/simulation.py Adds module-level Sphinx-style documentation for simulation utilities.
source/qdk_package/src/qdk/qsharp.py Expands module docstring describing qdk.qsharp re-export behavior.
source/qdk_package/src/qdk/qiskit.py Adjusts Sphinx cross-references in the Qiskit shim docstring.
source/qdk_package/src/qdk/openqasm.py Expands module docstring describing OpenQASM re-export/shim behavior.
source/qdk_package/src/qdk/estimator.py Expands module docstring describing estimator re-export/shim behavior.
source/qdk_package/src/qdk/cirq.py Updates module docstring to describe re-export and installation extra.
source/qdk_package/src/qdk/azure/qiskit.py Fixes example formatting to use reST literal block marker.
source/qdk_package/src/qdk/azure/cirq.py Fixes example formatting to use reST literal block marker.
source/qdk_package/src/qdk/azure/init.py Updates docstring formatting and adds a clearer usage example block.
source/qdk_package/src/qdk/init.py Rewrites top-level package docstring into reST-friendly bullets.
source/pip/qsharp/utils/_utils.py Standardizes return documentation (:return:/:rtype:).
source/pip/qsharp/openqasm/_run.py Converts to Sphinx field-list docstring and clarifies kwargs/options.
source/pip/qsharp/openqasm/_import.py Converts docstring to Sphinx field-list syntax and clarifies kwargs.
source/pip/qsharp/openqasm/_estimate.py Converts docstring to Sphinx field-list syntax and clarifies kwargs.
source/pip/qsharp/openqasm/_compile.py Converts docstring to Sphinx field-list syntax; minor formatting tweaks.
source/pip/qsharp/openqasm/_circuit.py Converts docstring to Sphinx field-list syntax and documents new options.
source/pip/qsharp/noisy_simulator/_noisy_simulator.pyi Updates stub docstrings to Sphinx field-list style.
source/pip/qsharp/interop/qiskit/jobs/qsjobset.py Adds/standardizes class and method docstrings in Sphinx style.
source/pip/qsharp/interop/qiskit/jobs/qsjob.py Adds/standardizes class/method docstrings; improves constructor docs.
source/pip/qsharp/interop/qiskit/backends/re_backend.py Renames kwargs plumbing (**options) and standardizes docstrings.
source/pip/qsharp/interop/qiskit/backends/qsharp_backend.py Renames kwargs plumbing (**options) and standardizes docstrings.
source/pip/qsharp/interop/qiskit/backends/qirtarget.py Converts docstrings to Sphinx field-list syntax.
source/pip/qsharp/interop/qiskit/backends/neutral_atom_target.py Converts docstrings to Sphinx field-list syntax.
source/pip/qsharp/interop/qiskit/backends/neutral_atom_backend.py Standardizes backend docstrings and kwargs naming (**options).
source/pip/qsharp/interop/qiskit/backends/backend_base.py Updates base backend docstrings to Sphinx field-list syntax.
source/pip/qsharp/interop/qiskit/init.py Updates package docstring, improves xrefs, and defines __all__.
source/pip/qsharp/interop/cirq/_result.py Converts function/class docs to Sphinx field-list syntax.
source/pip/qsharp/interop/cirq/_neutral_atom.py Converts docs to Sphinx style and reformats a long expression.
source/pip/qsharp/interop/cirq/init.py Adjusts module docstring formatting and exports list.
source/pip/qsharp/interop/init.py Adds a brief module docstring for the interop package.
source/pip/qsharp/estimator/_estimator.py Adds/expands estimator parameter docstrings throughout.
source/pip/qsharp/_simulation.py Converts run_qir docstring to Sphinx field-list style.
source/pip/qsharp/_qsharp.py Adds/updates docstrings across API surface for Sphinx generation.
source/pip/qsharp/_native.pyi Updates stub docstrings to Sphinx style (notes, params, returns).
source/pip/qsharp/_http.py Converts docstring to Sphinx field-list style.
source/pip/qsharp/_fs.py Converts filesystem helper docstrings to Sphinx field-list style.
source/pip/qsharp/_device/_device.py Converts device API docstrings to Sphinx field-list style.
source/pip/qsharp/_device/_atom/_scheduler.py Refactors docstrings from “Attributes/Args” to reST paragraphs/fields.
source/pip/qsharp/_device/_atom/init.py Standardizes return docstring field (:return:).
source/pip/qsharp/_adaptive_pass.py Converts run docstring to Sphinx field-list style.
.gitignore Ignores generated Python doc output directories.

Comment thread source/pip/qsharp/openqasm/_estimate.py Outdated
Comment thread source/pip/qsharp/openqasm/_estimate.py
Comment thread source/pip/qsharp/openqasm/_compile.py Outdated
Comment thread source/pip/qsharp/openqasm/_compile.py
Comment thread source/pip/qsharp/interop/qiskit/backends/backend_base.py
Comment thread source/pip/qsharp/interop/cirq/__init__.py
Comment thread source/pip/qsharp/openqasm/_run.py Outdated
Comment thread source/pip/qsharp/openqasm/_run.py Outdated
Comment thread source/pip/qsharp/openqasm/_circuit.py Outdated
Comment thread source/pip/qsharp/_native.pyi Outdated
Comment thread .gitignore
Comment thread source/pip/qsharp/_native.pyi Outdated
Comment thread source/pip/qsharp/_qsharp.py Outdated
Comment thread source/pip/qsharp/estimator/_estimator.py
@ScottCarda-MS ScottCarda-MS added this pull request to the merge queue Apr 20, 2026
Merged via the queue into main with commit 491aa15 Apr 20, 2026
12 checks passed
@ScottCarda-MS ScottCarda-MS deleted the sccarda/PythonDocsUpdate branch April 20, 2026 19:55
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.

5 participants