Skip to content

Commit 5bf0c2d

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 156cfb4 + e51b9d3 commit 5bf0c2d

22 files changed

+814
-52
lines changed

.pre-commit-config.yaml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v3.2.0
3+
rev: v3.3.0
44
hooks:
55
- id: end-of-file-fixer
66
- id: check-toml
77
- repo: https://github.com/nbQA-dev/nbQA
8-
rev: 0.3.2
8+
rev: 0.3.5
99
hooks:
1010
- id: nbqa-black
1111
- id: nbqa-isort
1212
- id: nbqa-pyupgrade
1313
- repo: https://github.com/asottile/pyupgrade
14-
rev: v2.7.2
14+
rev: v2.7.3
1515
hooks:
1616
- id: pyupgrade
1717
args: [--py36-plus]
@@ -22,7 +22,14 @@ repos:
2222
- repo: local
2323
hooks:
2424
- id: watermark
25-
name: Check notebooks have watermark
25+
name: Check notebooks have watermark (see Jupyter style guide from PyMC3 Uncyclo)
2626
types: [jupyter]
27-
entry: python scripts/check_watermark.py
27+
entry: '%load_ext watermark.*%watermark -n -u -v -iv -w'
28+
language: pygrep
29+
args: [--negate, --multiline]
30+
minimum_pre_commit_version: 2.8.0
31+
- id: check-toc
32+
name: Check all notebooks appear in table of contents
33+
types: [jupyter]
34+
entry: python scripts/check_toc_is_complete.py
2835
language: python

README.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@ Check out the `getting started guide <http://docs.pymc.io/notebooks/getting_star
1515
using Binder!
1616
For questions on PyMC3, head on over to our `PyMC Discourse <https://discourse.pymc.io/>`__ forum.
1717

18+
The future of PyMC3 & Theano
19+
============================
20+
21+
There have been many questions and uncertainty around the future of PyMC3 since Theano
22+
stopped getting developed by the original authors, and we started experiments with PyMC4.
23+
24+
We are happy to announce that PyMC3 on Theano (which we are `developing further <https://github.com/pymc-devs/Theano-PyMC>`__)
25+
with a new JAX backend is the future. PyMC4 will not be developed further.
26+
27+
See the `full announcement <https://pymc-devs.medium.com/the-future-of-pymc3-or-theano-is-dead-long-live-theano-d8005f8a0e9b>`__
28+
for more details.
29+
1830
Features
1931
========
2032

RELEASE-NOTES.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@
1616
- `sample_posterior_predictive_w` can now feed on `xarray.Dataset` - e.g. from `InferenceData.posterior`. (see [#4042](https://github.com/pymc-devs/pymc3/pull/4042))
1717
- Added `pymc3.gp.cov.Circular` kernel for Gaussian Processes on circular domains, e.g. the unit circle (see [#4082](https://github.com/pymc-devs/pymc3/pull/4082)).
1818
- Add MLDA, a new stepper for multilevel sampling. MLDA can be used when a hierarchy of approximate posteriors of varying accuracy is available, offering improved sampling efficiency especially in high-dimensional problems and/or where gradients are not available (see [#3926](https://github.com/pymc-devs/pymc3/pull/3926))
19-
- Change SMC metropolis kernel to independent metropolis kernel [#4115](https://github.com/pymc-devs/pymc3/pull/3926))
19+
- Change SMC metropolis kernel to independent metropolis kernel [#4115](https://github.com/pymc-devs/pymc3/pull/4115))
2020
- Add alternative parametrization to NegativeBinomial distribution in terms of n and p (see [#4126](https://github.com/pymc-devs/pymc3/issues/4126))
21+
- Add Bayesian Additive Regression Trees (BARTs) [#4183](https://github.com/pymc-devs/pymc3/pull/4183))
2122
- Added a new `MixtureSameFamily` distribution to handle mixtures of arbitrary dimensions in vectorized form (see [#4185](https://github.com/pymc-devs/pymc3/issues/4185)).
2223

2324

25+
2426
## PyMC3 3.9.3 (11 August 2020)
2527

2628
### Maintenance

docs/source/notebooks/GLM-hierarchical.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"Gelman et al.'s (2007) radon dataset is a classic for hierarchical modeling. In this dataset the amount of the radioactive gas radon has been measured among different households in all counties of several states. Radon gas is known to be the highest cause of lung cancer in non-smokers. It is believed to be more strongly present in households containing a basement and to differ in amount present among types of soil.\n",
3737
"Here we'll investigate this differences and try to make predictions of radonlevels in different counties based on the county itself and the presence of a basement. In this example we'll look at Minnesota, a state that contains 85 counties in which different measurements are taken, ranging from 2 to 116 measurements per county. \n",
3838
"\n",
39-
"![radon](http://www.fix-your-radon.com/images/how_radon_enters.jpg)"
39+
"![radon](https://upload.wikimedia.org/wikipedia/commons/b/b9/CNX_Chem_21_06_RadonExpos.png)"
4040
]
4141
},
4242
{

docs/source/notebooks/api_quickstart.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,7 @@
998998
"\n",
999999
"The main entry point to MCMC sampling algorithms is via the `pm.sample()` function. By default, this function tries to auto-assign the right sampler(s) and auto-initialize if you don't pass anything.\n",
10001000
"\n",
1001-
"With PyMC3 version >=3.9 the `return_inferencedata=True` kwarg makes the `sample` function return an `arviz.InferenceData` object instead of a `MultiTrace`. `InferenceData` has many advantages, compared to a `MultiTrace`: For example it can be saved/loaded from a file, and can also carry additional (meta)data such as date/version, or posterior predictive distributions. Take a look at the [ArviZ Quickstart](https://arviz-devs.github.io/arviz/notebooks/Introduction.html) to learn more."
1001+
"With PyMC3 version >=3.9 the `return_inferencedata=True` kwarg makes the `sample` function return an `arviz.InferenceData` object instead of a `MultiTrace`. `InferenceData` has many advantages, compared to a `MultiTrace`: For example it can be saved/loaded from a file, and can also carry additional (meta)data such as date/version, or posterior predictive distributions. Take a look at the [ArviZ Quickstart](https://arviz-devs.github.io/arviz/getting_started/Introduction.html) to learn more."
10021002
]
10031003
},
10041004
{
@@ -2325,7 +2325,7 @@
23252325
"name": "python",
23262326
"nbconvert_exporter": "python",
23272327
"pygments_lexer": "ipython3",
2328-
"version": "3.7.7"
2328+
"version": "3.6.8"
23292329
}
23302330
},
23312331
"nbformat": 4,

docs/source/notebooks/blackbox_external_likelihood.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"import theano\n",
5252
"import theano.tensor as tt\n",
5353
"\n",
54-
"print(\"Running on PyMC3 v{}\".format(pm.__version__))"
54+
"print(f\"Running on PyMC3 v{pm.__version__}\")"
5555
]
5656
},
5757
{
@@ -697,7 +697,7 @@
697697
" color=colors[i],\n",
698698
" hist_kwargs={\"density\": True},\n",
699699
" **hist2dkwargs,\n",
700-
" truths=[mtrue, ctrue]\n",
700+
" truths=[mtrue, ctrue],\n",
701701
" )\n",
702702
" else:\n",
703703
" corner.corner(\n",
@@ -729,15 +729,15 @@
729729
"test_grad_op_func = theano.function([var], test_grad_op(var))\n",
730730
"grad_vals = test_grad_op_func([mtrue, ctrue])\n",
731731
"\n",
732-
"print('Gradient returned by \"LogLikeGrad\": {}'.format(grad_vals))\n",
732+
"print(f'Gradient returned by \"LogLikeGrad\": {grad_vals}')\n",
733733
"\n",
734734
"# test the gradient called through LogLikeWithGrad\n",
735735
"test_gradded_op = LogLikeWithGrad(my_loglike, data, x, sigma)\n",
736736
"test_gradded_op_grad = tt.grad(test_gradded_op(var), var)\n",
737737
"test_gradded_op_grad_func = theano.function([var], test_gradded_op_grad)\n",
738738
"grad_vals_2 = test_gradded_op_grad_func([mtrue, ctrue])\n",
739739
"\n",
740-
"print('Gradient returned by \"LogLikeWithGrad\": {}'.format(grad_vals_2))\n",
740+
"print(f'Gradient returned by \"LogLikeWithGrad\": {grad_vals_2}')\n",
741741
"\n",
742742
"# test the gradient that PyMC3 uses for the Normal log likelihood\n",
743743
"test_model = pm.Model()\n",
@@ -751,7 +751,7 @@
751751
" gradfunc.set_extra_values({\"m_interval__\": mtrue, \"c_interval__\": ctrue})\n",
752752
" grad_vals_pymc3 = gradfunc(np.array([mtrue, ctrue]))[1] # get dlogp values\n",
753753
"\n",
754-
"print('Gradient returned by PyMC3 \"Normal\" distribution: {}'.format(grad_vals_pymc3))"
754+
"print(f'Gradient returned by PyMC3 \"Normal\" distribution: {grad_vals_pymc3}')"
755755
]
756756
},
757757
{

docs/source/notebooks/table_of_contents_examples.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Gallery.contents = {
3434
"gaussian_process": "Gaussian Processes",
3535
"conditional-autoregressive-model": "Gaussian Processes",
3636
"log-gaussian-cox-process":"Gaussian Processes",
37+
"GP-Circular": "Gaussian Processes",
3738
"dependent_density_regression": "Mixture Models",
3839
"dp_mix": "Mixture Models",
3940
"gaussian-mixture-model-advi": "Mixture Models",
@@ -59,6 +60,7 @@ Gallery.contents = {
5960
"ODE_with_manual_gradients": "Inference in ODE models",
6061
"ODE_API_introduction": "Inference in ODE models",
6162
"probabilistic_matrix_factorization": "Case Studies",
63+
"MLDA_introduction": "MCMC",
6264
"MLDA_simple_linear_regression": "MCMC",
6365
"MLDA_gravity_surveying": "MCMC",
6466
"MLDA_variance_reduction_linear_regression": "MCMC"

docs/source/notebooks/table_of_contents_tutorials.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ Gallery.contents = {
66
"Gaussian_Processes.rst": "Basics",
77
"data_container": "Basics",
88
"sampling_compound_step": "Deep dives",
9+
"sampling_callback": "Deep dives",
910
"sampler-stats": "Deep dives",
1011
"Diagnosing_biased_Inference_with_Divergences": "Deep dives",
1112
"Advanced_usage_of_Theano_in_PyMC3.rst": "Deep dives",
1213
"getting_started": "Deep dives",
1314
"ODE_API_shapes_and_benchmarking": "Deep dives",
1415
"DEMetropolisZ_EfficiencyComparison": "Deep dives",
1516
"DEMetropolisZ_tune_drop_fraction": "Deep dives",
17+
"factor_analysis": "Deep dives",
1618
"blackbox_external_likelihood": "How-To",
1719
"profiling": "How-To",
1820
"howto_debugging": "How-To",

environment-dev.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ dependencies:
2121
- nose>=1.3
2222
- nose-parameterized>=0.6
2323
- numpydoc>=0.9
24+
- pre-commit>=2.8.0
2425
- pycodestyle>=2.3
2526
- pyflakes>=1.5
2627
- pylint>=1.7

pymc3/distributions/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,11 @@
9999
from .timeseries import MvGaussianRandomWalk
100100
from .timeseries import MvStudentTRandomWalk
101101

102+
from .bart import BART
103+
102104
from .bound import Bound
103105

106+
104107
__all__ = [
105108
"Uniform",
106109
"Flat",
@@ -177,4 +180,5 @@
177180
"Moyal",
178181
"Simulator",
179182
"fast_sample_posterior_predictive",
183+
"BART",
180184
]

0 commit comments

Comments
 (0)