Skip to content

Commit 5eb8605

Browse files
committed
Merge remote-tracking branch 'upstream/main' into ode_examples_update
2 parents 514196e + ff67bea commit 5eb8605

File tree

172 files changed

+30514
-122903
lines changed

Some content is hidden

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

172 files changed

+30514
-122903
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ if you would like help in addressing a reviewer's comments,
99
or if you have been waiting too long to hear back on your PR. -->
1010

1111
+ [ ] Notebook follows style guide https://docs.pymc.io/en/latest/contributing/jupyter_style.html
12-
+ [ ] PR description contains a link to the relevant issue: a tracker one for existing notebooks or a proposal one for new notebooks
12+
+ [ ] PR description contains a link to the relevant issue:
13+
* a tracker one for existing notebooks (tracker issues have the "tracker id" label)
14+
* or a proposal one for new notebooks
1315
+ [ ] Check the notebook is not excluded from any pre-commit check: https://github.com/pymc-devs/pymc-examples/blob/main/.pre-commit-config.yaml
1416

1517

.jupytext.toml

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
notebook_metadata_filter = "substitutions"
2-
3-
[formats]
4-
"examples/" = "ipynb"
5-
"myst_nbs/" = ".myst.md:myst"
1+
notebook_metadata_filter = "substitutions,-jupytext.text_representation.jupytext_version"
2+
formats = ["ipynb", ".myst.md:myst"]

.pre-commit-config.yaml

+3-17
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
repos:
2-
- repo: https://github.com/mwouts/jupytext
3-
rev: v1.13.7
4-
hooks:
5-
- id: jupytext
6-
files: ^examples/.+\.ipynb$
7-
args: ["--sync"]
82
- repo: https://github.com/psf/black
93
rev: 22.3.0
104
hooks:
@@ -63,7 +57,7 @@ repos:
6357
name: Check no references that should be sphinx cross-references are urls
6458
description: >-
6559
'A quick check to prevent urls pointing to pymc docs or other sphinx built docs like arviz, numpy, scipy...'
66-
files: ^examples/
60+
files: ^examples/.+\.ipynb$
6761
exclude: >
6862
(?x)(index.md|
6963
404.md|
@@ -77,7 +71,6 @@ repos:
7771
examples/generalized_linear_models/GLM-logistic.ipynb|
7872
examples/generalized_linear_models/GLM-out-of-sample-predictions.ipynb|
7973
examples/generalized_linear_models/GLM-poisson-regression.ipynb|
80-
examples/generalized_linear_models/GLM-robust.ipynb|
8174
examples/generalized_linear_models/GLM-rolling-regression.ipynb|
8275
examples/generalized_linear_models/GLM-simpsons-paradox.ipynb|
8376
examples/howto/api_quickstart.ipynb|
@@ -90,15 +83,14 @@ repos:
9083
examples/howto/custom_distribution.ipynb)
9184
entry: >
9285
(?x)(arviz-devs.github.io|
93-
aesara.readthedocs.io|
94-
aeppl.readthedocs.io|
9586
pymc-experimental.readthedocs.io|
9687
docs.pymc.io|
9788
numpy.org/doc|
9889
pymc-examples.readthedocs.io|
9990
docs.python.org|
10091
xarray.pydata.org
10192
python.arviz.org|
93+
pytensor.readthedocs.io|
10294
docs.xarray.dev|
10395
www.pymc.io|
10496
docs.scipy.org/doc)
@@ -109,10 +101,4 @@ repos:
109101
hooks:
110102
- id: jupytext
111103
files: ^examples/.+\.ipynb$
112-
args: ["--sync"]
113-
- repo: https://github.com/codespell-project/codespell
114-
rev: v2.1.0
115-
hooks:
116-
- id: codespell
117-
files: myst_nbs/
118-
args: ["--write-changes", "--ignore-words-list", "hist,fpr,fro,lik", "--uri-ignore-words-list", "*"]
104+
args: [--from, ipynb, --to, ".myst.md:myst"]

README.rst

+8-27
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ PyMC Examples
88

99
Supporting examples and tutorials for PyMC, the Python package for Bayesian statistical modeling and Probabilistic Machine Learning!
1010

11-
Check out the `getting started guide <https://docs.pymc.io/en/latest/learning.html#learning>`__, or
11+
Check out the `getting started guide <https://www.pymc.io/projects/docs/en/latest/learn.html>`__, or
1212
interact with live examples using Binder! Each notebook in `PyMC examples gallery
13-
<https://pymc-examples.readthedocs.io>`__ has a binder badge.
13+
<https://www.pymc.io/projects/examples/en/latest/gallery.html>`__ has a binder badge.
1414
For questions on PyMC, head on over to our `PyMC Discourse <https://discourse.pymc.io/>`__ forum.
1515

1616
Contributing
@@ -30,11 +30,8 @@ To ask a question regarding modeling or usage of PyMC we encourage posting to ou
3030

3131
To report an issue, please use the following:
3232

33-
- `PyMC Examples - Issue Tracker <https://github.com/pymc-devs/pymc-examples/issues>`__. For
34-
issues about the example notebooks, errors in the example codes, outdated information, improvement
35-
suggestions...
36-
- `PyMC - Issue Tracker <https://github.com/pymc-devs/pymc/issues>`__. For issues, bugs or
37-
feature requests related to the PyMC library itself.
33+
- `PyMC Examples - Issue Tracker <https://github.com/pymc-devs/pymc-examples/issues>`__. For issues about the example notebooks, errors in the example codes, outdated information, improvement suggestions...
34+
- `PyMC - Issue Tracker <https://github.com/pymc-devs/pymc/issues>`__. For issues, bugs or feature requests related to the PyMC library itself.
3835

3936
Finally, if you need to get in touch for non-technical information about the project, `send us an e-mail <[email protected]>`__.
4037

@@ -45,9 +42,9 @@ If you already know about Bayesian statistics:
4542
----------------------------------------------
4643

4744

48-
- `API quickstart guide <http://docs.pymc.io/notebooks/api_quickstart>`__
49-
- The `PyMC tutorial <http://docs.pymc.io/notebooks/getting_started>`__
50-
- `PyMC examples <https://docs.pymc.io/nb_examples/index.html>`__ and the `API reference <http://docs.pymc.io/api>`__
45+
- `API quickstart guide <https://www.pymc.io/projects/examples/en/latest/howto/api_quickstart.html>`__
46+
- The `PyMC tutorial <https://www.pymc.io/projects/docs/en/stable/learn/core_notebooks/pymc_overview.html>`__
47+
- `PyMC examples <https://www.pymc.io/projects/examples/en/latest/gallery.html>`__ and the `API reference <https://www.pymc.io/projects/docs/en/stable/api.html>`__
5148

5249

5350

@@ -69,7 +66,7 @@ and as part of `PyMCon 2020 <https://discourse.pymc.io/c/pymcon/2020talks/15>`__
6966
Installation
7067
------------
7168

72-
To install PyMC on your system, see its `installation section here <https://docs.pymc.io/en/stable/>`__
69+
To install PyMC on your system, see its `installation section here <https://www.pymc.io/projects/docs/en/stable/installation.html>`__
7370

7471
Citing PyMC
7572
============
@@ -93,18 +90,6 @@ Support
9390

9491
PyMC is a non-profit project under NumFOCUS umbrella. If you want to support PyMC financially, you can donate `here <https://numfocus.salsalabs.org/donate-to-pymc3/index.html>`__.
9592

96-
PyMC for enterprise
97-
===================
98-
`PyMC is now available as part of the Tidelift Subscription!`
99-
100-
Tidelift is working with PyMC and the maintainers of thousands of other open source
101-
projects to deliver commercial support and maintenance for the open source dependencies
102-
you use to build your applications. Save time, reduce risk, and improve code health,
103-
while contributing financially to PyMC -- making it even more robust, reliable and,
104-
let's face it, amazing!
105-
106-
|tidelift_learn| |tidelift_demo|
107-
10893
Sponsors
10994
========
11095

@@ -118,7 +103,3 @@ Sponsors
118103
:target: http://www.numfocus.org/
119104
.. |PyMCLabs| image:: https://raw.githubusercontent.com/pymc-devs/pymc/main/docs/logos/sponsors/pymc-labs.png
120105
:target: https://pymc-labs.io
121-
.. |tidelift_learn| image:: https://img.shields.io/badge/-learn%20more-2dd160.svg?color=orange&labelColor=58595b&style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAOCAYAAADJ7fe0AAAAAXNSR0IArs4c6QAAAAlwSFlzAAAWJQAAFiUBSVIk8AAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KTMInWQAAAVhJREFUKBV1kj0vBFEUhmd2sdZHh2IlGhKFQuOviEYiNlFodCqtUqPxA%2FwCjUTnDygkGoVERFQaZFlE9nreO%2BdM5u5wkifvuee892Pu3CyEcA0DeIc%2B9IwftJsR6Cko3uCjguZdjuBZhhwmYDjGrOC96WED41UtsgEdGEAPlmAfpuAbFF%2BFZLfoMfRBGzThDtLgePPwBIpdddGzOArhPHUXowbNptE2www6a%2Fm96Y3pHN7oQ1s%2B13pxt1ENaKzBFWyWzaJ%2BRO0C9Jny6VPSoKjLVbMDC5bn5OPuJF%2BBSe95PVEMuugY5AegS9fCh7BedP45hRnj8TC34QQUe9bTZyh2KgvFk2vc8GIlXyTfsvqr6bPpNgv52ynnlomZJNpB70Xhl%2Bf6Sa02p1bApEfnETwxVa%2Faj%2BW%2FFtHltmxS%2FO3krvpTtTnVgu%2F6gvHRFvG78Ef3kOe5PimJXycY74blT5R%2BAAAAAElFTkSuQmCC
122-
:target: https://tidelift.com/subscription/pkg/pypi-pymc3?utm_source=pypi-pymc3&utm_medium=referral&utm_campaign=enterprise
123-
.. |tidelift_demo| image:: https://img.shields.io/badge/-request%20a%20demo-2dd160.svg?color=orange&labelColor=58595b&style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAOCAYAAADJ7fe0AAAAAXNSR0IArs4c6QAAAAlwSFlzAAAWJQAAFiUBSVIk8AAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KTMInWQAAAVhJREFUKBV1kj0vBFEUhmd2sdZHh2IlGhKFQuOviEYiNlFodCqtUqPxA%2FwCjUTnDygkGoVERFQaZFlE9nreO%2BdM5u5wkifvuee892Pu3CyEcA0DeIc%2B9IwftJsR6Cko3uCjguZdjuBZhhwmYDjGrOC96WED41UtsgEdGEAPlmAfpuAbFF%2BFZLfoMfRBGzThDtLgePPwBIpdddGzOArhPHUXowbNptE2www6a%2Fm96Y3pHN7oQ1s%2B13pxt1ENaKzBFWyWzaJ%2BRO0C9Jny6VPSoKjLVbMDC5bn5OPuJF%2BBSe95PVEMuugY5AegS9fCh7BedP45hRnj8TC34QQUe9bTZyh2KgvFk2vc8GIlXyTfsvqr6bPpNgv52ynnlomZJNpB70Xhl%2Bf6Sa02p1bApEfnETwxVa%2Faj%2BW%2FFtHltmxS%2FO3krvpTtTnVgu%2F6gvHRFvG78Ef3kOe5PimJXycY74blT5R%2BAAAAAElFTkSuQmCC
124-
:target: https://tidelift.com/subscription/request-a-demo?utm_source=pypi-pymc3&utm_medium=referral&utm_campaign=enterprise

myst_nbs/case_studies/BART_introduction.myst.md renamed to examples/case_studies/BART_introduction.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: Python 3 (ipykernel)
109
language: python

myst_nbs/case_studies/BEST.myst.md renamed to examples/case_studies/BEST.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: bayes_toolbox
109
language: python

examples/case_studies/GEV.ipynb

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@
4545
"metadata": {},
4646
"outputs": [],
4747
"source": [
48-
"import aesara.tensor as at\n",
4948
"import arviz as az\n",
5049
"import matplotlib.pyplot as plt\n",
5150
"import numpy as np\n",
5251
"import pymc as pm\n",
5352
"import pymc_experimental.distributions as pmx\n",
53+
"import pytensor.tensor as pt\n",
5454
"\n",
5555
"from arviz.plots import plot_utils as azpu"
5656
]
@@ -984,7 +984,7 @@
984984
"Python version : 3.10.6\n",
985985
"IPython version : 8.5.0\n",
986986
"\n",
987-
"aesara: 2.8.6\n",
987+
"pytensor: 2.8.6\n",
988988
"arviz : 0.12.1\n",
989989
"\n",
990990
"pymc_experimental: 0.0.1\n",
@@ -993,7 +993,7 @@
993993
"arviz : 0.12.1\n",
994994
"numpy : 1.23.3\n",
995995
"json : 2.0.9\n",
996-
"aesara : 2.8.6\n",
996+
"pytensor : 2.8.6\n",
997997
"pymc : 3.9.3+1493.g372d7c24\n",
998998
"\n",
999999
"Watermark: 2.3.1\n",
@@ -1003,7 +1003,7 @@
10031003
],
10041004
"source": [
10051005
"%load_ext watermark\n",
1006-
"%watermark -n -u -v -iv -w -p aesara,arviz"
1006+
"%watermark -n -u -v -iv -w -p pytensor,arviz"
10071007
]
10081008
},
10091009
{

myst_nbs/case_studies/GEV.myst.md renamed to examples/case_studies/GEV.myst.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: pymc4-dev
109
language: python
@@ -41,12 +40,12 @@ Note that this parametrization of the shape parameter $\xi$ is opposite in sign
4140
We will use the example of the Port Pirie annual maximum sea-level data used in {cite:t}`coles2001gev`, and compare with the frequentist results presented there.
4241

4342
```{code-cell} ipython3
44-
import aesara.tensor as at
4543
import arviz as az
4644
import matplotlib.pyplot as plt
4745
import numpy as np
4846
import pymc as pm
4947
import pymc_experimental.distributions as pmx
48+
import pytensor.tensor as pt
5049
5150
from arviz.plots import plot_utils as azpu
5251
```
@@ -233,7 +232,7 @@ az.plot_pair(idata, var_names=["μ", "σ", "ξ"], kind="kde", marginals=True, di
233232

234233
```{code-cell} ipython3
235234
%load_ext watermark
236-
%watermark -n -u -v -iv -w -p aesara,arviz
235+
%watermark -n -u -v -iv -w -p pytensor,arviz
237236
```
238237

239238
```{code-cell} ipython3

examples/case_studies/LKJ.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,7 @@
987987
"Python version : 3.7.12\n",
988988
"IPython version : 5.5.0\n",
989989
"\n",
990-
"aesara: 2.4.0\n",
990+
"pytensor: 2.4.0\n",
991991
"xarray: 0.18.2\n",
992992
"\n",
993993
"pymc : 4.0.0b2\n",
@@ -1004,7 +1004,7 @@
10041004
],
10051005
"source": [
10061006
"%load_ext watermark\n",
1007-
"%watermark -n -u -v -iv -w -p aesara,xarray"
1007+
"%watermark -n -u -v -iv -w -p pytensor,xarray"
10081008
]
10091009
}
10101010
],

myst_nbs/case_studies/LKJ.myst.md renamed to examples/case_studies/LKJ.myst.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: Python 3 (ipykernel)
109
language: python
@@ -327,5 +326,5 @@ id: kJCfuzGtr2Pq
327326
outputId: da547b05-d812-4959-aff6-cf4a12faca15
328327
---
329328
%load_ext watermark
330-
%watermark -n -u -v -iv -w -p aesara,xarray
329+
%watermark -n -u -v -iv -w -p pytensor,xarray
331330
```

examples/case_studies/bayesian_ab_testing_introduction.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -2163,7 +2163,7 @@
21632163
"Python version : 3.8.10\n",
21642164
"IPython version : 8.4.0\n",
21652165
"\n",
2166-
"aesara: 2.7.3\n",
2166+
"pytensor: 2.7.3\n",
21672167
"xarray: 2022.3.0\n",
21682168
"\n",
21692169
"matplotlib: 3.5.2\n",
@@ -2181,7 +2181,7 @@
21812181
],
21822182
"source": [
21832183
"%load_ext watermark\n",
2184-
"%watermark -n -u -v -iv -w -p aesara,xarray"
2184+
"%watermark -n -u -v -iv -w -p pytensor,xarray"
21852185
]
21862186
},
21872187
{

myst_nbs/case_studies/bayesian_ab_testing_introduction.myst.md renamed to examples/case_studies/bayesian_ab_testing_introduction.myst.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: Python 3.8.10 ('pymc-examples-ipRlw-UN')
109
language: python
@@ -688,7 +687,7 @@ We also plan to create more PyMC tutorials on these topics, so stay tuned!
688687

689688
```{code-cell} ipython3
690689
%load_ext watermark
691-
%watermark -n -u -v -iv -w -p aesara,xarray
690+
%watermark -n -u -v -iv -w -p pytensor,xarray
692691
```
693692

694693
:::{include} ../page_footer.md

0 commit comments

Comments
 (0)