Skip to content

Commit fac09f8

Browse files
Merge branch 'master' into fix-4206
2 parents 2e38d89 + a6295a3 commit fac09f8

Some content is hidden

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

50 files changed

+1818
-1695
lines changed

.codecov.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
codecov:
2-
require_ci_to_pass: yes
2+
require_ci_to_pass: no
3+
notify:
4+
after_n_builds: 9
35

46
coverage:
57
precision: 2
68
round: down
79
range: "70...100"
8-
910
status:
10-
project: yes
11-
patch: yes
12-
changes: no
11+
project:
12+
default:
13+
# basic
14+
target: auto
15+
threshold: 1%
16+
base: auto
17+
patch:
18+
default:
19+
# basic
20+
target: 50%
21+
threshold: 1%
22+
base: auto
1323

1424
comment:
1525
layout: "reach, diff, flags, files"

.github/workflows/arviz_compat.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: arviz-compatibility
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
8+
jobs:
9+
pytest:
10+
strategy:
11+
matrix:
12+
python-version: ["3.8"]
13+
os: [ubuntu-18.04]
14+
floatx: [float64]
15+
test-subset:
16+
- pymc3/tests/test_sampling.py
17+
runs-on: ${{ matrix.os }}
18+
env:
19+
TEST_SUBSET: ${{ matrix.test-subset }}
20+
THEANO_FLAGS: floatX=${{ matrix.floatx }},gcc.cxxflags='-march=native'
21+
defaults:
22+
run:
23+
shell: bash -l {0}
24+
steps:
25+
- uses: actions/checkout@v2
26+
- name: Cache conda
27+
uses: actions/cache@v1
28+
env:
29+
# Increase this value to reset cache if environment-dev.yml has not changed
30+
CACHE_NUMBER: 0
31+
with:
32+
path: ~/conda_pkgs_dir
33+
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
34+
hashFiles('environment-dev.yml') }}
35+
- uses: conda-incubator/setup-miniconda@v2
36+
with:
37+
activate-environment: testenv
38+
channel-priority: strict
39+
environment-file: environment-dev.yml
40+
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
41+
- run: |
42+
conda activate testenv
43+
conda remove arviz -y
44+
pip install git+git://github.com/arviz-devs/arviz.git
45+
python -m pytest -v --cov=pymc3 --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET -n auto

.github/workflows/pytest.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: pytest
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
8+
jobs:
9+
pytest:
10+
strategy:
11+
matrix:
12+
python-version: ["3.6"]
13+
os: [ubuntu-18.04]
14+
floatx: [float32, float64]
15+
test-subset:
16+
- |
17+
--ignore=pymc3/tests/test_dist_math.py
18+
--ignore=pymc3/tests/test_distribution_defaults.py
19+
--ignore=pymc3/tests/test_distributions.py
20+
--ignore=pymc3/tests/test_distributions_random.py
21+
--ignore=pymc3/tests/test_distributions_timeseries.py
22+
--ignore=pymc3/tests/test_examples.py
23+
--ignore=pymc3/tests/test_gp.py
24+
--ignore=pymc3/tests/test_parallel_sampling.py
25+
--ignore=pymc3/tests/test_posteriors.py
26+
--ignore=pymc3/tests/test_quadpotential.py
27+
--ignore=pymc3/tests/test_random.py
28+
--ignore=pymc3/tests/test_sampling.py
29+
--ignore=pymc3/tests/test_shape_handling
30+
--ignore=pymc3/tests/test_shared.py
31+
--ignore=pymc3/tests/test_smc.py
32+
--ignore=pymc3/tests/test_updates.py
33+
--ignore=pymc3/tests/test_variational_inference.py
34+
- |
35+
pymc3/tests/test_dist_math.py
36+
pymc3/tests/test_distribution_defaults.py
37+
pymc3/tests/test_distributions_random.py
38+
pymc3/tests/test_distributions_timeseries.py
39+
pymc3/tests/test_parallel_sampling.py
40+
pymc3/tests/test_random.py
41+
pymc3/tests/test_sampling.py
42+
pymc3/tests/test_shared.py
43+
pymc3/tests/test_smc.py
44+
- |
45+
pymc3/tests/test_examples.py
46+
pymc3/tests/test_gp.py
47+
pymc3/tests/test_posteriors.py
48+
pymc3/tests/test_quadpotential.py
49+
- |
50+
pymc3/tests/test_shape_handling.py
51+
pymc3/tests/test_updates.py
52+
pymc3/tests/test_variational_inference.py
53+
- |
54+
pymc3/tests/test_distributions.py
55+
runs-on: ${{ matrix.os }}
56+
env:
57+
TEST_SUBSET: ${{ matrix.test-subset }}
58+
THEANO_FLAGS: floatX=${{ matrix.floatx }},gcc.cxxflags='-march=native'
59+
defaults:
60+
run:
61+
shell: bash -l {0}
62+
steps:
63+
- uses: actions/checkout@v2
64+
- name: Cache conda
65+
uses: actions/cache@v1
66+
env:
67+
# Increase this value to reset cache if environment-dev.yml has not changed
68+
CACHE_NUMBER: 0
69+
with:
70+
path: ~/conda_pkgs_dir
71+
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
72+
hashFiles('environment-dev.yml') }}
73+
- uses: conda-incubator/setup-miniconda@v2
74+
with:
75+
activate-environment: testenv
76+
channel-priority: strict
77+
environment-file: environment-dev.yml
78+
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
79+
- run: |
80+
conda activate testenv
81+
python -m pytest -v --cov=pymc3 --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET -n auto
82+
- name: Upload coverage to Codecov
83+
uses: codecov/codecov-action@v1
84+
with:
85+
env_vars: OS,PYTHON
86+
name: codecov-umbrella
87+
fail_ci_if_error: false

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ _build
2121
# Merge tool
2222
*.orig
2323

24-
# Test artifacts
25-
mcmc.sqlite
26-
2724
# Docker development
2825
# notebooks/
2926

@@ -41,3 +38,6 @@ benchmarks/results/
4138
pytestdebug.log
4239
.dir-locals.el
4340
.pycheckers
41+
42+
# Codespaces
43+
pythonenv*

.pre-commit-config.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,29 @@ repos:
55
- id: end-of-file-fixer
66
- id: check-toml
77
- repo: https://github.com/nbQA-dev/nbQA
8-
rev: 0.3.5
8+
rev: 0.4.1
99
hooks:
1010
- id: nbqa-black
11+
additional_dependencies: [black==20.8b1]
1112
- id: nbqa-isort
13+
additional_dependencies: [isort==5.6.4]
1214
- id: nbqa-pyupgrade
15+
additional_dependencies: [pyupgrade==2.7.4]
1316
- repo: https://github.com/asottile/pyupgrade
14-
rev: v2.7.3
17+
rev: v2.7.4
1518
hooks:
1619
- id: pyupgrade
1720
args: [--py36-plus]
1821
- repo: https://github.com/psf/black
1922
rev: 20.8b1
2023
hooks:
2124
- id: black
25+
- repo: https://github.com/PyCQA/pylint
26+
rev: pylint-2.6.0
27+
hooks:
28+
- id: pylint
29+
args: [--rcfile=.pylintrc]
30+
files: ^pymc3/
2231
- repo: local
2332
hooks:
2433
- id: watermark

.pylintrc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ disable=all
3434
# Enable the message, report, category or checker with the given id(s). You can
3535
# either give multiple identifier separated by comma (,) or put this option
3636
# multiple time. See also the "--disable" option for examples.
37-
enable=import-error,
38-
import-self,
37+
enable=import-self,
3938
reimported,
4039
wildcard-import,
4140
misplaced-future,

.travis.yml

Lines changed: 0 additions & 68 deletions
This file was deleted.

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Features
3939
- **Variational inference**: `ADVI <http://www.jmlr.org/papers/v18/16-107.html>`__
4040
for fast approximate posterior estimation as well as mini-batch ADVI
4141
for large data sets.
42-
- Relies on `Theano <http://deeplearning.net/software/theano/>`__ which provides:
42+
- Relies on `Theano <https://theano-pymc.readthedocs.io/en/latest/>`__ which provides:
4343
* Computation optimization and dynamic C compilation
4444
* Numpy broadcasting and advanced indexing
4545
* Linear algebra operators

RELEASE-NOTES.md

Lines changed: 46 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,74 @@
11
# Release Notes
22

3-
## PyMC3 3.9.x (on deck)
3+
## PyMC3 3.10.0 (on deck)
4+
5+
This is a major release with many exciting new features. The biggest change is that we now rely on our own fork of [Theano-PyMC](https://github.com/pymc-devs/Theano-PyMC). This is in line with our [big announcement about our commitment to PyMC3 and Theano](https://pymc-devs.medium.com/the-future-of-pymc3-or-theano-is-dead-long-live-theano-d8005f8a0e9b).
6+
7+
When upgrading, make sure that `Theano-PyMC` and not `Theano` are installed (the imports remain unchanged, however). If not, you can uninstall `Theano`:
8+
```
9+
conda remove theano
10+
```
11+
12+
And to install:
13+
```
14+
conda install -c conda-forge theano-pymc
15+
```
16+
17+
Or, if you are using pip (not recommended):
18+
```
19+
pip uninstall theano
20+
```
21+
And to install:
22+
```
23+
pip install theano-pymc
24+
```
25+
26+
This new version of `Theano-PyMC` comes with an experimental JAX backend which, when combined with the new and experimental JAX samplers in PyMC3, can greatly speed up sampling in your model. As this is still very new, please do not use it in production yet but do test it out and let us know if anything breaks and what results you are seeing, especially speed-wise.
27+
28+
### New features
29+
- 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))
30+
- Add Bayesian Additive Regression Trees (BARTs) [#4183](https://github.com/pymc-devs/pymc3/pull/4183))
31+
- 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)).
32+
- Added a new `MixtureSameFamily` distribution to handle mixtures of arbitrary dimensions in vectorized form for improved speed (see [#4185](https://github.com/pymc-devs/pymc3/issues/4185)).
33+
- `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))
34+
- Change SMC metropolis kernel to independent metropolis kernel [#4115](https://github.com/pymc-devs/pymc3/pull/4115))
35+
- Add alternative parametrization to NegativeBinomial distribution in terms of n and p (see [#4126](https://github.com/pymc-devs/pymc3/issues/4126))
36+
- Added semantically meaningful `str` representations to PyMC3 objects for console, notebook, and GraphViz use (see [#4076](https://github.com/pymc-devs/pymc3/pull/4076), [#4065](https://github.com/pymc-devs/pymc3/pull/4065), [#4159](https://github.com/pymc-devs/pymc3/pull/4159), [#4217](https://github.com/pymc-devs/pymc3/pull/4217), and [#4243](https://github.com/pymc-devs/pymc3/pull/4243)).
437

538
### Maintenance
639
- Switch the dependency of Theano to our own fork, [Theano-PyMC](https://github.com/pymc-devs/Theano-PyMC).
7-
- Mentioned the way to do any random walk with `theano.tensor.cumsum()` in `GaussianRandomWalk` docstrings (see [#4048](https://github.com/pymc-devs/pymc3/pull/4048)).
8-
- Fixed numerical instability in ExGaussian's logp by preventing `logpow` from returning `-inf` (see [#4050](https://github.com/pymc-devs/pymc3/pull/4050)).
40+
- Removed non-NDArray (Text, SQLite, HDF5) backends and associated tests.
941
- Use dill to serialize user defined logp functions in `DensityDist`. The previous serialization code fails if it is used in notebooks on Windows and Mac. `dill` is now a required dependency. (see [#3844](https://github.com/pymc-devs/pymc3/issues/3844)).
42+
- Fixed numerical instability in ExGaussian's logp by preventing `logpow` from returning `-inf` (see [#4050](https://github.com/pymc-devs/pymc3/pull/4050)).
1043
- Numerically improved stickbreaking transformation - e.g. for the `Dirichlet` distribution. [#4129](https://github.com/pymc-devs/pymc3/pull/4129)
1144
- Enabled the `Multinomial` distribution to handle batch sizes that have more than 2 dimensions. [#4169](https://github.com/pymc-devs/pymc3/pull/4169)
1245

1346
### Documentation
14-
15-
### New features
16-
- `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))
17-
- 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)).
18-
- 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))
20-
- Add alternative parametrization to NegativeBinomial distribution in terms of n and p (see [#4126](https://github.com/pymc-devs/pymc3/issues/4126))
21-
- Added a new `MixtureSameFamily` distribution to handle mixtures of arbitrary dimensions in vectorized form (see [#4185](https://github.com/pymc-devs/pymc3/issues/4185)).
47+
- Added a new notebook demonstrating how to incorporate sampling from a conjugate Dirichlet-multinomial posterior density in conjunction with other step methods (see [#4199](https://github.com/pymc-devs/pymc3/pull/4199)).
48+
- Mentioned the way to do any random walk with `theano.tensor.cumsum()` in `GaussianRandomWalk` docstrings (see [#4048](https://github.com/pymc-devs/pymc3/pull/4048)).
2249

2350

2451
## PyMC3 3.9.3 (11 August 2020)
2552

26-
### Maintenance
27-
- Fix an error on Windows and Mac where error message from unpickling models did not show up in the notebook, or where sampling froze when a worker process crashed (see [#3991](https://github.com/pymc-devs/pymc3/pull/3991)).
28-
- Require Theano >= 1.0.5 (see [#4032](https://github.com/pymc-devs/pymc3/pull/4032)).
29-
30-
### Documentation
31-
- Notebook on [multilevel modeling](https://docs.pymc.io/notebooks/multilevel_modeling.html) has been rewritten to showcase ArviZ and xarray usage for inference result analysis (see [#3963](https://github.com/pymc-devs/pymc3/pull/3963)).
32-
3353
### New features
3454
- Introduce optional arguments to `pm.sample`: `mp_ctx` to control how the processes for parallel sampling are started, and `pickle_backend` to specify which library is used to pickle models in parallel sampling when the multiprocessing context is not of type `fork` (see [#3991](https://github.com/pymc-devs/pymc3/pull/3991)).
3555
- Add sampler stats `process_time_diff`, `perf_counter_diff` and `perf_counter_start`, that record wall and CPU times for each NUTS and HMC sample (see [ #3986](https://github.com/pymc-devs/pymc3/pull/3986)).
3656
- Extend `keep_size` argument handling for `sample_posterior_predictive` and `fast_sample_posterior_predictive`, to work on ArviZ `InferenceData` and xarray `Dataset` input values (see [PR #4006](https://github.com/pymc-devs/pymc3/pull/4006) and issue [#4004](https://github.com/pymc-devs/pymc3/issues/4004)).
3757
- SMC-ABC: add the Wasserstein and energy distance functions. Refactor API, the distance, sum_stats and epsilon arguments are now passed `pm.Simulator` instead of `pm.sample_smc`. Add random method to `pm.Simulator`. Add option to save the simulated data. Improved LaTeX representation [#3996](https://github.com/pymc-devs/pymc3/pull/3996).
3858
- SMC-ABC: Allow use of potentials by adding them to the prior term. [#4016](https://github.com/pymc-devs/pymc3/pull/4016).
3959

60+
### Maintenance
61+
- Fix an error on Windows and Mac where error message from unpickling models did not show up in the notebook, or where sampling froze when a worker process crashed (see [#3991](https://github.com/pymc-devs/pymc3/pull/3991)).
62+
- Require Theano >= 1.0.5 (see [#4032](https://github.com/pymc-devs/pymc3/pull/4032)).
63+
64+
### Documentation
65+
- Notebook on [multilevel modeling](https://docs.pymc.io/notebooks/multilevel_modeling.html) has been rewritten to showcase ArviZ and xarray usage for inference result analysis (see [#3963](https://github.com/pymc-devs/pymc3/pull/3963)).
66+
4067
_NB: The `docs/*` folder is still removed from the tarball due to an upload size limit on PyPi._
4168

4269

4370
## PyMC3 3.9.2 (24 June 2020)
71+
4472
### Maintenance
4573
- Warning added in GP module when `input_dim` is lower than the number of columns in `X` to compute the covariance function (see [#3974](https://github.com/pymc-devs/pymc3/pull/3974)).
4674
- Pass the `tune` argument from `sample` when using `advi+adapt_diag_grad` (see issue [#3965](https://github.com/pymc-devs/pymc3/issues/3965), fixed by [#3979](https://github.com/pymc-devs/pymc3/pull/3979)).

0 commit comments

Comments
 (0)