{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Adding to the API Documentation\n", "\n", "Documentation is an integral part of every collaborative software project. Good documentation not only encourages users of the package to try out different functionalities, but it also makes maintaining and expanding code significantly easier. Every code contribution to the package must come with appropriate documentation of the API. This guide details how to do this." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Docstrings\n", "\n", "The main form of documentation are docstrings, multi-line comments beneath a class or function definition with a specific syntax, which detail its functionality. This package uses the\n", "[NumPy docstring format](https://numpydoc.readthedocs.io/en/latest/format.html#numpydoc-docstring-guide>). As a rule, all functions which are exposed to the user *must* have appropriate docstrings. Below is an example of a docstring for a probabilistic numerical method." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": true }, "outputs": [], "source": [ "# %load -r 1-163 ../../../src/probnum/linalg/_problinsolve.py\n", "\"\"\"Probabilistic numerical methods for solving linear systems.\n", "\n", "This module provides routines to solve linear systems of equations in a\n", "Bayesian framework. This means that a prior distribution over elements\n", "of the linear system can be provided and is updated with information\n", "collected by the solvers to return a posterior distribution.\n", "\"\"\"\n", "\n", "import warnings\n", "from typing import Callable, Dict, Optional, Tuple, Union\n", "\n", "import numpy as np\n", "import scipy.sparse\n", "\n", "import probnum # pylint: disable=unused-import\n", "from probnum import linops, randvars, utils\n", "from probnum.linalg.solvers.matrixbased import SymmetricMatrixBasedSolver\n", "from probnum.typing import LinearOperatorArgType\n", "\n", "# pylint: disable=too-many-branches\n", "\n", "\n", "def problinsolve(\n", " A: Union[\n", " LinearOperatorArgType,\n", " \"randvars.RandomVariable[LinearOperatorArgType]\",\n", " ],\n", " b: Union[np.ndarray, \"randvars.RandomVariable[np.ndarray]\"],\n", " A0: Optional[\n", " Union[\n", " LinearOperatorArgType,\n", " \"randvars.RandomVariable[LinearOperatorArgType]\",\n", " ]\n", " ] = None,\n", " Ainv0: Optional[\n", " Union[\n", " LinearOperatorArgType,\n", " \"randvars.RandomVariable[LinearOperatorArgType]\",\n", " ]\n", " ] = None,\n", " x0: Optional[Union[np.ndarray, \"randvars.RandomVariable[np.ndarray]\"]] = None,\n", " assume_A: str = \"sympos\",\n", " maxiter: Optional[int] = None,\n", " atol: float = 10 ** -6,\n", " rtol: float = 10 ** -6,\n", " callback: Optional[Callable] = None,\n", " **kwargs\n", ") -> Tuple[\n", " \"randvars.RandomVariable[np.ndarray]\",\n", " \"randvars.RandomVariable[linops.LinearOperator]\",\n", " \"randvars.RandomVariable[linops.LinearOperator]\",\n", " Dict,\n", "]:\n", " r\"\"\"Solve the linear system :math:`A x = b` in a Bayesian framework.\n", "\n", " Probabilistic linear solvers infer solutions to problems of the form\n", "\n", " .. math:: Ax=b,\n", "\n", " where :math:`A \\in \\mathbb{R}^{n \\times n}` and :math:`b \\in \\mathbb{R}^{n}`.\n", " They return a probability measure which quantifies uncertainty in the output arising\n", " from finite computational resources or stochastic input. This solver can take prior\n", " information either on the linear operator :math:`A` or its inverse :math:`H=A^{\n", " -1}` in the form of a random variable ``A0`` or ``Ainv0`` and outputs a posterior\n", " belief about :math:`A` or :math:`H`. This code implements the method described in\n", " Wenger et al. [1]_ based on the work in Hennig et al. [2]_.\n", "\n", " Parameters\n", " ----------\n", " A :\n", " *shape=(n, n)* -- A square linear operator (or matrix). Only matrix-vector\n", " products :math:`v \\mapsto Av` are used internally.\n", " b :\n", " *shape=(n, ) or (n, nrhs)* -- Right-hand side vector, matrix or random\n", " variable in :math:`A x = b`.\n", " A0 :\n", " *shape=(n, n)* -- A square matrix, linear operator or random variable\n", " representing the prior belief about the linear operator :math:`A`.\n", " Ainv0 :\n", " *shape=(n, n)* -- A square matrix, linear operator or random variable\n", " representing the prior belief about the inverse :math:`H=A^{-1}`. This can be\n", " viewed as a preconditioner.\n", " x0 :\n", " *shape=(n, ) or (n, nrhs)* -- Prior belief for the solution of the linear\n", " system. Will be ignored if ``Ainv0`` is given.\n", " assume_A :\n", " Assumptions on the linear operator which can influence solver choice and\n", " behavior. The available options are (combinations of)\n", "\n", " ==================== =========\n", " generic matrix ``gen``\n", " symmetric ``sym``\n", " positive definite ``pos``\n", " (additive) noise ``noise``\n", " ==================== =========\n", "\n", " maxiter :\n", " Maximum number of iterations. Defaults to :math:`10n`, where :math:`n` is the\n", " dimension of :math:`A`.\n", " atol :\n", " Absolute convergence tolerance.\n", " rtol :\n", " Relative convergence tolerance.\n", " callback :\n", " User-supplied function called after each iteration of the linear solver. It is\n", " called as ``callback(xk, Ak, Ainvk, sk, yk, alphak, resid, **kwargs)`` and can\n", " be used to return quantities from the iteration. Note that depending on the\n", " function supplied, this can slow down the solver considerably.\n", " kwargs : optional\n", " Optional keyword arguments passed onto the solver iteration.\n", "\n", " Returns\n", " -------\n", " x :\n", " Approximate solution :math:`x` to the linear system. Shape of the return matches\n", " the shape of ``b``.\n", " A :\n", " Posterior belief over the linear operator.\n", " Ainv :\n", " Posterior belief over the linear operator inverse :math:`H=A^{-1}`.\n", " info :\n", " Information on convergence of the solver.\n", "\n", " Raises\n", " ------\n", " ValueError\n", " If size mismatches detected or input matrices are not square.\n", " LinAlgError\n", " If the matrix ``A`` is singular.\n", " LinAlgWarning\n", " If an ill-conditioned input ``A`` is detected.\n", "\n", " Notes\n", " -----\n", " For a specific class of priors the posterior mean of :math:`x_k=Hb` coincides with\n", " the iterates of the conjugate gradient method. The matrix-based view taken here\n", " recovers the solution-based inference of :func:`bayescg` [3]_.\n", "\n", " References\n", " ----------\n", " .. [1] Wenger, J. and Hennig, P., Probabilistic Linear Solvers for Machine Learning,\n", " *Advances in Neural Information Processing Systems (NeurIPS)*, 2020\n", " .. [2] Hennig, P., Probabilistic Interpretation of Linear Solvers, *SIAM Journal on\n", " Optimization*, 2015, 25, 234-260\n", " .. [3] Bartels, S. et al., Probabilistic Linear Solvers: A Unifying View,\n", " *Statistics and Computing*, 2019\n", "\n", " See Also\n", " --------\n", " bayescg : Solve linear systems with prior information on the solution.\n", "\n", " Examples\n", " --------\n", " >>> import numpy as np\n", " >>> np.random.seed(1)\n", " >>> n = 20\n", " >>> A = np.random.rand(n, n)\n", " >>> A = 0.5 * (A + A.T) + 5 * np.eye(n)\n", " >>> b = np.random.rand(n)\n", " >>> x, A, Ainv, info = problinsolve(A=A, b=b)\n", " >>> print(info[\"iter\"])\n", " 9\n", " \"\"\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**General Rules**\n", "\n", "- Cover `Parameters`, `Returns`, `Raises` and `Examples`, if applicable, in every publicly visible docstring---in that order.\n", "- Examples are tested via doctest. Ensure `doctest` does not fail by running the test suite.\n", "- Include appropriate `References`, in particular for probabilistic numerical methods.\n", "- Do not use docstrings as a clutch for spaghetti code!\n", "\n", "**Parameters**\n", "\n", "- Parameter types are automatically documented via type hints in the function signature.\n", "- Always provide shape hints for objects with a `.shape` attribute in the following form:\n", "\n", "```python\n", "\"\"\"\n", "Parameters\n", "----------\n", "arr :\n", " *(shape=(m, ) or (m, n))* -- Parameter array of an example function.\n", "\"\"\"\n", "```\n", "\n", "- Hyperparameters should have default values and explanations on how to choose them.\n", "- For callables provide the expected signature as part of the docstring: `foobar(x, y, z, \\*\\*kwargs)`. Backslashes remove semantic meaning from special characters.\n", "\n", "**Style**\n", "\n", "- Stick to the imperative style of writing in the docstring header (i.e.: first line).\n", " - Yes: \"Compute the value\". \n", " - No: \"This function computes the value / Let's compute the value\".\n", " \n", " The rest of the explanation talks about the function, e. g. \"This function computes the value by computing another value\".\n", "- Use full sentences inside docstrings when describing something.\n", " - Yes: \"This value is irrelevant, because it is not being passed on\"\n", " - No: \"Value irrelevant, not passed on\". \n", "- When in doubt, more explanation rather than less. A little text inside an example can be helpful, too.\n", "- A little maths can go a long way, but too much usually adds confusion." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Interface Documentation\n", "\n", "\n", "Which functions and classes actually show up in the documentation is determined by an `__all__` statement in the corresponding `__init__.py` file inside a module. The order of this list is also reflected in the documentation. For example, `linalg` has the following `__init__.py`:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# %load ../../../src/probnum/linalg/__init__.py\n", "\"\"\"Linear Algebra.\n", "\n", "This package implements probabilistic numerical methods for the solution\n", "of problems arising in linear algebra, such as the solution of linear\n", "systems :math:`Ax=b`.\n", "\"\"\"\n", "from probnum.linalg._problinsolve import bayescg, problinsolve\n", "\n", "# Public classes and functions. Order is reflected in documentation.\n", "__all__ = [\n", " \"problinsolve\",\n", " \"bayescg\",\n", "]\n", "\n", "# Set correct module paths. Corrects links and module paths in documentation.\n", "problinsolve.__module__ = \"probnum.linalg\"\n", "bayescg.__module__ = \"probnum.linalg\"\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If you are documenting a subclass, which has a different path in the file structure than the import path due to `__all__` statements, you can correct the links to superclasses in the documentation via the `.__module__` attribute." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Sphinx\n", "\n", "ProbNum uses [Sphinx](https://www.sphinx-doc.org/en/master/) to parse docstrings in the codebase automatically and to create its API documentation. You can configure Sphinx itself or its extensions in the `./docs/conf.py` file." ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "nbsphinx-thumbnail": { "output-index": 0 }, "scrolled": false }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAARgAAAEYCAYAAACHjumMAAAevklEQVR4nOydCZRdVZX+v6rKVEkIlRBDSJGBDCRhSMKYMAUERQwiCAILQfTvf9mtorYDy1m0RVHaFlEEEQSR0REJShSBSENAZhJCSIgkhEDmkIHMlapXvW77veb1o4b33j37nnPv/X5r7ZUQknrnnnvfd/fZZ5+96yGEEEZIYIQQZkhghBBmSGCEEGZIYIQQZkhghBBmSGCEEGZIYIQQZkhghBBmSGCEEGZIYIQQZkhghBBmSGCEEGZIYIQQZkhghBBmSGCEEGZIYIQQZkhghBBmSGCEEGZIYIQQZkhghBBmSGCEEGZIYIQQZkhghBBmSGCEEGZIYIQQZkhghBBmSGCEEGZIYIQQZkhghBBmSGCEEGZIYIQQZkhghBBmSGCEEGZIYIQQZkhghBBmSGCEEGZIY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AuV/KiEMIFpQLTBuCnynMRQriiKDCbAHza92CEENlink5FCyGsuArA3r4HIYQQwgFZaSAvhAgQCYwQwgwJjBDCDAmMEMIMCYwQwgwJjBDCDAmMEMIMCYwQwgwJjBDCDAmMEMIMCYwQwgwJjBDCDAmMEMIMCYwQwgwJjBDCDAmMEMIMCYwQwgwJjBDCDAmMEMIMCYwQwgwJjBDCDAmMEMIMCYwQwgwJjBDCDAmMEMIMCYwQwgwJjBDCDAmMEMIMCYwQwgwJjBDCDAmMEMIMCYwQwgwJjBDCDAmMEMIMCYwQwgwJjBDCDAmMEMIMCYwQwgwJjBDCDAmMEMIMCYwQwgwJjBDCDAmMEMIMCYwQwgwJjBDCDAmMEMIMCYwQwoz/DgAA//+uo01ywlGsZwAAAABJRU5ErkJggg==\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from IPython.display import Image\n", "\n", "display(Image(filename=\"../assets/img/developer_guides/sphinx_logo.png\", embed=True))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "ProbNum makes use of a number of Sphinx plugins to improve the API documentation, for example to parse this Jupyter notebook. The full list of used packages can be found in `./docs/sphinx-requirements.txt` and `./docs/notebook-requirements.txt`." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Building and Viewing the Documentation\n", "\n", "In order to build the documentation locally and view the HTML version of the API documentation, simply run: \n", "```bash\n", "tox -e docs\n", "```\n", "This creates a static web page under `./docs/_build/html/` which you can view in your browser by opening \n", "`./docs/_build/html/intro.html`.\n", "\n", "Alternatively, if you want to build the docs in your current environment you can manually execute\n", "```bash\n", "cd docs\n", "make clean\n", "make html\n", "```\n", "\n", "For more information on `tox`, check out the [general development instructions](../development/pull_request.md)." ] } ], "metadata": { "interpreter": { "hash": "61e0cd9fb3a7c4c81e067c75281a66d2a298c39ce676337457f7cdfa15e36158" }, "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.10" } }, "nbformat": 4, "nbformat_minor": 4 }