Skip to content

Commit 907884d

Browse files
committed
Merge remote-tracking branch 'upstream/master' into windows-test
2 parents 9170203 + 3fa3d1f commit 907884d

31 files changed

+1122
-360
lines changed

.github/workflows/arviz_compat.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ jobs:
99
pytest:
1010
strategy:
1111
matrix:
12-
python-version: ["3.8"]
1312
os: [ubuntu-latest, macos-latest]
1413
floatx: [float64]
1514
test-subset:
1615
- pymc3/tests/test_distributions_random.py
1716
- pymc3/tests/test_sampling.py
17+
fail-fast: false
1818
runs-on: ${{ matrix.os }}
1919
env:
2020
TEST_SUBSET: ${{ matrix.test-subset }}
@@ -27,20 +27,28 @@ jobs:
2727
- name: Cache conda
2828
uses: actions/cache@v1
2929
env:
30-
# Increase this value to reset cache if environment-dev.yml has not changed
30+
# Increase this value to reset cache if environment-dev-py38.yml has not changed
3131
CACHE_NUMBER: 0
3232
with:
3333
path: ~/conda_pkgs_dir
3434
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
35-
hashFiles('environment-dev.yml') }}
35+
hashFiles('conda-envs/environment-dev-py38.yml') }}
3636
- uses: conda-incubator/setup-miniconda@v2
3737
with:
38-
activate-environment: testenv
38+
activate-environment: pymc3-dev-py38
3939
channel-priority: strict
40-
environment-file: environment-dev.yml
40+
environment-file: conda-envs/environment-dev-py38.yml
4141
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
42-
- run: |
43-
conda activate testenv
42+
- name: Install pymc3
43+
run: |
44+
conda activate pymc3-dev-py38
45+
pip install -e .
46+
python --version
47+
- name: Install latest arviz
48+
run: |
49+
conda activate pymc3-dev-py38
4450
conda remove arviz -y
4551
pip install git+git://github.com/arviz-devs/arviz.git
52+
- name: Run tests
53+
run: |
4654
python -m pytest -vv --cov=pymc3 --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET

.github/workflows/pytest.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ jobs:
99
pytest:
1010
strategy:
1111
matrix:
12-
python-version: ["3.6"]
1312
os: [ubuntu-18.04]
1413
floatx: [float32, float64]
1514
test-subset:
@@ -36,7 +35,6 @@ jobs:
3635
pymc3/tests/test_dist_math.py
3736
pymc3/tests/test_distribution_defaults.py
3837
pymc3/tests/test_distributions_random.py
39-
pymc3/tests/test_distributions_timeseries.py
4038
pymc3/tests/test_parallel_sampling.py
4139
pymc3/tests/test_random.py
4240
pymc3/tests/test_shared.py
@@ -47,13 +45,15 @@ jobs:
4745
pymc3/tests/test_posteriors.py
4846
pymc3/tests/test_quadpotential.py
4947
- |
48+
pymc3/tests/test_distributions_timeseries.py
5049
pymc3/tests/test_shape_handling.py
5150
pymc3/tests/test_updates.py
5251
pymc3/tests/test_variational_inference.py
5352
- |
5453
pymc3/tests/test_distributions.py
5554
pymc3/tests/test_gp.py
5655
pymc3/tests/test_sampling.py
56+
fail-fast: false
5757
runs-on: ${{ matrix.os }}
5858
env:
5959
TEST_SUBSET: ${{ matrix.test-subset }}
@@ -66,20 +66,26 @@ jobs:
6666
- name: Cache conda
6767
uses: actions/cache@v1
6868
env:
69-
# Increase this value to reset cache if environment-dev.yml has not changed
69+
# Increase this value to reset cache if environment-dev-py36.yml has not changed
7070
CACHE_NUMBER: 0
7171
with:
7272
path: ~/conda_pkgs_dir
7373
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
74-
hashFiles('environment-dev.yml') }}
74+
hashFiles('conda-envs/environment-dev-py36.yml') }}
7575
- uses: conda-incubator/setup-miniconda@v2
7676
with:
77-
activate-environment: testenv
77+
activate-environment: pymc3-dev-py36
7878
channel-priority: strict
79-
environment-file: environment-dev.yml
79+
environment-file: conda-envs/environment-dev-py36.yml
8080
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
81-
- run: |
82-
conda activate testenv
81+
- name: Install-pymc3
82+
run: |
83+
conda activate pymc3-dev-py36
84+
pip install -e .
85+
python --version
86+
- name: Run tests
87+
run: |
88+
conda activate pymc3-dev-py36
8389
python -m pytest -vv --cov=pymc3 --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET
8490
- name: Upload coverage to Codecov
8591
uses: codecov/codecov-action@v1

.pre-commit-config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ repos:
4141
entry: python scripts/check_toc_is_complete.py
4242
language: python
4343
name: Check all notebooks appear in table of contents
44-
pass_filenames: false
4544
types: [jupyter]
4645
- id: check-no-tests-are-ignored
4746
entry: python scripts/check_all_tests_are_covered.py

CONTRIBUTING.md

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,27 @@ The preferred workflow for contributing to PyMC3 is to fork the [GitHub reposito
3838
3. Create a ``feature`` branch to hold your development changes:
3939

4040
```bash
41-
$ git checkout -b my-feature
41+
$ git switch -c my-feature
4242
```
4343

4444
Always use a ``feature`` branch. It's good practice to never routinely work on the ``master`` branch of any repository.
4545

46-
4. Project requirements are in ``requirements.txt``, and libraries used for development are in ``requirements-dev.txt``. To set up a development environment, you may (probably in a [virtual environment](https://docs.python-guide.org/dev/virtualenvs/)) run:
46+
4. Project requirements are in ``requirements.txt``, and libraries used for development are in ``requirements-dev.txt``. The easiest (and recommended) way to set up a development environment is via [miniconda](https://docs.conda.io/en/latest/miniconda.html):
4747

4848
```bash
49-
$ pip install -r requirements.txt
49+
$ conda env create -f conda-envs/environment-dev-py36.yml # or py37 or py38
50+
$ conda activate pymc3-dev-py36
51+
$ pip install -e .
52+
```
53+
54+
_Alternatively_ you may (probably in a [virtual environment](https://docs.python-guide.org/dev/virtualenvs/)) run:
55+
56+
```bash
57+
$ pip install -e .
5058
$ pip install -r requirements-dev.txt
5159
```
5260

53-
Alternatively, there is a script to create a docker environment for development. See: [Developing in Docker](#Developing-in-Docker).
61+
Yet another alternative is to create a docker environment for development. See: [Developing in Docker](#Developing-in-Docker).
5462

5563
5. Develop the feature on your feature branch. Add changed files using ``git add`` and then ``git commit`` files:
5664

@@ -103,26 +111,7 @@ tools:
103111
$ pytest --cov=pymc3 pymc3/tests/<name of test>.py
104112
```
105113

106-
* No `pyflakes` warnings, check with:
107-
108-
```bash
109-
$ pip install pyflakes
110-
$ pyflakes path/to/module.py
111-
```
112-
113-
* No PEP8 warnings, check with:
114-
115-
```bash
116-
$ pip install pycodestyle
117-
$ pycodestyle path/to/module.py
118-
```
119-
120-
* AutoPEP8 can help you fix some of the easy redundant errors:
121-
122-
```bash
123-
$ pip install autopep8
124-
$ autopep8 path/to/pep8.py
125-
```
114+
* No `pre-commit` errors: see the [Python code style](https://github.com/pymc-devs/pymc3/wiki/PyMC3-Python-Code-Style) and [Jupyter Notebook style](https://github.com/pymc-devs/pymc3/wiki/PyMC's-Jupyter-Notebook-Style) page from our Wiki on how to install and run it.
126115

127116
## Developing in Docker
128117

README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ Software using PyMC3
168168
- `beat <https://github.com/hvasbath/beat>`__: Bayesian Earthquake Analysis Tool.
169169
- `pymc-learn <https://github.com/pymc-learn/pymc-learn>`__: Custom PyMC models built on top of pymc3_models/scikit-learn API
170170
- `fenics-pymc3 <https://github.com/IvanYashchuk/fenics-pymc3>`__: Differentiable interface to FEniCS, a library for solving partial differential equations.
171+
- `cell2location <https://github.com/BayraktarLab/cell2location>`__: Comprehensive mapping of tissue cell architecture via integrated single cell and spatial transcriptomics.
171172

172173
Please contact us if your software is not listed here.
173174

RELEASE-NOTES.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ This new version of `Theano-PyMC` comes with an experimental JAX backend which,
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))
3737
- 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)).
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).
@@ -45,11 +46,14 @@ This new version of `Theano-PyMC` comes with an experimental JAX backend which,
4546
- Enabled the `Multinomial` distribution to handle batch sizes that have more than 2 dimensions. [#4169](https://github.com/pymc-devs/pymc3/pull/4169)
4647
- Test model logp before starting any MCMC chains (see [#4116](https://github.com/pymc-devs/pymc3/issues/4116))
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))
49+
- Refactored MvNormal.random method with better handling of sample, batch and event shapes. [#4207](https://github.com/pymc-devs/pymc3/pull/4207)
50+
- The `InverseGamma` distribution now implements a `logcdf`. [#3944](https://github.com/pymc-devs/pymc3/pull/3944)
4851

4952
### Documentation
5053
- 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)).
5154
- 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)).
5255

56+
**Release manager** for 3.10.0: Eelke Spaak ([@Spaak](https://github.com/Spaak))
5357

5458
## PyMC3 3.9.3 (11 August 2020)
5559

@@ -69,6 +73,7 @@ This new version of `Theano-PyMC` comes with an experimental JAX backend which,
6973

7074
_NB: The `docs/*` folder is still removed from the tarball due to an upload size limit on PyPi._
7175

76+
**Release manager** for 3.9.3: Kyle Beauchamp ([@kyleabeauchamp](https://github.com/kyleabeauchamp))
7277

7378
## PyMC3 3.9.2 (24 June 2020)
7479

@@ -81,10 +86,14 @@ _NB: The `docs/*` folder is still removed from the tarball due to an upload size
8186

8287
_NB: The `docs/*` folder is still removed from the tarball due to an upload size limit on PyPi._
8388

89+
**Release manager** for 3.9.2: Alex Andorra ([@AlexAndorra](https://github.com/AlexAndorra))
90+
8491
## PyMC3 3.9.1 (16 June 2020)
8592
The `v3.9.0` upload to PyPI didn't include a tarball, which is fixed in this release.
8693
Though we had to temporarily remove the `docs/*` folder from the tarball due to a size limit.
8794

95+
**Release manager** for 3.9.1: Michael Osthege ([@michaelosthege](https://github.com/michaelosthege))
96+
8897
## PyMC3 3.9.0 (16 June 2020)
8998

9099
### New features
@@ -130,6 +139,7 @@ Though we had to temporarily remove the `docs/*` folder from the tarball due to
130139
- Dropped some deprecated kwargs and functions (see [#3906](https://github.com/pymc-devs/pymc3/pull/3906))
131140
- Dropped the outdated 'nuts' initialization method for `pm.sample` (see [#3863](https://github.com/pymc-devs/pymc3/pull/3863)).
132141

142+
**Release manager** for 3.9.0: Michael Osthege ([@michaelosthege](https://github.com/michaelosthege))
133143

134144
## PyMC3 3.8 (November 29 2019)
135145

environment-dev.yml renamed to conda-envs/environment-dev-py36.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,29 @@
1-
name: testenv
1+
name: pymc3-dev-py36
22
channels:
33
- conda-forge
44
- defaults
55
dependencies:
6-
- python>=3.6
6+
- python=3.6
77
- arviz>=0.9
88
- theano-pymc==1.0.11
99
- numpy>=1.13
1010
- scipy>=0.18
11-
- pandas >=0.18
11+
- pandas>=0.18
1212
- patsy>=0.5
1313
- fastprogress>=0.2
1414
- h5py>=2.7
1515
- typing-extensions>=3.7
16-
- bokeh>=0.12
17-
- coverage>=5.1
1816
- python-graphviz
1917
- ipython>=7.16
2018
- nbsphinx>=0.4
21-
- nose>=1.3
22-
- nose-parameterized>=0.6
2319
- numpydoc>=0.9
2420
- pre-commit>=2.8.0
2521
- pytest-cov>=2.5
2622
- pytest>=3.0
2723
- recommonmark>=0.4
28-
- seaborn>=0.8
2924
- sphinx-autobuild>=0.7
3025
- sphinx>=1.5
3126
- watermark
32-
- parameterized
33-
- ipywidgets
3427
- dataclasses # python_version < 3.7
3528
- contextvars # python_version < 3.7
3629
- mkl-service

conda-envs/environment-dev-py37.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: pymc3-dev-py37
2+
channels:
3+
- conda-forge
4+
- defaults
5+
dependencies:
6+
- python=3.7
7+
- arviz>=0.9
8+
- theano-pymc==1.0.11
9+
- numpy>=1.13
10+
- scipy>=0.18
11+
- pandas>=0.18
12+
- patsy>=0.5
13+
- fastprogress>=0.2
14+
- h5py>=2.7
15+
- typing-extensions>=3.7
16+
- python-graphviz
17+
- ipython>=7.16
18+
- nbsphinx>=0.4
19+
- numpydoc>=0.9
20+
- pre-commit>=2.8.0
21+
- pytest-cov>=2.5
22+
- pytest>=3.0
23+
- recommonmark>=0.4
24+
- sphinx-autobuild>=0.7
25+
- sphinx>=1.5
26+
- watermark
27+
- mkl-service
28+
- dill
29+
- libblas=*=*mkl

conda-envs/environment-dev-py38.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: pymc3-dev-py38
2+
channels:
3+
- conda-forge
4+
- defaults
5+
dependencies:
6+
- python=3.8
7+
- arviz>=0.9
8+
- theano-pymc==1.0.11
9+
- numpy>=1.13
10+
- scipy>=0.18
11+
- pandas>=0.18
12+
- patsy>=0.5
13+
- fastprogress>=0.2
14+
- h5py>=2.7
15+
- typing-extensions>=3.7
16+
- python-graphviz
17+
- ipython>=7.16
18+
- nbsphinx>=0.4
19+
- numpydoc>=0.9
20+
- pre-commit>=2.8.0
21+
- pytest-cov>=2.5
22+
- pytest>=3.0
23+
- recommonmark>=0.4
24+
- sphinx-autobuild>=0.7
25+
- sphinx>=1.5
26+
- watermark
27+
- mkl-service
28+
- dill
29+
- libblas=*=*mkl

docs/source/PyMC3_and_Theano.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@ build up a Theano function from the space of our parameters to
1111
their posterior probability density up to a constant factor. We then use
1212
symbolic manipulations of this function to also get access to its gradient.
1313

14+
Note that the original developers have stopped maintaining Theano, so
15+
PyMC3 uses `Theano-PyMC <https://github.com/pymc-devs/Theano-PyMC>`_,
16+
a fork of Theano maintained by the PyMC3 developers.
17+
1418
For a thorough introduction to Theano see the
15-
`theano docs <http://deeplearning.net/software/theano/introduction.html>`_,
19+
`theano docs <https://theano-pymc.readthedocs.io/en/latest/>`_,
1620
but for the most part you don't need detailed knowledge about it as long
1721
as you are not trying to define new distributions or other extensions
1822
of PyMC3. But let's look at a simple example to get a rough

docs/source/api/distributions/transforms.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ implemented as ``pm.distributions.transforms.``\*X*.
2424
ordered
2525
log
2626
sum_to_1
27-
t_stick_breaking
2827
circular
2928
CholeskyCovPacked
3029
Chain
@@ -93,10 +92,6 @@ below.
9392
:class:`~pymc3.distributions.transforms.Circular` :class:`~pymc3.distributions.transforms.Transform` class
9493
for use in the ``transform`` argument of a random variable.
9594

96-
97-
.. autofunction:: t_stick_breaking
98-
99-
10095
Transform Base Classes
10196
~~~~~~~~~~~~~~~~~~~~~~
10297

docs/source/api/plots.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Plots
33
*****
44

55
.. currentmodule:: pymc3.plots
6+
67
Plots are delegated to the
78
`ArviZ <https://arviz-devs.github.io/arviz/index.html>`_.
89
library, a general purpose library for

0 commit comments

Comments
 (0)