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

Reorganize API docs #22

Merged
merged 2 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/apidocs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
**********************************
``qiskit-addon-mpf`` API reference
**********************************

.. toctree::
:maxdepth: 1

qiskit_addon_mpf.static
10 changes: 0 additions & 10 deletions docs/apidocs/qiskit_addon_mpf.rst

This file was deleted.

26 changes: 21 additions & 5 deletions docs/apidocs/qiskit_addon_mpf.static.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
===========
Static MPFs
===========

.. _qiskit_addon_mpf-static:
============================================
Static MPFs (:mod:`qiskit_addon_mpf.static`)
============================================

.. automodule:: qiskit_addon_mpf.static
:no-members:
:no-inherited-members:
:no-special-members:

.. currentmodule:: qiskit_addon_mpf.static

Linear system of equations utilities
------------------------------------

.. autoclass:: LSE
.. autofunction:: setup_lse

Exact static MPF coefficients
-----------------------------

.. autofunction:: setup_exact_model

Approximate static MPF coefficients
-----------------------------------

.. autofunction:: setup_approximate_model
20 changes: 20 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"sphinx.ext.intersphinx",
"matplotlib.sphinxext.plot_directive",
"sphinx_copybutton",
"sphinx_reredirects",
"reno.sphinxext",
"nbsphinx",
"qiskit_sphinx_theme",
Expand Down Expand Up @@ -110,6 +111,25 @@
plot_working_directory = "."
plot_html_show_source_link = False

# ----------------------------------------------------------------------------------
# Redirects
# ----------------------------------------------------------------------------------

_inlined_apis = [
("qiskit_addon_mpf.static", "LSE"),
("qiskit_addon_mpf.static", "setup_lse"),
("qiskit_addon_mpf.static", "setup_exact_model"),
("qiskit_addon_mpf.static", "setup_approximate_model"),
]

redirects = {
"apidocs/qiskit_addon_mpf": "./index.html",
**{
f"stubs/{module}.{name}": f"../apidocs/{module}.html#{module}.{name}"
for module, name in _inlined_apis
},
}

# ----------------------------------------------------------------------------------
# Source code links
# ----------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ License
Tutorials <tutorials/index>
How-To Guides <how_tos/index>
Explanations <explanations/index>
API Reference <apidocs/qiskit_addon_mpf>
API Reference <apidocs/index>
GitHub <https://github.com/Qiskit/qiskit-addon-mpf>
Release Notes <release-notes>
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ docs = [
"sphinx-design",
"sphinx-autodoc-typehints",
"sphinx-copybutton",
"sphinx_reredirects",
"nbsphinx>=0.9.4",
"reno>=4.1",
]
Expand Down
21 changes: 4 additions & 17 deletions qiskit_addon_mpf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,7 @@
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""Multi-product formulas.

.. currentmodule:: qiskit_addon_mpf

.. autosummary::
:toctree: ../stubs/
:nosignatures:

Submodules
==========

.. autosummary::
:toctree:

static

"""
# Warning: this module is not documented and it does not have an RST file.
# If we ever publicly expose interfaces users can import from this module,
# we should set up its RST file.
"""Multi-product formulas."""
34 changes: 2 additions & 32 deletions qiskit_addon_mpf/static/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,8 @@
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""Static MPFs.

.. currentmodule:: qiskit_addon_mpf.static

Linear system of equations utilities
------------------------------------

.. autosummary::
:toctree: ../stubs/
:nosignatures:

LSE
setup_lse

Exact static MPF coefficients
-----------------------------

.. autosummary::
:toctree: ../stubs/
:nosignatures:

setup_exact_model

Approximate static MPF coefficients
-----------------------------------

.. autosummary::
:toctree: ../stubs/
:nosignatures:

setup_approximate_model
"""
# Reminder: update the RST file in docs/apidocs when adding new interfaces.
"""Static MPFs."""

from .approximate import setup_approximate_model
from .exact import setup_exact_model
Expand Down