Skip to content

Commit bf0757b

Browse files
Merge branch 'master' into fix-4206
2 parents 21bf324 + 6f15cbb commit bf0757b

File tree

191 files changed

+3876
-1617
lines changed

Some content is hidden

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

191 files changed

+3876
-1617
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: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@ jobs:
99
pytest:
1010
strategy:
1111
matrix:
12-
python-version: ["3.8"]
13-
os: [ubuntu-18.04]
12+
os: [ubuntu-latest, macos-latest]
1413
floatx: [float64]
1514
test-subset:
15+
- pymc3/tests/test_distributions_random.py
1616
- pymc3/tests/test_sampling.py
17+
fail-fast: false
1718
runs-on: ${{ matrix.os }}
1819
env:
1920
TEST_SUBSET: ${{ matrix.test-subset }}
20-
THEANO_FLAGS: floatX=${{ matrix.floatx }},gcc.cxxflags='-march=native'
21+
THEANO_FLAGS: floatX=${{ matrix.floatx }},gcc__cxxflags='-march=native'
2122
defaults:
2223
run:
2324
shell: bash -l {0}
@@ -26,20 +27,40 @@ jobs:
2627
- name: Cache conda
2728
uses: actions/cache@v1
2829
env:
29-
# 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
3031
CACHE_NUMBER: 0
3132
with:
3233
path: ~/conda_pkgs_dir
3334
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
34-
hashFiles('environment-dev.yml') }}
35+
hashFiles('conda-envs/environment-dev-py38.yml') }}
36+
- name: Cache multiple paths
37+
uses: actions/cache@v2
38+
env:
39+
# Increase this value to reset cache if requirements.txt has not changed
40+
CACHE_NUMBER: 0
41+
with:
42+
path: |
43+
~/.cache/pip
44+
$RUNNER_TOOL_CACHE/Python/*
45+
~\AppData\Local\pip\Cache
46+
key: ${{ runner.os }}-build-${{ matrix.python-version }}-${{
47+
hashFiles('requirements.txt') }}
3548
- uses: conda-incubator/setup-miniconda@v2
3649
with:
37-
activate-environment: testenv
50+
activate-environment: pymc3-dev-py38
3851
channel-priority: strict
39-
environment-file: environment-dev.yml
52+
environment-file: conda-envs/environment-dev-py38.yml
4053
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
54+
- name: Install pymc3
55+
run: |
56+
conda activate pymc3-dev-py38
57+
pip install -e .
58+
python --version
59+
- name: Install latest arviz
60+
run: |
61+
conda activate pymc3-dev-py38
62+
pip uninstall arviz -y
4463
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
64+
- name: Run tests
65+
run: |
66+
python -m pytest -vv --cov=pymc3 --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET
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: 37 additions & 13 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:
@@ -21,41 +20,48 @@ jobs:
2120
--ignore=pymc3/tests/test_distributions_timeseries.py
2221
--ignore=pymc3/tests/test_examples.py
2322
--ignore=pymc3/tests/test_gp.py
23+
--ignore=pymc3/tests/test_mixture.py
24+
--ignore=pymc3/tests/test_ode.py
2425
--ignore=pymc3/tests/test_parallel_sampling.py
2526
--ignore=pymc3/tests/test_posteriors.py
2627
--ignore=pymc3/tests/test_quadpotential.py
2728
--ignore=pymc3/tests/test_random.py
2829
--ignore=pymc3/tests/test_sampling.py
29-
--ignore=pymc3/tests/test_shape_handling
30+
--ignore=pymc3/tests/test_shape_handling.py
3031
--ignore=pymc3/tests/test_shared.py
3132
--ignore=pymc3/tests/test_smc.py
33+
--ignore=pymc3/tests/test_step.py
3234
--ignore=pymc3/tests/test_updates.py
3335
--ignore=pymc3/tests/test_variational_inference.py
3436
- |
3537
pymc3/tests/test_dist_math.py
3638
pymc3/tests/test_distribution_defaults.py
3739
pymc3/tests/test_distributions_random.py
38-
pymc3/tests/test_distributions_timeseries.py
3940
pymc3/tests/test_parallel_sampling.py
4041
pymc3/tests/test_random.py
41-
pymc3/tests/test_sampling.py
4242
pymc3/tests/test_shared.py
4343
pymc3/tests/test_smc.py
4444
- |
4545
pymc3/tests/test_examples.py
46-
pymc3/tests/test_gp.py
46+
pymc3/tests/test_mixture.py
47+
pymc3/tests/test_ode.py
4748
pymc3/tests/test_posteriors.py
4849
pymc3/tests/test_quadpotential.py
4950
- |
51+
pymc3/tests/test_distributions_timeseries.py
5052
pymc3/tests/test_shape_handling.py
53+
pymc3/tests/test_step.py
5154
pymc3/tests/test_updates.py
5255
pymc3/tests/test_variational_inference.py
5356
- |
5457
pymc3/tests/test_distributions.py
58+
pymc3/tests/test_gp.py
59+
pymc3/tests/test_sampling.py
60+
fail-fast: false
5561
runs-on: ${{ matrix.os }}
5662
env:
5763
TEST_SUBSET: ${{ matrix.test-subset }}
58-
THEANO_FLAGS: floatX=${{ matrix.floatx }},gcc.cxxflags='-march=native'
64+
THEANO_FLAGS: floatX=${{ matrix.floatx }},gcc__cxxflags='-march=native'
5965
defaults:
6066
run:
6167
shell: bash -l {0}
@@ -64,21 +70,39 @@ jobs:
6470
- name: Cache conda
6571
uses: actions/cache@v1
6672
env:
67-
# Increase this value to reset cache if environment-dev.yml has not changed
73+
# Increase this value to reset cache if environment-dev-py36.yml has not changed
6874
CACHE_NUMBER: 0
6975
with:
7076
path: ~/conda_pkgs_dir
7177
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
72-
hashFiles('environment-dev.yml') }}
78+
hashFiles('conda-envs/environment-dev-py36.yml') }}
79+
- name: Cache multiple paths
80+
uses: actions/cache@v2
81+
env:
82+
# Increase this value to reset cache if requirements.txt has not changed
83+
CACHE_NUMBER: 0
84+
with:
85+
path: |
86+
~/.cache/pip
87+
$RUNNER_TOOL_CACHE/Python/*
88+
~\AppData\Local\pip\Cache
89+
key: ${{ runner.os }}-build-${{ matrix.python-version }}-${{
90+
hashFiles('requirements.txt') }}
7391
- uses: conda-incubator/setup-miniconda@v2
7492
with:
75-
activate-environment: testenv
93+
activate-environment: pymc3-dev-py36
7694
channel-priority: strict
77-
environment-file: environment-dev.yml
95+
environment-file: conda-envs/environment-dev-py36.yml
7896
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
97+
- name: Install-pymc3
98+
run: |
99+
conda activate pymc3-dev-py36
100+
pip install -e .
101+
python --version
102+
- name: Run tests
103+
run: |
104+
conda activate pymc3-dev-py36
105+
python -m pytest -vv --cov=pymc3 --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET
82106
- name: Upload coverage to Codecov
83107
uses: codecov/codecov-action@v1
84108
with:

.github/workflows/windows.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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+
- name: Cache multiple paths
36+
uses: actions/cache@v2
37+
env:
38+
# Increase this value to reset cache if requirements.txt has not changed
39+
CACHE_NUMBER: 0
40+
with:
41+
path: |
42+
~/.cache/pip
43+
$RUNNER_TOOL_CACHE/Python/*
44+
~\AppData\Local\pip\Cache
45+
key: ${{ runner.os }}-build-${{ matrix.python-version }}-${{
46+
hashFiles('requirements.txt') }}
47+
- uses: conda-incubator/setup-miniconda@v2
48+
with:
49+
activate-environment: pymc3-dev-py37
50+
channel-priority: strict
51+
environment-file: conda-envs/environment-dev-py37.yml
52+
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
53+
- name: Install-pymc3
54+
run: |
55+
conda activate pymc3-dev-py37
56+
pip install -e .
57+
python --version
58+
- run: |
59+
conda activate pymc3-dev-py37
60+
python -m pytest -vv --cov=pymc3 --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET

.pre-commit-config.yaml

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,32 @@
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+
exclude: ^requirements-dev\.txt$
15+
- id: trailing-whitespace
716
- repo: https://github.com/nbQA-dev/nbQA
8-
rev: 0.4.1
17+
rev: 0.5.4
918
hooks:
1019
- id: nbqa-black
1120
additional_dependencies: [black==20.8b1]
1221
- id: nbqa-isort
1322
additional_dependencies: [isort==5.6.4]
1423
- id: nbqa-pyupgrade
1524
additional_dependencies: [pyupgrade==2.7.4]
25+
- repo: https://github.com/PyCQA/isort
26+
rev: 5.6.4
27+
hooks:
28+
- id: isort
29+
name: isort
1630
- repo: https://github.com/asottile/pyupgrade
1731
rev: v2.7.4
1832
hooks:
@@ -31,14 +45,38 @@ repos:
3145
- repo: local
3246
hooks:
3347
- id: watermark
34-
name: Check notebooks have watermark (see Jupyter style guide from PyMC3 Wiki)
35-
types: [jupyter]
48+
args: [--negate, --multiline]
3649
entry: '%load_ext watermark.*%watermark -n -u -v -iv -w'
3750
language: pygrep
38-
args: [--negate, --multiline]
3951
minimum_pre_commit_version: 2.8.0
52+
name: Check notebooks have watermark (see Jupyter style guide from PyMC3 Wiki)
53+
types: [jupyter]
4054
- id: check-toc
55+
entry: python scripts/check_toc_is_complete.py
56+
language: python
4157
name: Check all notebooks appear in table of contents
4258
types: [jupyter]
43-
entry: python scripts/check_toc_is_complete.py
59+
- id: check-no-tests-are-ignored
60+
entry: python scripts/check_all_tests_are_covered.py
61+
files: ^\.github/workflows/pytest\.yml$
4462
language: python
63+
name: Check no tests are ignored
64+
pass_filenames: false
65+
- id: conda-env-sort
66+
additional_dependencies: [pyyaml]
67+
entry: python scripts/sort_conda_envs.py
68+
files: ^conda-envs/
69+
language: python
70+
name: Sort dependencies in conda envs
71+
types: [yaml]
72+
- id: pip-from-conda
73+
additional_dependencies: [pyyaml]
74+
entry: python scripts/generate_pip_deps_from_conda.py
75+
files: ^conda-envs/
76+
language: python
77+
name: Generate pip dependency from conda
78+
- id: no-relative-imports
79+
name: No relative imports
80+
entry: from \.[\.\w]* import
81+
types: [python]
82+
language: pygrep

0 commit comments

Comments
 (0)