Skip to content

api docs template #5266

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

Merged
merged 4 commits into from
Dec 18, 2021
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ tags
# Sphinx
_build
docs/jupyter_execute
docs/**/generated/*

# Merge tool
*.orig
Expand Down
7 changes: 5 additions & 2 deletions docs/source/Makefile → Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
SOURCEDIR = docs/source
BUILDDIR = docs/_build

# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
Expand Down Expand Up @@ -51,9 +52,11 @@ help:

clean:
rm -rf $(BUILDDIR)/*
rm -rf $(SOURCEDIR)/api/**/generated
rm -rf docs/jupyter_execute

html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
$(SPHINXBUILD) $(SOURCEDIR) $(BUILDDIR) -b html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

Expand Down
35 changes: 29 additions & 6 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,34 @@ API Reference
api/smc
api/step_methods
api/inference
api/plots

Indices and tables
===================
--------------
API extensions
--------------

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
Plots, stats and diagnostics
----------------------------
Plots, stats and diagnostics are delegated to the
:doc:`ArviZ <arviz:index>`.
library, a general purpose library for
"exploratory analysis of Bayesian models".

* Functions from the `arviz.plots` module are available through ``pymc.<function>`` or ``pymc.plots.<function>``,
but for their API documentation please refer to the :ref:`ArviZ documentation <arviz:plot_api>`.

* Functions from the `arviz.stats` module are available through ``pymc.<function>`` or ``pymc.stats.<function>``,
but for their API documentation please refer to the :ref:`ArviZ documentation <arviz:stats_api>`.

ArviZ is a dependency of PyMC and so, in addition to the locations described above,
importing ArviZ and using ``arviz.<function>`` will also work without any extra installation.

Generalized Linear Models (GLMs)
--------------------------------

Generalized Linear Models are delegated to the
`Bambi <https://bambinos.github.io/bambi>`_.
library, a high-level Bayesian model-building
interface built on top of PyMC.

Bambi is not a dependency of PyMC and should be installed in addition to PyMC
to use it to generate PyMC models via formula syntax.
6 changes: 2 additions & 4 deletions docs/source/api/distributions/continuous.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
Continuous
**********

.. currentmodule:: pymc.distributions.continuous
.. currentmodule:: pymc
.. autosummary::
:toctree: generated/

Uniform
Flat
Expand Down Expand Up @@ -38,6 +39,3 @@ Continuous
Moyal
AsymmetricLaplace
PolyaGamma

.. automodule:: pymc.distributions.continuous
:members:
6 changes: 2 additions & 4 deletions docs/source/api/distributions/discrete.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
Discrete
********

.. currentmodule:: pymc.distributions.discrete
.. currentmodule:: pymc
.. autosummary::
:toctree: generated

Binomial
BetaBinomial
Expand All @@ -21,6 +22,3 @@ Discrete
Categorical
OrderedLogistic
OrderedProbit

.. automodule:: pymc.distributions.discrete
:members:
7 changes: 3 additions & 4 deletions docs/source/api/distributions/mixture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
Mixture
*******

.. currentmodule:: pymc.distributions.mixture
.. currentmodule:: pymc
.. autosummary::
:toctree: generated

Mixture
NormalMixture
MixtureSameFamily

.. automodule:: pymc.distributions.mixture
:members:
6 changes: 2 additions & 4 deletions docs/source/api/distributions/multivariate.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
Multivariate
************

.. currentmodule:: pymc.distributions.multivariate
.. currentmodule:: pymc
.. autosummary::
:toctree: generated

MvNormal
MvStudentT
Expand All @@ -18,6 +19,3 @@ Multivariate
MatrixNormal
KroneckerNormal
CAR

.. automodule:: pymc.distributions.multivariate
:members:
6 changes: 2 additions & 4 deletions docs/source/api/distributions/simulator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
Simulator
**********

.. currentmodule:: pymc.distributions.simulator
.. currentmodule:: pymc
.. autosummary::
:toctree: generated

SimulatorRV
Simulator
KullbackLiebler

.. automodule:: pymc.distributions.simulator
:members:
7 changes: 3 additions & 4 deletions docs/source/api/distributions/timeseries.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
Timeseries
**********

.. currentmodule:: pymc.distributions.timeseries
.. currentmodule:: pymc
.. autosummary::
:toctree: generated

AR1
AR
GaussianRandomWalk
GARCH11
EulerMaruyama
MvGaussianRandomWalk
MvStudentTRandomWalk

.. automodule:: pymc.distributions.timeseries
:members:
137 changes: 25 additions & 112 deletions docs/source/api/distributions/transforms.rst
Original file line number Diff line number Diff line change
@@ -1,129 +1,42 @@
****************************************************************
Transformations of a random variable from one space to another
****************************************************************

Note that for convenience these entities can be addressed as
``pm.transforms.``\ *X* for any name *X*, although they are actually
implemented as ``pm.distributions.transforms.``\ *X*.

.. currentmodule:: pymc.distributions.transforms


.. contents ::

..
.. autosummary::

Transform
stick_breaking
logodds
interval
log_exp_m1
ordered
log
sum_to_1
circular
CholeskyCovPacked
Chain

***************
Transformations
***************

.. currentmodule:: pymc.transforms

Transform Instances
~~~~~~~~~~~~~~~~~~~

Transform instances are the entities that should be used in the
``transform`` parameter to a random variable constructor. These are
initialized instances of the Transform Classes, which are described
below.

.. glossary::

``stick_breaking``
Instantiation of :class:`~pymc.distributions.transforms.StickBreaking`
:class:`~pymc.distributions.transforms.Transform` class for use in the ``transform``
argument of a random variable.

``logodds``
Instantiation of
:class:`~pymc.distributions.transforms.LogOdds` :class:`~pymc.distributions.transforms.Transform` class
for use in the ``transform`` argument of a random variable.

``interval``
Alias of
:class:`~pymc.distributions.transforms.Interval` :class:`~pymc.distributions.transforms.Transform` class
for use in the ``transform`` argument of a random variable.

``log_exp_m1``
Instantiation of
:class:`~pymc.distributions.transforms.LogExpM1` :class:`~pymc.distributions.transforms.Transform` class
for use in the ``transform`` argument of a random variable.
``transform`` parameter to a random variable constructor.

``lowerbound``
Alias of
:class:`~pymc.distributions.transforms.LowerBound` :class:`~pymc.distributions.transforms.Transform` class
for use in the ``transform`` argument of a random variable.

``upperbound``
Alias of
:class:`~pymc.distributions.transforms.UpperBound` :class:`~pymc.distributions.transforms.Transform` class
for use in the ``transform`` argument of a random variable.

``ordered``
Instantiation of
:class:`~pymc.distributions.transforms.Ordered` :class:`~pymc.distributions.transforms.Transform` class
for use in the ``transform`` argument of a random variable.

``log``
Instantiation of
:class:`~pymc.distributions.transforms.Log` :class:`~pymc.distributions.transforms.Transform` class
for use in the ``transform`` argument of a random variable.


``sum_to_1``
Instantiation of
:class:`~pymc.distributions.transforms.SumTo1` :class:`~pymc.distributions.transforms.Transform` class
for use in the ``transform`` argument of a random variable.


``circular``
Instantiation of
:class:`~pymc.distributions.transforms.Circular` :class:`~pymc.distributions.transforms.Transform` class
for use in the ``transform`` argument of a random variable.

Transform Base Classes
~~~~~~~~~~~~~~~~~~~~~~

Typically the programmer will not use these directly.

.. autoclass:: Transform
:members:
.. autosummary::
:toctree: generated

simplex
logodds
interval
log_exp_m1
ordered
log
sum_to_1
circular

Transform Composition Classes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: Chain
:members:
.. autoclass:: CholeskyCovPacked
:members:
.. autosummary::
:toctree: generated

Chain
CholeskyCovPacked

Specific Transform Classes
~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: Log
:members:
.. autoclass:: LogExpM1
:members:
.. autoclass:: LogOdds
:members:
.. autoclass:: Interval
:members:
.. autoclass:: Ordered
:members:
.. autoclass:: SumTo1
:members:
.. autoclass:: StickBreaking
:members:
.. autoclass:: Circular
:members:
.. autosummary::
:toctree: generated

LogExpM1
Ordered
SumTo1
26 changes: 10 additions & 16 deletions docs/source/api/distributions/utilities.rst
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
*******************************************
Distribution utility classes and functions
*******************************************
**********************
Distribution utilities
**********************

.. currentmodule:: pymc.distributions
.. currentmodule:: pymc
.. autosummary::
:toctree: generated/

Distribution
Discrete
Continuous
NoDistribution
DensityDist

.. autoclass:: Distribution
.. autoclass:: Discrete
.. autoclass:: Continuous
.. autoclass:: NoDistribution
.. autoclass:: DensityDist
:members:
Distribution
Discrete
Continuous
NoDistribution
DensityDist
10 changes: 0 additions & 10 deletions docs/source/api/glm.rst

This file was deleted.

13 changes: 0 additions & 13 deletions docs/source/api/plots.rst

This file was deleted.

13 changes: 0 additions & 13 deletions docs/source/api/stats.rst

This file was deleted.

Loading