Skip to content

Commit 7e1af48

Browse files
authored
Merge branch 'pymc-devs:main' into main
2 parents d23fc97 + 419af06 commit 7e1af48

File tree

115 files changed

+5189
-2900
lines changed

Some content is hidden

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

115 files changed

+5189
-2900
lines changed

.github/workflows/devcontainer-docker-image.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,30 @@ jobs:
1919

2020
steps:
2121
- name: Checkout source
22-
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
22+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
2323

2424
- name: Setup Docker buildx
25-
uses: docker/setup-buildx-action@v2.4.1
25+
uses: docker/setup-buildx-action@v3.0.0
2626

2727
- name: Prepare metadata
2828
id: meta
29-
uses: docker/metadata-action@69f6fc9d46f2f8bf0d5491e4aabe0bb8c6a4678a
29+
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934
3030
with:
3131
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
3232
tags: |
3333
type=sha,enable=true,prefix=git-
3434
type=raw,value=latest
3535
3636
- name: Log into registry ${{ env.REGISTRY }}
37-
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b
37+
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
3838
with:
3939
registry: ${{ env.REGISTRY }}
4040
username: ${{ github.actor }}
4141
password: ${{ secrets.GITHUB_TOKEN }}
4242

4343
- name: Build and push Docker image
4444
id: docker_build
45-
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
45+
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09
4646
with:
4747
context: .
4848
file: scripts/dev.Dockerfile

.github/workflows/dispatched_pre-commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runPreCommit:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v3
10+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
1111
with:
1212
repository: ${{github.event.client_payload.pull_request.head.repo.full_name}}
1313
ref: ${{github.event.client_payload.pull_request.head.ref}}

.github/workflows/docker-image.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout code
16-
uses: actions/checkout@v3
16+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
1717

1818
- name: Login to Docker Hub
19-
uses: docker/login-action@v2
19+
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
2020
with:
2121
username: ${{ secrets.DOCKERHUB_USERNAME }}
2222
password: ${{ secrets.DOCKERHUB_TOKEN }}
2323

2424
- name: Extract metadata (tags, labels) for Docker
2525
id: meta
26-
uses: docker/metadata-action@v4
26+
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934
2727
with:
2828
images: |
2929
name=pymc/pymc,enable=true
@@ -34,7 +34,7 @@ jobs:
3434
type=semver,pattern={{major}}.{{minor}}
3535
3636
- name: Build and load image
37-
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
37+
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09
3838
with:
3939
context: .
4040
file: scripts/Dockerfile
@@ -46,7 +46,7 @@ jobs:
4646
docker run --rm ${{ env.CONTAINER_NAME }} conda run -n pymc-dev python -c 'import pymc;print(pymc.__version__)'
4747
4848
- name: Build and push
49-
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
49+
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09
5050
with:
5151
context: .
5252
push: true

.github/workflows/pre-commit.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,18 @@ jobs:
1111
env:
1212
SKIP: no-commit-to-branch
1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
1515
- uses: actions/setup-python@v4
16+
with:
17+
python-version: "3.9" # Run pre-commit on oldest supported Python version
1618
- uses: pre-commit/[email protected]
1719
mypy:
1820
runs-on: ubuntu-latest
1921
defaults:
2022
run:
2123
shell: bash -l {0}
2224
steps:
23-
- uses: actions/checkout@v3
25+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
2426
- name: Cache conda
2527
uses: actions/cache@v3
2628
env:
@@ -50,7 +52,7 @@ jobs:
5052
activate-environment: pymc-test
5153
channel-priority: strict
5254
environment-file: conda-envs/environment-test.yml
53-
python-version: 3.9
55+
python-version: "3.9" # Run pre-commit on oldest supported Python version
5456
use-mamba: true
5557
use-only-tar-bz2: false # IMPORTANT: This may break caching of conda packages! See https://github.com/conda-incubator/setup-miniconda/issues/267
5658
- name: Install-pymc and mypy dependencies

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
env:
1212
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN_PYMC }}
1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
1515
- name: Set up Python
1616
uses: actions/setup-python@v4
1717
with:

.github/workflows/tests.yml

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
outputs:
2525
changes: ${{ steps.changes.outputs.src }}
2626
steps:
27-
- uses: actions/checkout@v3
27+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
2828
with:
2929
fetch-depth: 0
3030
- uses: dorny/paths-filter@v2
@@ -93,7 +93,10 @@ jobs:
9393
tests/gp/test_gp.py
9494
tests/gp/test_mean.py
9595
tests/gp/test_util.py
96-
tests/test_model.py
96+
tests/model/test_core.py
97+
tests/model/test_fgraph.py
98+
tests/model/transform/test_basic.py
99+
tests/model/transform/test_conditioning.py
97100
tests/test_model_graph.py
98101
tests/ode/test_ode.py
99102
tests/ode/test_utils.py
@@ -126,7 +129,7 @@ jobs:
126129
run:
127130
shell: bash -l {0}
128131
steps:
129-
- uses: actions/checkout@v3
132+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
130133
- name: Cache conda
131134
uses: actions/cache@v3
132135
env:
@@ -187,7 +190,7 @@ jobs:
187190
python-version: ["3.9"]
188191
test-subset:
189192
- tests/variational/test_approximations.py tests/variational/test_callbacks.py tests/variational/test_inference.py tests/variational/test_opvi.py tests/test_initial_point.py
190-
- tests/test_model.py tests/sampling/test_mcmc.py
193+
- tests/model/test_core.py tests/sampling/test_mcmc.py
191194
- tests/gp/test_cov.py tests/gp/test_gp.py tests/gp/test_mean.py tests/gp/test_util.py tests/ode/test_ode.py tests/ode/test_utils.py tests/smc/test_smc.py tests/sampling/test_parallel.py
192195
- tests/step_methods/test_metropolis.py tests/step_methods/test_slicer.py tests/step_methods/hmc/test_nuts.py tests/step_methods/test_compound.py tests/step_methods/hmc/test_hmc.py
193196

@@ -200,7 +203,7 @@ jobs:
200203
run:
201204
shell: cmd
202205
steps:
203-
- uses: actions/checkout@v3
206+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
204207
- name: Cache conda
205208
uses: actions/cache@v3
206209
env:
@@ -266,7 +269,7 @@ jobs:
266269
tests/sampling/test_parallel.py
267270
tests/test_data.py
268271
tests/variational/test_minibatch_rv.py
269-
tests/test_model.py
272+
tests/model/test_core.py
270273
271274
- |
272275
tests/sampling/test_mcmc.py
@@ -283,7 +286,7 @@ jobs:
283286
run:
284287
shell: bash -l {0}
285288
steps:
286-
- uses: actions/checkout@v3
289+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
287290
- name: Cache conda
288291
uses: actions/cache@v3
289292
env:
@@ -351,16 +354,16 @@ jobs:
351354
run:
352355
shell: bash -l {0}
353356
steps:
354-
- uses: actions/checkout@v3
357+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
355358
- name: Cache conda
356359
uses: actions/cache@v3
357360
env:
358-
# Increase this value to reset cache if environment-test.yml has not changed
361+
# Increase this value to reset cache if environment-jax.yml has not changed
359362
CACHE_NUMBER: 0
360363
with:
361364
path: ~/conda_pkgs_dir
362365
key: ${{ runner.os }}-py${{matrix.python-version}}-conda-${{ env.CACHE_NUMBER }}-${{
363-
hashFiles('conda-envs/environment-test.yml') }}
366+
hashFiles('conda-envs/environment-jax.yml') }}
364367
- name: Cache multiple paths
365368
uses: actions/cache@v3
366369
env:
@@ -380,7 +383,7 @@ jobs:
380383
mamba-version: "*"
381384
activate-environment: pymc-test
382385
channel-priority: strict
383-
environment-file: conda-envs/environment-test.yml
386+
environment-file: conda-envs/environment-jax.yml
384387
python-version: ${{matrix.python-version}}
385388
use-mamba: true
386389
use-only-tar-bz2: false # IMPORTANT: This may break caching of conda packages! See https://github.com/conda-incubator/setup-miniconda/issues/267
@@ -389,11 +392,6 @@ jobs:
389392
conda activate pymc-test
390393
pip install -e .
391394
python --version
392-
- name: Install external samplers
393-
run: |
394-
conda activate pymc-test
395-
pip install "numpyro>=0.8.0"
396-
pip install git+https://github.com/blackjax-devs/[email protected]
397395
- name: Run tests
398396
run: |
399397
python -m pytest -vv --cov=pymc --cov-report=xml --no-cov-on-fail --cov-report term --durations=50 $TEST_SUBSET
@@ -424,7 +422,7 @@ jobs:
424422
run:
425423
shell: cmd
426424
steps:
427-
- uses: actions/checkout@v3
425+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
428426
- name: Cache conda
429427
uses: actions/cache@v3
430428
env:

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@ repos:
2929
- id: isort
3030
name: isort
3131
- repo: https://github.com/asottile/pyupgrade
32-
rev: v3.9.0
32+
rev: v3.10.1
3333
hooks:
3434
- id: pyupgrade
3535
args: [--py37-plus]
3636
- repo: https://github.com/psf/black
37-
rev: 23.7.0
37+
rev: 23.9.1
3838
hooks:
3939
- id: black
4040
- id: black-jupyter
4141
- repo: https://github.com/PyCQA/pylint
42-
rev: v3.0.0a6
42+
rev: v3.0.0a7
4343
hooks:
4444
- id: pylint
4545
args: [--rcfile=.pylintrc]

CITATION.bib

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
@article{Salvatier2016,
2-
doi = {10.7717/peerj-cs.55},
3-
url = {https://doi.org/10.7717/peerj-cs.55},
4-
year = {2016},
5-
month = {apr},
1+
@article{pymc2023,
2+
title={PyMC: A Modern and Comprehensive Probabilistic Programming Framework in Python},
3+
author={Abril-Pla Oriol and Andreani Virgile and Carroll Colin and Dong Larry and Fonnesbeck Christopher J. and Kochurov Maxim and Kumar Ravin and Lao Jupeng and Luhmann Christian C. and Martin Osvaldo A. and Osthege Michael and Vieira Ricardo and Wiecki Thomas and Zinkov Robert},
4+
journal = {{PeerJ} Computer Science},
65
publisher = {{PeerJ}},
7-
volume = {2},
8-
pages = {e55},
9-
author = {John Salvatier and Thomas V. Wiecki and Christopher Fonnesbeck},
10-
title = {Probabilistic programming in Python using {PyMC}3},
11-
journal = {{PeerJ} Computer Science}
6+
volume={9},
7+
pages={e1516},
8+
year={2023},
9+
doi={10.7717/peerj-cs.1516}
1210
}

README.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Learn Bayesian statistics with a book together with PyMC
4747
--------------------------------------------------------
4848

4949
- `Probabilistic Programming and Bayesian Methods for Hackers <https://github.com/CamDavidsonPilon/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers>`__: Fantastic book with many applied code examples.
50-
- `PyMC port of the book "Doing Bayesian Data Analysis" by John Kruschke <https://github.com/aloctavodia/Doing_bayesian_data_analysis>`__ as well as the `second edition <https://github.com/JWarmenhoven/DBDA-python>`__: Principled introduction to Bayesian data analysis.
50+
- `PyMC port of the book "Doing Bayesian Data Analysis" by John Kruschke <https://github.com/cluhmann/DBDA-python>`__ as well as the `first edition <https://github.com/aloctavodia/Doing_bayesian_data_analysis>`__.
5151
- `PyMC port of the book "Statistical Rethinking A Bayesian Course with Examples in R and Stan" by Richard McElreath <https://github.com/pymc-devs/resources/tree/master/Rethinking>`__
5252
- `PyMC port of the book "Bayesian Cognitive Modeling" by Michael Lee and EJ Wagenmakers <https://github.com/pymc-devs/resources/tree/master/BCM>`__: Focused on using Bayesian statistics in cognitive modeling.
5353
- `Bayesian Analysis with Python <https://www.packtpub.com/big-data-and-business-intelligence/bayesian-analysis-python-second-edition>`__ (second edition) by Osvaldo Martin: Great introductory book. (`code <https://github.com/aloctavodia/BAP>`__ and errata).
@@ -68,12 +68,12 @@ Citing PyMC
6868
===========
6969
Please choose from the following:
7070

71-
- |DOIpaper| *Probabilistic programming in Python using PyMC3*, Salvatier J., Wiecki T.V., Fonnesbeck C. (2016)
71+
- |DOIpaper| *PyMC: A Modern and Comprehensive Probabilistic Programming Framework in Python*, Abril-Pla O, Andreani V, Carroll C, Dong L, Fonnesbeck CJ, Kochurov M, Kumar R, Lao J, Luhmann CC, Martin OA, Osthege M, Vieira R, Wiecki T, Zinkov R. (2023)
7272
- |DOIzenodo| A DOI for all versions.
7373
- DOIs for specific versions are shown on Zenodo and under `Releases <https://github.com/pymc-devs/pymc/releases>`_
7474

75-
.. |DOIpaper| image:: https://img.shields.io/badge/DOI-10.7717%2Fpeerj--cs.55-blue
76-
:target: https://doi.org/10.7717/peerj-cs.55
75+
.. |DOIpaper| image:: https://img.shields.io/badge/DOI-10.7717%2Fpeerj--cs.1516-blue
76+
:target: https://doi.org/10.7717/peerj-cs.1516
7777
.. |DOIzenodo| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.4603970.svg
7878
:target: https://doi.org/10.5281/zenodo.4603970
7979

conda-envs/environment-dev.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ dependencies:
1414
- numpy>=1.15.0
1515
- pandas>=0.24.0
1616
- pip
17-
- pytensor>=2.14.1,<2.15
17+
- pytensor>=2.17.0,<2.18
1818
- python-graphviz
1919
- networkx
2020
- scipy>=1.4.1
@@ -36,7 +36,7 @@ dependencies:
3636
- watermark
3737
- polyagamma
3838
- sphinx-remove-toctrees
39-
- mypy=0.990
39+
- mypy=1.5.1
4040
- types-cachetools
4141
- pip:
4242
- git+https://github.com/pymc-devs/pymc-sphinx-theme

conda-envs/environment-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dependencies:
1212
- numpy>=1.15.0
1313
- pandas>=0.24.0
1414
- pip
15-
- pytensor>=2.14.1,<2.15
15+
- pytensor>=2.17.0,<2.18
1616
- python-graphviz
1717
- scipy>=1.4.1
1818
- typing-extensions>=3.7.4

conda-envs/environment-jax.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# "test" conda envs are used to set up our CI environment in GitHub actions
2+
name: pymc-test
3+
channels:
4+
- conda-forge
5+
- defaults
6+
dependencies:
7+
# Base dependencies
8+
- arviz>=0.13.0
9+
- blas
10+
- cachetools>=4.2.1
11+
- cloudpickle
12+
- fastprogress>=0.2.0
13+
- h5py>=2.7
14+
# Jaxlib version must not be greater than jax version!
15+
- blackjax>=1.0.0
16+
- jaxlib==0.4.14
17+
- jax==0.4.16
18+
- libblas=*=*mkl
19+
- mkl-service
20+
- numpy>=1.15.0
21+
- numpyro>=0.8.0
22+
- pandas>=0.24.0
23+
- pip
24+
- pytensor>=2.17.0,<2.18
25+
- python-graphviz
26+
- networkx
27+
- scipy>=1.4.1
28+
- typing-extensions>=3.7.4
29+
# Extra dependencies for testing
30+
- ipython>=7.16
31+
- pre-commit>=2.8.0
32+
- pytest-cov>=2.5
33+
- pytest>=3.0
34+
- mypy=1.5.1
35+
- types-cachetools
36+
- pip:
37+
- numdifftools>=0.9.40
38+
- mcbackend>=0.4.0

conda-envs/environment-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dependencies:
1717
- numpy>=1.15.0
1818
- pandas>=0.24.0
1919
- pip
20-
- pytensor>=2.14.1,<2.15
20+
- pytensor>=2.17.0,<2.18
2121
- python-graphviz
2222
- networkx
2323
- scipy>=1.4.1
@@ -27,7 +27,7 @@ dependencies:
2727
- pre-commit>=2.8.0
2828
- pytest-cov>=2.5
2929
- pytest>=3.0
30-
- mypy=0.990
30+
- mypy=1.5.1
3131
- types-cachetools
3232
- pip:
3333
- numdifftools>=0.9.40

0 commit comments

Comments
 (0)