Skip to content

Commit aae93b3

Browse files
Merge branch 'master' into feature-oprobit
2 parents c3615bb + 0431292 commit aae93b3

File tree

180 files changed

+2392
-1285
lines changed

Some content is hidden

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

180 files changed

+2392
-1285
lines changed

.codecov.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ coverage:
1313
# basic
1414
target: auto
1515
threshold: 1%
16-
base: auto
16+
base: auto
1717
patch:
1818
default:
1919
# basic
2020
target: 50%
2121
threshold: 1%
22-
base: auto
22+
base: auto
2323

2424
comment:
2525
layout: "reach, diff, flags, files"

.github/ISSUE_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
If you have questions about a specific use case, or you are not sure whether this is a bug or not, please post it to our discourse channel: https://discourse.pymc.io
1+
If you have questions about a specific use case, or you are not sure whether this is a bug or not, please post it to our discourse channel: https://discourse.pymc.io
22

33
## Description of your problem
44

.github/workflows/arviz_compat.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ jobs:
99
pytest:
1010
strategy:
1111
matrix:
12-
os: [ubuntu-18.04]
12+
os: [ubuntu-latest, macos-latest]
1313
floatx: [float64]
1414
test-subset:
15+
- pymc3/tests/test_distributions_random.py
1516
- pymc3/tests/test_sampling.py
1617
fail-fast: false
1718
runs-on: ${{ matrix.os }}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: "Update pre-commit config"
2+
3+
on:
4+
schedule:
5+
- cron: "0 7 * * 1" # At 07:00 on each Monday.
6+
workflow_dispatch:
7+
8+
jobs:
9+
update-pre-commit:
10+
if: github.repository_owner == 'pymc-devs'
11+
name: Autoupdate pre-commit config
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Set up Python
15+
uses: actions/setup-python@v2
16+
- name: Cache multiple paths
17+
uses: actions/cache@v2
18+
with:
19+
path: |
20+
~/.cache/pre-commit
21+
~/.cache/pip
22+
key: pre-commit-autoupdate-${{ runner.os }}-build
23+
- name: Update pre-commit config packages
24+
uses: technote-space/create-pr-action@v2
25+
with:
26+
GITHUB_TOKEN: ${{ secrets.ACTION_TRIGGER_TOKEN }}
27+
EXECUTE_COMMANDS: |
28+
pip install pre-commit
29+
pre-commit autoupdate || (exit 0);
30+
pre-commit run -a || (exit 0);
31+
COMMIT_MESSAGE: "⬆️ UPGRADE: Autoupdate pre-commit config"
32+
PR_BRANCH_NAME: "pre-commit-config-update-${PR_ID}"
33+
PR_TITLE: "⬆️ UPGRADE: Autoupdate pre-commit config"

.github/workflows/pre-commit.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
jobs:
99
pre-commit:
1010
runs-on: ubuntu-latest
11+
env:
12+
SKIP: no-commit-to-branch
1113
steps:
1214
- uses: actions/checkout@v2
1315
- uses: actions/setup-python@v2

.github/workflows/pytest.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
--ignore=pymc3/tests/test_shape_handling.py
3030
--ignore=pymc3/tests/test_shared.py
3131
--ignore=pymc3/tests/test_smc.py
32+
--ignore=pymc3/tests/test_step.py
3233
--ignore=pymc3/tests/test_updates.py
3334
--ignore=pymc3/tests/test_variational_inference.py
3435
- |
@@ -47,6 +48,7 @@ jobs:
4748
- |
4849
pymc3/tests/test_distributions_timeseries.py
4950
pymc3/tests/test_shape_handling.py
51+
pymc3/tests/test_step.py
5052
pymc3/tests/test_updates.py
5153
pymc3/tests/test_variational_inference.py
5254
- |

.github/workflows/windows.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: windows
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
8+
jobs:
9+
pytest:
10+
strategy:
11+
matrix:
12+
os: [windows-latest]
13+
floatx: [float64]
14+
test-subset:
15+
- pymc3/tests/test_distributions_random.py
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=core2'
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 conda-envs/environment-dev-py37.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('conda-envs/environment-dev-py37.yml') }}
35+
- uses: conda-incubator/setup-miniconda@v2
36+
with:
37+
activate-environment: pymc3-dev-py37
38+
channel-priority: strict
39+
environment-file: conda-envs/environment-dev-py37.yml
40+
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
41+
- run: |
42+
conda activate pymc3-dev-py37
43+
python -m pytest -vv --cov=pymc3 --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET

.pre-commit-config.yaml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,31 @@
1+
exclude: ^(docs/logos|pymc3/examples/data)/
12
repos:
23
- repo: https://github.com/pre-commit/pre-commit-hooks
34
rev: v3.3.0
45
hooks:
5-
- id: end-of-file-fixer
6+
- id: check-merge-conflict
67
- id: check-toml
8+
- id: check-yaml
9+
- id: debug-statements
10+
- id: end-of-file-fixer
11+
- id: no-commit-to-branch
12+
args: [--branch, master]
13+
- id: requirements-txt-fixer
14+
- id: trailing-whitespace
715
- repo: https://github.com/nbQA-dev/nbQA
8-
rev: 0.4.1
16+
rev: 0.5.4
917
hooks:
1018
- id: nbqa-black
1119
additional_dependencies: [black==20.8b1]
1220
- id: nbqa-isort
1321
additional_dependencies: [isort==5.6.4]
1422
- id: nbqa-pyupgrade
1523
additional_dependencies: [pyupgrade==2.7.4]
24+
- repo: https://github.com/PyCQA/isort
25+
rev: 5.6.4
26+
hooks:
27+
- id: isort
28+
name: isort
1629
- repo: https://github.com/asottile/pyupgrade
1730
rev: v2.7.4
1831
hooks:
@@ -41,11 +54,15 @@ repos:
4154
entry: python scripts/check_toc_is_complete.py
4255
language: python
4356
name: Check all notebooks appear in table of contents
44-
pass_filenames: false
4557
types: [jupyter]
4658
- id: check-no-tests-are-ignored
4759
entry: python scripts/check_all_tests_are_covered.py
4860
files: ^\.github/workflows/pytest\.yml$
4961
language: python
5062
name: Check no tests are ignored
5163
pass_filenames: false
64+
- id: no-relative-imports
65+
name: No relative imports
66+
entry: from \.[\.\w]* import
67+
types: [python]
68+
language: pygrep

GOVERNANCE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ developed openly and hosted in public GitHub repositories under the
1313
[GitHub organization](https://github.com/pymc-devs/pymc3). Examples of
1414
Project Software include the PyMC3 code and the Documentation, etc. The Services run by the
1515
Project consist of public websites and web-services that are hosted
16-
at [http://pymc-devs.github.io/pymc3/](http://pymc-devs.github.io/pymc3/)
16+
at [http://pymc-devs.github.io/pymc3/](http://pymc-devs.github.io/pymc3/)
1717
The Project is developed by a team of distributed developers, called
1818
Contributors. Contributors are individuals who have contributed code,
1919
documentation, designs or other work to one or more Project repositories.
@@ -131,7 +131,7 @@ The current Steering Council membership comprises:
131131
- Junpeng Lao
132132
- Osvaldo Martin
133133
- Austin Rochford
134-
- Adrian Seyboldt
134+
- Adrian Seyboldt
135135
- Thomas Wiecki
136136

137137
### Council membership

README.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ The future of PyMC3 & Theano
2121
There have been many questions and uncertainty around the future of PyMC3 since Theano
2222
stopped getting developed by the original authors, and we started experiments with PyMC4.
2323

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.
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.
2626

2727
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.
28+
for more details.
2929

3030
Features
3131
========
@@ -119,8 +119,9 @@ Another option is to clone the repository and install PyMC3 using
119119
Dependencies
120120
============
121121

122-
PyMC3 is tested on Python 3.6 and depends on Theano, NumPy,
123-
SciPy, and Pandas (see ``requirements.txt`` for version
122+
PyMC3 is tested on Python 3.6, 3.7, and 3.8 and depends on `Theano-PyMC <https://github.com/pymc-devs/Theano-PyMC>`__,
123+
NumPy, SciPy, and Pandas
124+
(see `requirements.txt <https://github.com/pymc-devs/pymc3/blob/master/requirements.txt>`__ for version
124125
information).
125126

126127
Optional
@@ -168,6 +169,7 @@ Software using PyMC3
168169
- `beat <https://github.com/hvasbath/beat>`__: Bayesian Earthquake Analysis Tool.
169170
- `pymc-learn <https://github.com/pymc-learn/pymc-learn>`__: Custom PyMC models built on top of pymc3_models/scikit-learn API
170171
- `fenics-pymc3 <https://github.com/IvanYashchuk/fenics-pymc3>`__: Differentiable interface to FEniCS, a library for solving partial differential equations.
172+
- `cell2location <https://github.com/BayraktarLab/cell2location>`__: Comprehensive mapping of tissue cell architecture via integrated single cell and spatial transcriptomics.
171173

172174
Please contact us if your software is not listed here.
173175

RELEASE-NOTES.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Release Notes
22

3-
## PyMC3 3.10.0 (on deck)
3+
## PyMC3 3.10.0 (7 December 2020)
44

55
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).
66

@@ -34,7 +34,8 @@ This new version of `Theano-PyMC` comes with an experimental JAX backend which,
3434
- `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))
3535
- Change SMC metropolis kernel to independent metropolis kernel [#4115](https://github.com/pymc-devs/pymc3/pull/4115))
3636
- Add alternative parametrization to NegativeBinomial distribution in terms of n and p (see [#4126](https://github.com/pymc-devs/pymc3/issues/4126))
37-
- 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)).
37+
- 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), [#4243](https://github.com/pymc-devs/pymc3/pull/4243), and [#4260](https://github.com/pymc-devs/pymc3/pull/4260)).
38+
- Add Discrete HyperGeometric Distribution (see [#4249](https://github.com/pymc-devs/pymc3/pull/#4249))
3839

3940
### Maintenance
4041
- Switch the dependency of Theano to our own fork, [Theano-PyMC](https://github.com/pymc-devs/Theano-PyMC).
@@ -43,10 +44,11 @@ This new version of `Theano-PyMC` comes with an experimental JAX backend which,
4344
- Fixed numerical instability in ExGaussian's logp by preventing `logpow` from returning `-inf` (see [#4050](https://github.com/pymc-devs/pymc3/pull/4050)).
4445
- Numerically improved stickbreaking transformation - e.g. for the `Dirichlet` distribution. [#4129](https://github.com/pymc-devs/pymc3/pull/4129)
4546
- Enabled the `Multinomial` distribution to handle batch sizes that have more than 2 dimensions. [#4169](https://github.com/pymc-devs/pymc3/pull/4169)
46-
- Test model logp before starting any MCMC chains (see [#4116](https://github.com/pymc-devs/pymc3/issues/4116))
47+
- Test model logp before starting any MCMC chains (see [#4211](https://github.com/pymc-devs/pymc3/pull/4211))
4748
- Fix bug in `model.check_test_point` that caused the `test_point` argument to be ignored. (see [PR #4211](https://github.com/pymc-devs/pymc3/pull/4211#issuecomment-727142721))
4849
- Refactored MvNormal.random method with better handling of sample, batch and event shapes. [#4207](https://github.com/pymc-devs/pymc3/pull/4207)
4950
- The `InverseGamma` distribution now implements a `logcdf`. [#3944](https://github.com/pymc-devs/pymc3/pull/3944)
51+
- Make starting jitter methods for nuts sampling more robust by resampling values that lead to non-finite probabilities. A new optional argument `jitter-max-retries` can be passed to `pm.sample()` and `pm.init_nuts()` to control the maximum number of retries per chain. [4298](https://github.com/pymc-devs/pymc3/pull/4298)
5052

5153
### Documentation
5254
- 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)).

benchmarks/benchmarks/benchmarks.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@
1717

1818
import numpy as np
1919
import pandas as pd
20-
import pymc3 as pm
2120
import theano
2221
import theano.tensor as tt
2322

23+
import pymc3 as pm
24+
2425

2526
def glm_hierarchical_model(random_seed=123):
2627
"""Sample glm hierarchical model to use in benchmarks"""

binder/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
-r ../requirements-dev.txt
2-
# this installs pymc3 itself. it is funny that this is an absolute path,
2+
# this installs pymc3 itself. it is funny that this is an absolute path,
33
# but reqirements-dev.txt is relative.
44
.

docs/source/Advanced_usage_of_Theano_in_PyMC3.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
:orphan:
2+
3+
..
4+
_referenced in docs/source/notebooks/table_of_contents_tutorials.js
5+
16
=================================
27
Advanced usage of Theano in PyMC3
38
=================================

0 commit comments

Comments
 (0)