diff --git a/docs/_templates/autosummary/base.rst b/docs/_templates/autosummary/base.rst new file mode 100644 index 00000000..3fe9858d --- /dev/null +++ b/docs/_templates/autosummary/base.rst @@ -0,0 +1,5 @@ +{{ objname | escape | underline }} + +.. currentmodule:: {{ module }} + +.. auto{{ objtype }}:: {{ objname }} diff --git a/docs/_templates/autosummary/class.rst b/docs/_templates/autosummary/class.rst new file mode 100644 index 00000000..574b853a --- /dev/null +++ b/docs/_templates/autosummary/class.rst @@ -0,0 +1,29 @@ +{{ objname | escape | underline}} + +.. currentmodule:: {{ module }} + +.. autoclass:: {{ objname }} + + {% block methods %} + .. automethod:: __init__ + + {% if methods %} + .. rubric:: {{ _('Methods') }} + + .. autosummary:: + {% for item in methods %} + ~{{ name }}.{{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block attributes %} + {% if attributes %} + .. rubric:: {{ _('Attributes') }} + + .. autosummary:: + {% for item in attributes %} + ~{{ name }}.{{ item }} + {%- endfor %} + {% endif %} + {% endblock %} diff --git a/docs/api_reference.rst b/docs/api_reference.rst index b47e912f..2d85c3ab 100644 --- a/docs/api_reference.rst +++ b/docs/api_reference.rst @@ -4,23 +4,50 @@ API Reference This reference provides detailed documentation for all modules, classes, and methods in the current release of PyMC experimental. +.. currentmodule:: pymc_experimental +.. autosummary:: + :toctree: generated/ -.. toctree:: - :maxdepth: 2 + marginal_model.MarginalModel + model_builder.ModelBuilder +Inference +========= -:mod:`pymc_experimental.distributions` -============================= +.. currentmodule:: pymc_experimental.inference +.. autosummary:: + :toctree: generated/ -.. automodule:: pymc_experimental.distributions.histogram_utils - :members: histogram_approximation + fit -:mod:`pymc_experimental.utils` -============================= +Distributions +============= -.. automodule:: pymc_experimental.utils.spline - :members: bspline_interpolation +.. currentmodule:: pymc_experimental.distributions +.. autosummary:: + :toctree: generated/ -.. automodule:: pymc_experimental.utils.prior - :members: prior_from_idata + GenExtreme + histogram_utils.histogram_approximation + + +Gaussian Processess +=================== + +.. currentmodule:: pymc_experimental.gp +.. autosummary:: + :toctree: generated/ + + latent_approx.HSGP + + +Utils +===== + +.. currentmodule:: pymc_experimental.utils +.. autosummary:: + :toctree: generated/ + + spline.bspline_interpolation + prior.prior_from_idata diff --git a/docs/conf.py b/docs/conf.py index f45b3407..e831458f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -56,16 +56,18 @@ # ones. extensions = [ "sphinx.ext.autodoc", + "sphinx.ext.autosummary", "sphinx.ext.viewcode", "sphinx.ext.napoleon", "sphinx.ext.mathjax", "nbsphinx", + "matplotlib.sphinxext.plot_directive", ] nbsphinx_execute = "never" # Add any paths that contain templates here, relative to this directory. -# templates_path = ["_templates"] +templates_path = ["_templates"] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: @@ -81,7 +83,7 @@ # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +# language = None # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. @@ -97,7 +99,7 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = "pydata_sphinx_theme" +html_theme = "pymc_sphinx_theme" # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the @@ -110,14 +112,17 @@ "show_toc_level": 2, "navigation_depth": 4, "search_bar_text": "Search the docs...", - "icon_links": [ - { - "name": "GitHub", - "url": "https://github.com/pymc-devs/pymc-experimental", - "icon": "fab fa-github-square", - }, - ], + "use_search_override": False, + "logo": {"text": project}, } +html_context = { + "github_user": "pymc-devs", + "github_repo": "pymc-experimental", + "github_version": "main", + "doc_path": "docs", + "default_mode": "light", +} + # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, diff --git a/docs/index.rst b/docs/index.rst index b5dfef6f..28cf4c9a 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -38,16 +38,7 @@ Contributors ============ See the `GitHub contributor page `_. -Contents -======== - .. toctree:: - :maxdepth: 4 + :hidden: api_reference - -Indices -======= - -* :ref:`genindex` -* :ref:`modindex` diff --git a/pymc_experimental/distributions/continuous.py b/pymc_experimental/distributions/continuous.py index e214f008..2de72c76 100644 --- a/pymc_experimental/distributions/continuous.py +++ b/pymc_experimental/distributions/continuous.py @@ -60,7 +60,7 @@ def rng_fn( class GenExtreme(Continuous): r""" - Univariate Generalized Extreme Value log-likelihood + Univariate Generalized Extreme Value log-likelihood The cdf of this distribution is @@ -119,13 +119,13 @@ class GenExtreme(Continuous): Parameters ---------- - mu: float + mu : float Location parameter. - sigma: float + sigma : float Scale parameter (sigma > 0). - xi: float + xi : float Shape parameter - scipy: bool + scipy : bool Whether or not to use the Scipy interpretation of the shape parameter (defaults to `False`). diff --git a/pymc_experimental/marginal_model.py b/pymc_experimental/marginal_model.py index aed93adb..599509bf 100644 --- a/pymc_experimental/marginal_model.py +++ b/pymc_experimental/marginal_model.py @@ -54,6 +54,7 @@ class MarginalModel(Model): Marginalize over a single variable .. code-block:: python + import pymc as pm from pymc_experimental import MarginalModel diff --git a/requirements-docs.txt b/requirements-docs.txt index 0b024fea..185288a8 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -1,3 +1,4 @@ nbsphinx>=0.4.2 pydata-sphinx-theme>=0.6.3 sphinx>=4 +git+https://github.com/pymc-devs/pymc-sphinx-theme