Skip to content

Commit 343a12a

Browse files
committed
Merge remote-tracking branch 'upstream/main' into multilevel_v4_update
2 parents b1639bc + 1125af4 commit 343a12a

35 files changed

+5384
-4214
lines changed

.jupytext.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
notebook_metadata_filter = "substitutions"
2+
13
[formats]
24
"examples/" = "ipynb"
35
"myst_nbs/" = ".myst.md:myst"

.pre-commit-config.yaml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ repos:
66
files: ^examples/.+\.ipynb$
77
args: ["--sync"]
88
- repo: https://github.com/psf/black
9-
rev: 22.1.0
9+
rev: 22.3.0
1010
hooks:
1111
- id: black-jupyter
1212
- repo: https://github.com/nbQA-dev/nbQA
@@ -29,7 +29,6 @@ repos:
2929
|examples/gaussian_processes/GP-Latent\.ipynb$
3030
|examples/gaussian_processes/GP-MaunaLoa2\.ipynb$
3131
|examples/samplers/MLDA_gravity_surveying\.ipynb$
32-
|examples/case_studies/putting_workflow\.ipynb$
3332
|examples/pymc3_howto/sampling_callback\.ipynb$
3433
|examples/case_studies/blackbox_external_likelihood\.ipynb$
3534
|examples/samplers/GLM-hierarchical-jax\.ipynb$
@@ -56,15 +55,6 @@ repos:
5655
minimum_pre_commit_version: 2.8.0
5756
name: Check notebooks have watermark (see Jupyter style guide from PyMC docs)
5857
types: [jupyter]
59-
- id: add-tags
60-
entry: python scripts/add_tags.py
61-
language: python
62-
name: Add PyMC3 classes used to tags
63-
types: [jupyter]
64-
additional_dependencies:
65-
- nbqa==1.1.1
66-
- beautifulsoup4==4.9.3
67-
- myst_parser==0.13.7
6858
- repo: https://github.com/mwouts/jupytext
6959
rev: v1.13.7
7060
hooks:

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ 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 <http://docs.pymc.io/notebooks/getting_started>`__, or
11+
Check out the `getting started guide <https://docs.pymc.io/en/latest/learning.html#learning>`__, or
1212
interact with live examples using Binder! Each notebook in `PyMC examples gallery
1313
<https://pymc-examples.readthedocs.io>`__ has a binder badge.
1414
For questions on PyMC, head on over to our `PyMC Discourse <https://discourse.pymc.io/>`__ forum.

_templates/postcard_categories.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ <h3>
5050
<div class="container sd-fs-6 sd-font-weight-bold">
5151
<div class="row border-top border-bottom">
5252
{% set t_bool = "tutorial" in post.category|map('string') %}
53-
<div class="col {{ setcolorclass(t_bool) }}"><a href="{{ pathtocategory('tutorial') }}">Tutorial</a></div>
53+
<div class="col"><a class="{{ setcolorclass(t_bool) }}" href="{{ pathtocategory('tutorial') }}">Tutorial</a></div>
5454
{% set h_bool = "how-to" in post.category|map('string') %}
55-
<div class="col {{ setcolorclass(h_bool) }}"><a href="{{ pathtocategory('how-to') }}">How-to</a></div>
55+
<div class="col"><a class="{{ setcolorclass(h_bool) }}" href="{{ pathtocategory('how-to') }}">How-to</a></div>
5656
<div class="w-100"></div>
5757
{% set e_bool = "explanation" in post.category|map('string') %}
58-
<div class="col {{ setcolorclass(e_bool) }}"><a href="{{ pathtocategory('explanation') }}">Explanation</a></div>
58+
<div class="col"><a class="{{ setcolorclass(e_bool) }}" href="{{ pathtocategory('explanation') }}">Explanation</a></div>
5959
{% set r_bool = "reference" in post.category|map('string') %}
60-
<div class="col {{ setcolorclass(r_bool) }}"><a href="{{ pathtocategory('reference') }}">Reference</a></div>
60+
<div class="col"><a class="{{ setcolorclass(r_bool) }}" href="{{ pathtocategory('reference') }}">Reference</a></div>
6161
</div>
6262
</div>
6363

examples/case_studies/LKJ.ipynb

Lines changed: 423 additions & 191 deletions
Large diffs are not rendered by default.

examples/case_studies/factor_analysis.ipynb

Lines changed: 304 additions & 127 deletions
Large diffs are not rendered by default.

examples/case_studies/mediation_analysis.ipynb

Lines changed: 307 additions & 306 deletions
Large diffs are not rendered by default.

examples/case_studies/moderation_analysis.ipynb

Lines changed: 281 additions & 287 deletions
Large diffs are not rendered by default.

examples/case_studies/putting_workflow.ipynb

Lines changed: 1116 additions & 640 deletions
Large diffs are not rendered by default.

examples/case_studies/rugby_analytics.ipynb

Lines changed: 944 additions & 488 deletions
Large diffs are not rendered by default.

examples/conf.py

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
{"name": "API", "url": "https://docs.pymc.io/en/stable/api.html"},
7070
],
7171
"page_sidebar_items": ["postcard", "page-toc", "edit-this-page"],
72+
"google_analytics_id": "G-6KPRBTE6WV",
7273
}
7374
version = os.environ.get("READTHEDOCS_VERSION", "")
7475
version = version if "." in version else "main"
@@ -99,12 +100,11 @@
99100
# "sidebar-nav-bs.html",
100101
"postcard_categories.html",
101102
"tagcloud.html",
102-
"sidebar-ethical-ads.html",
103103
],
104104
}
105105

106106
# ablog config
107-
blog_baseurl = "https://examples.pymc.io"
107+
blog_baseurl = "https://docs.pymc.io/projects/examples/en/latest/"
108108
blog_title = "PyMC Examples"
109109
blog_path = "blog"
110110
blog_authors = {
@@ -145,22 +145,8 @@
145145
bibtex_reference_style = "author_year"
146146

147147
# OpenGraph config
148-
# ogp_site_url = "https://predictablynoisy.com"
149-
# ogp_image = "https://predictablynoisy.com/_static/profile-bw.png"
148+
# use default readthedocs integration aka no config here
150149

151-
# codeautolink config
152-
from IPython.core.inputtransformer2 import TransformerManager
153-
154-
155-
def ipython_cell_transform(source):
156-
out = TransformerManager().transform_cell(source)
157-
return source, out
158-
159-
160-
# codeautolink
161-
codeautolink_custom_blocks = {
162-
"ipython3": ipython_cell_transform,
163-
}
164150
codeautolink_autodoc_inject = False
165151
codeautolink_concat_default = True
166152

@@ -169,10 +155,11 @@ def ipython_cell_transform(source):
169155
"aesara": ("https://aesara.readthedocs.io/en/latest/", None),
170156
"arviz": ("https://arviz-devs.github.io/arviz/", None),
171157
"bambi": ("https://bambinos.github.io/bambi/main", None),
158+
"einstats": ("https://xarray-einstats.readthedocs.io/en/stable/", None),
172159
"mpl": ("https://matplotlib.org/", None),
173160
"numpy": ("https://numpy.org/doc/stable/", None),
174161
"pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None),
175-
"pymc": ("https://docs.pymc.io/en/stable/", None),
162+
"pymc": ("https://docs.pymc.io/en/latest/", None),
176163
"scipy": ("https://docs.scipy.org/doc/scipy/reference/", None),
177164
"xarray": ("http://xarray.pydata.org/en/stable/", None),
178165
}

examples/generalized_linear_models/GLM-simpsons-paradox.ipynb

Lines changed: 525 additions & 471 deletions
Large diffs are not rendered by default.

examples/generalized_linear_models/GLM-truncated-censored-regression.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@
955955
"name": "python",
956956
"nbconvert_exporter": "python",
957957
"pygments_lexer": "ipython3",
958-
"version": "3.9.7"
958+
"version": "3.9.9"
959959
}
960960
},
961961
"nbformat": 4,

examples/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,5 @@ has tags in its metadata they are listed on the right sidebar after the {fas}`ta
7676
:hidden:
7777

7878
blog
79+
object_index/index
7980
:::
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
-------------
2+
Distributions
3+
-------------
4+
5+
.. toctree::
6+
:maxdepth: 2
7+
8+
distributions/continuous
9+
distributions/discrete
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Continuous
2+
**********
3+
4+
.. autolink-examples:: pymc.Beta
5+
:type: class
6+
:collapse:
7+
8+
.. autolink-examples:: pymc.Exponential
9+
:type: class
10+
:collapse:
11+
12+
.. autolink-examples:: pymc.Normal
13+
:type: class
14+
:collapse:
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Discrete
2+
********
3+
4+
.. autolink-examples:: pymc.Poisson
5+
:type: class
6+
:collapse:

examples/object_index/index.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.. _object_index:
2+
3+
================
4+
Object use index
5+
================
6+
7+
This page is structured like the {ref}`PyMC API Reference page <pymc:api>` and
8+
for each function in the API it lists all the examples where that PyMC object
9+
is used.
10+
11+
.. warning::
12+
13+
This page is still a proof of concept only. See
14+
`pymc-examples#289 <https://github.com/pymc-devs/pymc-examples/issues/289>`_
15+
for more details.
16+
17+
.. toctree::
18+
:maxdepth: 2
19+
20+
distributions
21+
samplers
22+

examples/object_index/samplers.rst

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
------------------
2+
Sampling functions
3+
------------------
4+
5+
.. autolink-examples:: pymc.sample
6+
:type: func
7+
:collapse:
8+
9+
.. autolink-examples:: pymc.sample_posterior_predictive
10+
:type: func
11+
:collapse:
12+
13+
.. autolink-examples:: pymc.sample_prior_predictive
14+
:type: func
15+
:collapse:
16+
17+
--------
18+
Samplers
19+
--------
20+
21+
.. autolink-examples:: pymc.NUTS
22+
:type: class
23+
:collapse:
24+
25+
.. autolink-examples:: pymc.Metropolis
26+
:type: class
27+
:collapse:
28+
29+
.. autolink-examples:: pymc.Slice
30+
:type: class
31+
:collapse:

0 commit comments

Comments
 (0)