Skip to content

Commit 90a88ff

Browse files
committed
Merge branch 'main' into optim-prior
2 parents 9a51289 + 36c7553 commit 90a88ff

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+4808
-928
lines changed

.github/workflows/pytest.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ jobs:
4646
--ignore=pymc/tests/test_dist_math.py
4747
--ignore=pymc/tests/test_minibatches.py
4848
--ignore=pymc/tests/test_pickling.py
49-
--ignore=pymc/tests/test_plots.py
5049
--ignore=pymc/tests/test_updates.py
5150
--ignore=pymc/tests/test_gp.py
5251
--ignore=pymc/tests/test_model.py
@@ -68,7 +67,6 @@ jobs:
6867
pymc/tests/test_dist_math.py
6968
pymc/tests/test_minibatches.py
7069
pymc/tests/test_pickling.py
71-
pymc/tests/test_plots.py
7270
pymc/tests/test_updates.py
7371
pymc/tests/test_transforms.py
7472

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ tags
1818
# Sphinx
1919
_build
2020
docs/jupyter_execute
21+
docs/**/generated/*
2122

2223
# Merge tool
2324
*.orig

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
exclude: ^(docs/logos|pymc/tests/data)/
22
repos:
33
- repo: https://github.com/pre-commit/pre-commit-hooks
4-
rev: v4.0.1
4+
rev: v4.1.0
55
hooks:
66
- id: check-merge-conflict
77
- id: check-toml
@@ -19,7 +19,7 @@ repos:
1919
- id: isort
2020
name: isort
2121
- repo: https://github.com/asottile/pyupgrade
22-
rev: v2.29.1
22+
rev: v2.31.0
2323
hooks:
2424
- id: pyupgrade
2525
args: [--py37-plus]

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ docker exec -it pymc jupyter notebook list
146146
## Style guide
147147

148148
We have configured a pre-commit hook that checks for `black`-compliant code style.
149-
We encourage you to configure the pre-commit hook as described in the [PyMC Python Code Style Wiki Page](https://github.com/pymc-devs/pymc/wiki/Python-Code-Style), because it will automatically enforce the code style on your commits.
149+
We encourage you to configure the pre-commit hook as described in the [PyMC Python Code Style Wiki Page](https://docs.pymc.io/en/latest/contributing/python_style.html), because it will automatically enforce the code style on your commits.
150150

151-
Similarly, consult the [PyMC's Jupyter Notebook Style](https://github.com/pymc-devs/pymc/wiki/PyMC-Jupyter-Notebook-Style-Guide) guides for notebooks.
151+
Similarly, consult the [PyMC's Jupyter Notebook Style](https://docs.pymc.io/en/latest/contributing/jupyter_style.html) guides for notebooks.
152152

153153
For documentation strings, we *prefer* [numpy style](https://numpydoc.readthedocs.io/en/latest/format.html) to comply with the style that predominates in our upstream dependencies.
154154

docs/source/Makefile renamed to Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
SPHINXOPTS =
66
SPHINXBUILD = sphinx-build
77
PAPER =
8-
BUILDDIR = _build
8+
SOURCEDIR = docs/source
9+
BUILDDIR = docs/_build
910

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

5253
clean:
5354
rm -rf $(BUILDDIR)/*
55+
rm -rf $(SOURCEDIR)/api/**/generated
56+
rm -rf docs/jupyter_execute
5457

5558
html:
56-
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
59+
$(SPHINXBUILD) $(SOURCEDIR) $(BUILDDIR) -b html
5760
@echo
5861
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
5962

docs/source/404.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,4 @@ do so we have moved some files around and we have
2828
modified the base url in order to support multi version docs
2929
(you'll see the version switcher at the bottom right of the page).
3030

31-
::::{grid} 3
32-
:::{grid-item}
33-
:::
34-
:::{grid-item}
35-
```{button-link} https://docs.pymc.io/en/stable/
36-
:color: primary
37-
:expand:
38-
39-
Back to stable version documentation
40-
```
41-
:::
42-
:::{grid-item}
43-
:::
44-
::::
31+
Back to {{ '[documentation homepage](https://docs.pymc.io/en/{}/)'.format(version_slug) }}

docs/source/api.rst

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,34 @@ API Reference
1515
api/smc
1616
api/step_methods
1717
api/inference
18-
api/plots
1918

20-
Indices and tables
21-
===================
19+
--------------
20+
API extensions
21+
--------------
2222

23-
* :ref:`genindex`
24-
* :ref:`modindex`
25-
* :ref:`search`
23+
Plots, stats and diagnostics
24+
----------------------------
25+
Plots, stats and diagnostics are delegated to the
26+
:doc:`ArviZ <arviz:index>`.
27+
library, a general purpose library for
28+
"exploratory analysis of Bayesian models".
29+
30+
* Functions from the `arviz.plots` module are available through ``pymc.<function>`` or ``pymc.plots.<function>``,
31+
but for their API documentation please refer to the :ref:`ArviZ documentation <arviz:plot_api>`.
32+
33+
* Functions from the `arviz.stats` module are available through ``pymc.<function>`` or ``pymc.stats.<function>``,
34+
but for their API documentation please refer to the :ref:`ArviZ documentation <arviz:stats_api>`.
35+
36+
ArviZ is a dependency of PyMC and so, in addition to the locations described above,
37+
importing ArviZ and using ``arviz.<function>`` will also work without any extra installation.
38+
39+
Generalized Linear Models (GLMs)
40+
--------------------------------
41+
42+
Generalized Linear Models are delegated to the
43+
`Bambi <https://bambinos.github.io/bambi>`_.
44+
library, a high-level Bayesian model-building
45+
interface built on top of PyMC.
46+
47+
Bambi is not a dependency of PyMC and should be installed in addition to PyMC
48+
to use it to generate PyMC models via formula syntax.

docs/source/api/distributions/continuous.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
Continuous
33
**********
44

5-
.. currentmodule:: pymc.distributions.continuous
5+
.. currentmodule:: pymc
66
.. autosummary::
7+
:toctree: generated/
78

89
Uniform
910
Flat
@@ -38,6 +39,3 @@ Continuous
3839
Moyal
3940
AsymmetricLaplace
4041
PolyaGamma
41-
42-
.. automodule:: pymc.distributions.continuous
43-
:members:

docs/source/api/distributions/discrete.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
Discrete
33
********
44

5-
.. currentmodule:: pymc.distributions.discrete
5+
.. currentmodule:: pymc
66
.. autosummary::
7+
:toctree: generated
78

89
Binomial
910
BetaBinomial
@@ -21,6 +22,3 @@ Discrete
2122
Categorical
2223
OrderedLogistic
2324
OrderedProbit
24-
25-
.. automodule:: pymc.distributions.discrete
26-
:members:

docs/source/api/distributions/mixture.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
Mixture
33
*******
44

5-
.. currentmodule:: pymc.distributions.mixture
5+
.. currentmodule:: pymc
66
.. autosummary::
7+
:toctree: generated
8+
79
Mixture
810
NormalMixture
911
MixtureSameFamily
10-
11-
.. automodule:: pymc.distributions.mixture
12-
:members:

docs/source/api/distributions/multivariate.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
Multivariate
33
************
44

5-
.. currentmodule:: pymc.distributions.multivariate
5+
.. currentmodule:: pymc
66
.. autosummary::
7+
:toctree: generated
78

89
MvNormal
910
MvStudentT
@@ -18,6 +19,3 @@ Multivariate
1819
MatrixNormal
1920
KroneckerNormal
2021
CAR
21-
22-
.. automodule:: pymc.distributions.multivariate
23-
:members:

docs/source/api/distributions/simulator.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22
Simulator
33
**********
44

5-
.. currentmodule:: pymc.distributions.simulator
5+
.. currentmodule:: pymc
66
.. autosummary::
7+
:toctree: generated
78

89
SimulatorRV
910
Simulator
1011
KullbackLiebler
11-
12-
.. automodule:: pymc.distributions.simulator
13-
:members:

docs/source/api/distributions/timeseries.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22
Timeseries
33
**********
44

5-
.. currentmodule:: pymc.distributions.timeseries
5+
.. currentmodule:: pymc
66
.. autosummary::
7+
:toctree: generated
8+
79
AR1
810
AR
911
GaussianRandomWalk
1012
GARCH11
1113
EulerMaruyama
1214
MvGaussianRandomWalk
1315
MvStudentTRandomWalk
14-
15-
.. automodule:: pymc.distributions.timeseries
16-
:members:
Lines changed: 25 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -1,129 +1,42 @@
1-
****************************************************************
2-
Transformations of a random variable from one space to another
3-
****************************************************************
4-
5-
Note that for convenience these entities can be addressed as
6-
``pm.transforms.``\ *X* for any name *X*, although they are actually
7-
implemented as ``pm.distributions.transforms.``\ *X*.
8-
9-
.. currentmodule:: pymc.distributions.transforms
10-
11-
12-
.. contents ::
13-
14-
..
15-
.. autosummary::
16-
17-
Transform
18-
stick_breaking
19-
logodds
20-
interval
21-
log_exp_m1
22-
ordered
23-
log
24-
sum_to_1
25-
circular
26-
CholeskyCovPacked
27-
Chain
28-
1+
***************
2+
Transformations
3+
***************
294

5+
.. currentmodule:: pymc.transforms
306

317
Transform Instances
328
~~~~~~~~~~~~~~~~~~~
339

3410
Transform instances are the entities that should be used in the
35-
``transform`` parameter to a random variable constructor. These are
36-
initialized instances of the Transform Classes, which are described
37-
below.
38-
39-
.. glossary::
40-
41-
``stick_breaking``
42-
Instantiation of :class:`~pymc.distributions.transforms.StickBreaking`
43-
:class:`~pymc.distributions.transforms.Transform` class for use in the ``transform``
44-
argument of a random variable.
45-
46-
``logodds``
47-
Instantiation of
48-
:class:`~pymc.distributions.transforms.LogOdds` :class:`~pymc.distributions.transforms.Transform` class
49-
for use in the ``transform`` argument of a random variable.
50-
51-
``interval``
52-
Alias of
53-
:class:`~pymc.distributions.transforms.Interval` :class:`~pymc.distributions.transforms.Transform` class
54-
for use in the ``transform`` argument of a random variable.
55-
56-
``log_exp_m1``
57-
Instantiation of
58-
:class:`~pymc.distributions.transforms.LogExpM1` :class:`~pymc.distributions.transforms.Transform` class
59-
for use in the ``transform`` argument of a random variable.
11+
``transform`` parameter to a random variable constructor.
6012

61-
``lowerbound``
62-
Alias of
63-
:class:`~pymc.distributions.transforms.LowerBound` :class:`~pymc.distributions.transforms.Transform` class
64-
for use in the ``transform`` argument of a random variable.
65-
66-
``upperbound``
67-
Alias of
68-
:class:`~pymc.distributions.transforms.UpperBound` :class:`~pymc.distributions.transforms.Transform` class
69-
for use in the ``transform`` argument of a random variable.
70-
71-
``ordered``
72-
Instantiation of
73-
:class:`~pymc.distributions.transforms.Ordered` :class:`~pymc.distributions.transforms.Transform` class
74-
for use in the ``transform`` argument of a random variable.
75-
76-
``log``
77-
Instantiation of
78-
:class:`~pymc.distributions.transforms.Log` :class:`~pymc.distributions.transforms.Transform` class
79-
for use in the ``transform`` argument of a random variable.
80-
81-
82-
``sum_to_1``
83-
Instantiation of
84-
:class:`~pymc.distributions.transforms.SumTo1` :class:`~pymc.distributions.transforms.Transform` class
85-
for use in the ``transform`` argument of a random variable.
86-
87-
88-
``circular``
89-
Instantiation of
90-
:class:`~pymc.distributions.transforms.Circular` :class:`~pymc.distributions.transforms.Transform` class
91-
for use in the ``transform`` argument of a random variable.
92-
93-
Transform Base Classes
94-
~~~~~~~~~~~~~~~~~~~~~~
95-
96-
Typically the programmer will not use these directly.
97-
98-
.. autoclass:: Transform
99-
:members:
13+
.. autosummary::
14+
:toctree: generated
10015

16+
simplex
17+
logodds
18+
interval
19+
log_exp_m1
20+
ordered
21+
log
22+
sum_to_1
23+
circular
10124

10225
Transform Composition Classes
10326
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10427

105-
.. autoclass:: Chain
106-
:members:
107-
.. autoclass:: CholeskyCovPacked
108-
:members:
28+
.. autosummary::
29+
:toctree: generated
10930

31+
Chain
32+
CholeskyCovPacked
11033

11134
Specific Transform Classes
11235
~~~~~~~~~~~~~~~~~~~~~~~~~~
11336

114-
.. autoclass:: Log
115-
:members:
116-
.. autoclass:: LogExpM1
117-
:members:
118-
.. autoclass:: LogOdds
119-
:members:
120-
.. autoclass:: Interval
121-
:members:
122-
.. autoclass:: Ordered
123-
:members:
124-
.. autoclass:: SumTo1
125-
:members:
126-
.. autoclass:: StickBreaking
127-
:members:
128-
.. autoclass:: Circular
129-
:members:
37+
.. autosummary::
38+
:toctree: generated
39+
40+
LogExpM1
41+
Ordered
42+
SumTo1

0 commit comments

Comments
 (0)