Skip to content

Commit b1763c7

Browse files
Update API reference listings (#105)
* Update API reference listings * improve api page+some fixes * update to pymc theme * add pymc theme to requirements * fix indent in docstring --------- Co-authored-by: Oriol (ZBook) <[email protected]>
1 parent 5259105 commit b1763c7

File tree

8 files changed

+96
-37
lines changed

8 files changed

+96
-37
lines changed

docs/_templates/autosummary/base.rst

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{{ objname | escape | underline }}
2+
3+
.. currentmodule:: {{ module }}
4+
5+
.. auto{{ objtype }}:: {{ objname }}

docs/_templates/autosummary/class.rst

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{{ objname | escape | underline}}
2+
3+
.. currentmodule:: {{ module }}
4+
5+
.. autoclass:: {{ objname }}
6+
7+
{% block methods %}
8+
.. automethod:: __init__
9+
10+
{% if methods %}
11+
.. rubric:: {{ _('Methods') }}
12+
13+
.. autosummary::
14+
{% for item in methods %}
15+
~{{ name }}.{{ item }}
16+
{%- endfor %}
17+
{% endif %}
18+
{% endblock %}
19+
20+
{% block attributes %}
21+
{% if attributes %}
22+
.. rubric:: {{ _('Attributes') }}
23+
24+
.. autosummary::
25+
{% for item in attributes %}
26+
~{{ name }}.{{ item }}
27+
{%- endfor %}
28+
{% endif %}
29+
{% endblock %}

docs/api_reference.rst

+39-12
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,50 @@ API Reference
44
This reference provides detailed documentation for all modules, classes, and
55
methods in the current release of PyMC experimental.
66

7+
.. currentmodule:: pymc_experimental
8+
.. autosummary::
9+
:toctree: generated/
710

8-
.. toctree::
9-
:maxdepth: 2
11+
marginal_model.MarginalModel
12+
model_builder.ModelBuilder
1013

14+
Inference
15+
=========
1116

12-
:mod:`pymc_experimental.distributions`
13-
=============================
17+
.. currentmodule:: pymc_experimental.inference
18+
.. autosummary::
19+
:toctree: generated/
1420

15-
.. automodule:: pymc_experimental.distributions.histogram_utils
16-
:members: histogram_approximation
21+
fit
1722

1823

19-
:mod:`pymc_experimental.utils`
20-
=============================
24+
Distributions
25+
=============
2126

22-
.. automodule:: pymc_experimental.utils.spline
23-
:members: bspline_interpolation
27+
.. currentmodule:: pymc_experimental.distributions
28+
.. autosummary::
29+
:toctree: generated/
2430

25-
.. automodule:: pymc_experimental.utils.prior
26-
:members: prior_from_idata
31+
GenExtreme
32+
histogram_utils.histogram_approximation
33+
34+
35+
Gaussian Processess
36+
===================
37+
38+
.. currentmodule:: pymc_experimental.gp
39+
.. autosummary::
40+
:toctree: generated/
41+
42+
latent_approx.HSGP
43+
44+
45+
Utils
46+
=====
47+
48+
.. currentmodule:: pymc_experimental.utils
49+
.. autosummary::
50+
:toctree: generated/
51+
52+
spline.bspline_interpolation
53+
prior.prior_from_idata

docs/conf.py

+15-10
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,18 @@
5656
# ones.
5757
extensions = [
5858
"sphinx.ext.autodoc",
59+
"sphinx.ext.autosummary",
5960
"sphinx.ext.viewcode",
6061
"sphinx.ext.napoleon",
6162
"sphinx.ext.mathjax",
6263
"nbsphinx",
64+
"matplotlib.sphinxext.plot_directive",
6365
]
6466

6567
nbsphinx_execute = "never"
6668

6769
# Add any paths that contain templates here, relative to this directory.
68-
# templates_path = ["_templates"]
70+
templates_path = ["_templates"]
6971

7072
# The suffix(es) of source filenames.
7173
# You can specify multiple suffix as a list of string:
@@ -81,7 +83,7 @@
8183
#
8284
# This is also used if you do content translation via gettext catalogs.
8385
# Usually you set "language" from the command line for these cases.
84-
language = None
86+
# language = None
8587

8688
# List of patterns, relative to source directory, that match files and
8789
# directories to ignore when looking for source files.
@@ -97,7 +99,7 @@
9799
# The theme to use for HTML and HTML Help pages. See the documentation for
98100
# a list of builtin themes.
99101
#
100-
html_theme = "pydata_sphinx_theme"
102+
html_theme = "pymc_sphinx_theme"
101103

102104
# Theme options are theme-specific and customize the look and feel of a theme
103105
# further. For a list of options available for each theme, see the
@@ -110,14 +112,17 @@
110112
"show_toc_level": 2,
111113
"navigation_depth": 4,
112114
"search_bar_text": "Search the docs...",
113-
"icon_links": [
114-
{
115-
"name": "GitHub",
116-
"url": "https://github.com/pymc-devs/pymc-experimental",
117-
"icon": "fab fa-github-square",
118-
},
119-
],
115+
"use_search_override": False,
116+
"logo": {"text": project},
120117
}
118+
html_context = {
119+
"github_user": "pymc-devs",
120+
"github_repo": "pymc-experimental",
121+
"github_version": "main",
122+
"doc_path": "docs",
123+
"default_mode": "light",
124+
}
125+
121126

122127
# Add any paths that contain custom static files (such as style sheets) here,
123128
# relative to this directory. They are copied after the builtin static files,

docs/index.rst

+1-10
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,7 @@ Contributors
3838
============
3939
See the `GitHub contributor page <https://github.com/pymc-devs/pymc-experimental/graphs/contributors>`_.
4040

41-
Contents
42-
========
43-
4441
.. toctree::
45-
:maxdepth: 4
42+
:hidden:
4643

4744
api_reference
48-
49-
Indices
50-
=======
51-
52-
* :ref:`genindex`
53-
* :ref:`modindex`

pymc_experimental/distributions/continuous.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def rng_fn(
6060

6161
class GenExtreme(Continuous):
6262
r"""
63-
Univariate Generalized Extreme Value log-likelihood
63+
Univariate Generalized Extreme Value log-likelihood
6464
6565
The cdf of this distribution is
6666
@@ -119,13 +119,13 @@ class GenExtreme(Continuous):
119119
120120
Parameters
121121
----------
122-
mu: float
122+
mu : float
123123
Location parameter.
124-
sigma: float
124+
sigma : float
125125
Scale parameter (sigma > 0).
126-
xi: float
126+
xi : float
127127
Shape parameter
128-
scipy: bool
128+
scipy : bool
129129
Whether or not to use the Scipy interpretation of the shape parameter
130130
(defaults to `False`).
131131

pymc_experimental/marginal_model.py

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class MarginalModel(Model):
5454
Marginalize over a single variable
5555
5656
.. code-block:: python
57+
5758
import pymc as pm
5859
from pymc_experimental import MarginalModel
5960

requirements-docs.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
nbsphinx>=0.4.2
22
pydata-sphinx-theme>=0.6.3
33
sphinx>=4
4+
git+https://github.com/pymc-devs/pymc-sphinx-theme

0 commit comments

Comments
 (0)