Skip to content

Commit eb5561f

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 5bf0c2d + 988ab9d commit eb5561f

Some content is hidden

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

65 files changed

+2252
-1944
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: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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+
os: [ubuntu-18.04]
13+
floatx: [float64]
14+
test-subset:
15+
- pymc3/tests/test_sampling.py
16+
fail-fast: false
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-py38.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-py38.yml') }}
35+
- uses: conda-incubator/setup-miniconda@v2
36+
with:
37+
activate-environment: pymc3-dev-py38
38+
channel-priority: strict
39+
environment-file: conda-envs/environment-dev-py38.yml
40+
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
41+
- name: Install pymc3
42+
run: |
43+
conda activate pymc3-dev-py38
44+
pip install -e .
45+
python --version
46+
- name: Install latest arviz
47+
run: |
48+
conda activate pymc3-dev-py38
49+
conda remove arviz -y
50+
pip install git+git://github.com/arviz-devs/arviz.git
51+
- name: Run tests
52+
run: |
53+
python -m pytest -vv --cov=pymc3 --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET

.github/workflows/pytest.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: pytest
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
8+
jobs:
9+
pytest:
10+
strategy:
11+
matrix:
12+
os: [ubuntu-18.04]
13+
floatx: [float32, float64]
14+
test-subset:
15+
- |
16+
--ignore=pymc3/tests/test_dist_math.py
17+
--ignore=pymc3/tests/test_distribution_defaults.py
18+
--ignore=pymc3/tests/test_distributions.py
19+
--ignore=pymc3/tests/test_distributions_random.py
20+
--ignore=pymc3/tests/test_distributions_timeseries.py
21+
--ignore=pymc3/tests/test_examples.py
22+
--ignore=pymc3/tests/test_gp.py
23+
--ignore=pymc3/tests/test_mixture.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.py
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_parallel_sampling.py
39+
pymc3/tests/test_random.py
40+
pymc3/tests/test_shared.py
41+
pymc3/tests/test_smc.py
42+
- |
43+
pymc3/tests/test_examples.py
44+
pymc3/tests/test_mixture.py
45+
pymc3/tests/test_posteriors.py
46+
pymc3/tests/test_quadpotential.py
47+
- |
48+
pymc3/tests/test_distributions_timeseries.py
49+
pymc3/tests/test_shape_handling.py
50+
pymc3/tests/test_updates.py
51+
pymc3/tests/test_variational_inference.py
52+
- |
53+
pymc3/tests/test_distributions.py
54+
pymc3/tests/test_gp.py
55+
pymc3/tests/test_sampling.py
56+
fail-fast: false
57+
runs-on: ${{ matrix.os }}
58+
env:
59+
TEST_SUBSET: ${{ matrix.test-subset }}
60+
THEANO_FLAGS: floatX=${{ matrix.floatx }},gcc.cxxflags='-march=native'
61+
defaults:
62+
run:
63+
shell: bash -l {0}
64+
steps:
65+
- uses: actions/checkout@v2
66+
- name: Cache conda
67+
uses: actions/cache@v1
68+
env:
69+
# Increase this value to reset cache if environment-dev-py36.yml has not changed
70+
CACHE_NUMBER: 0
71+
with:
72+
path: ~/conda_pkgs_dir
73+
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
74+
hashFiles('conda-envs/environment-dev-py36.yml') }}
75+
- uses: conda-incubator/setup-miniconda@v2
76+
with:
77+
activate-environment: pymc3-dev-py36
78+
channel-priority: strict
79+
environment-file: conda-envs/environment-dev-py36.yml
80+
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
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
89+
python -m pytest -vv --cov=pymc3 --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET
90+
- name: Upload coverage to Codecov
91+
uses: codecov/codecov-action@v1
92+
with:
93+
env_vars: OS,PYTHON
94+
name: codecov-umbrella
95+
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: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,47 @@ 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
25-
name: Check notebooks have watermark (see Jupyter style guide from PyMC3 Uncyclo)
26-
types: [jupyter]
34+
args: [--negate, --multiline]
2735
entry: '%load_ext watermark.*%watermark -n -u -v -iv -w'
2836
language: pygrep
29-
args: [--negate, --multiline]
3037
minimum_pre_commit_version: 2.8.0
38+
name: Check notebooks have watermark (see Jupyter style guide from PyMC3 Uncyclo)
39+
types: [jupyter]
3140
- id: check-toc
41+
entry: python scripts/check_toc_is_complete.py
42+
language: python
3243
name: Check all notebooks appear in table of contents
44+
pass_filenames: false
3345
types: [jupyter]
34-
entry: python scripts/check_toc_is_complete.py
46+
- id: check-no-tests-are-ignored
47+
entry: python scripts/check_all_tests_are_covered.py
48+
files: ^\.github/workflows/pytest\.yml$
3549
language: python
50+
name: Check no tests are ignored
51+
pass_filenames: false

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

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 Uncyclo on how to install and run it.
126115

127116
## Developing in Docker
128117

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

0 commit comments

Comments
 (0)