Skip to content

Commit 69979e6

Browse files
committed
Merge branch 'master' of github.com:pymc-devs/pymc3 into feature-oprobit
2 parents cef5bed + dbcc49e commit 69979e6

37 files changed

+464
-267
lines changed

.github/workflows/arviz_compat.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ${{ matrix.os }}
1919
env:
2020
TEST_SUBSET: ${{ matrix.test-subset }}
21-
THEANO_FLAGS: floatX=${{ matrix.floatx }},gcc.cxxflags='-march=native'
21+
THEANO_FLAGS: floatX=${{ matrix.floatx }},gcc__cxxflags='-march=native'
2222
defaults:
2323
run:
2424
shell: bash -l {0}
@@ -33,6 +33,18 @@ jobs:
3333
path: ~/conda_pkgs_dir
3434
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
3535
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') }}
3648
- uses: conda-incubator/setup-miniconda@v2
3749
with:
3850
activate-environment: pymc3-dev-py38
@@ -47,7 +59,7 @@ jobs:
4759
- name: Install latest arviz
4860
run: |
4961
conda activate pymc3-dev-py38
50-
conda remove arviz -y
62+
pip uninstall arviz -y
5163
pip install git+git://github.com/arviz-devs/arviz.git
5264
- name: Run tests
5365
run: |
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: run pre-commit
2+
3+
on:
4+
repository_dispatch:
5+
types: [pre-commit-run-command]
6+
jobs:
7+
runPreCommit:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
with:
12+
repository: ${{github.event.client_payload.pull_request.head.repo.full_name}}
13+
ref: ${{github.event.client_payload.pull_request.head.ref}}
14+
token: ${{ secrets.ACTION_TRIGGER_TOKEN }}
15+
- name: Cache multiple paths
16+
uses: actions/cache@v2
17+
with:
18+
path: |
19+
~/.cache/pre-commit
20+
~/.cache/pip
21+
key: pre-commit-dispatched-${{ runner.os }}-build
22+
- uses: actions/setup-python@v2
23+
with:
24+
python-version: 3.8
25+
- name: install-pre-commit
26+
run: python -m pip install --upgrade pre-commit
27+
- name: Slash Command Dispatch
28+
run: pre-commit run --all-files || (exit 0)
29+
- run: |
30+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
31+
git config --local user.name "github-actions[bot]"
32+
git commit -m "Run pre-commit" -a
33+
git push

.github/workflows/pytest.yml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
--ignore=pymc3/tests/test_examples.py
2222
--ignore=pymc3/tests/test_gp.py
2323
--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
@@ -43,6 +44,7 @@ jobs:
4344
- |
4445
pymc3/tests/test_examples.py
4546
pymc3/tests/test_mixture.py
47+
pymc3/tests/test_ode.py
4648
pymc3/tests/test_posteriors.py
4749
pymc3/tests/test_quadpotential.py
4850
- |
@@ -59,7 +61,7 @@ jobs:
5961
runs-on: ${{ matrix.os }}
6062
env:
6163
TEST_SUBSET: ${{ matrix.test-subset }}
62-
THEANO_FLAGS: floatX=${{ matrix.floatx }},gcc.cxxflags='-march=native'
64+
THEANO_FLAGS: floatX=${{ matrix.floatx }},gcc__cxxflags='-march=native'
6365
defaults:
6466
run:
6567
shell: bash -l {0}
@@ -68,26 +70,38 @@ jobs:
6870
- name: Cache conda
6971
uses: actions/cache@v1
7072
env:
71-
# Increase this value to reset cache if environment-dev-py36.yml has not changed
73+
# Increase this value to reset cache if environment-dev-py39.yml has not changed
7274
CACHE_NUMBER: 0
7375
with:
7476
path: ~/conda_pkgs_dir
7577
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
76-
hashFiles('conda-envs/environment-dev-py36.yml') }}
78+
hashFiles('conda-envs/environment-dev-py39.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') }}
7791
- uses: conda-incubator/setup-miniconda@v2
7892
with:
79-
activate-environment: pymc3-dev-py36
93+
activate-environment: pymc3-dev-py39
8094
channel-priority: strict
81-
environment-file: conda-envs/environment-dev-py36.yml
95+
environment-file: conda-envs/environment-dev-py39.yml
8296
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
8397
- name: Install-pymc3
8498
run: |
85-
conda activate pymc3-dev-py36
99+
conda activate pymc3-dev-py39
86100
pip install -e .
87101
python --version
88102
- name: Run tests
89103
run: |
90-
conda activate pymc3-dev-py36
104+
conda activate pymc3-dev-py39
91105
python -m pytest -vv --cov=pymc3 --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET
92106
- name: Upload coverage to Codecov
93107
uses: codecov/codecov-action@v1

.github/workflows/slash_dispatch.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Slash Command Dispatch
2+
on:
3+
issue_comment:
4+
types: [created]
5+
jobs:
6+
slashCommandDispatch:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Slash Command Dispatch
10+
uses: peter-evans/slash-command-dispatch@v2
11+
with:
12+
token: ${{ secrets.ACTION_TRIGGER_TOKEN }}
13+
issue-type: pull-request
14+
commands: |
15+
pre-commit-run

.github/workflows/windows.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: ${{ matrix.os }}
1818
env:
1919
TEST_SUBSET: ${{ matrix.test-subset }}
20-
THEANO_FLAGS: floatX=${{ matrix.floatx }},gcc.cxxflags='-march=core2'
20+
THEANO_FLAGS: floatX=${{ matrix.floatx }},gcc__cxxflags='-march=core2'
2121
defaults:
2222
run:
2323
shell: bash -l {0}
@@ -32,12 +32,29 @@ jobs:
3232
path: ~/conda_pkgs_dir
3333
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
3434
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') }}
3547
- uses: conda-incubator/setup-miniconda@v2
3648
with:
3749
activate-environment: pymc3-dev-py37
3850
channel-priority: strict
3951
environment-file: conda-envs/environment-dev-py37.yml
4052
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
4158
- run: |
4259
conda activate pymc3-dev-py37
4360
python -m pytest -vv --cov=pymc3 --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET

.pre-commit-config.yaml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,18 @@ repos:
1111
- id: no-commit-to-branch
1212
args: [--branch, master]
1313
- id: requirements-txt-fixer
14+
exclude: ^requirements-dev\.txt$
1415
- id: trailing-whitespace
1516
- repo: https://github.com/nbQA-dev/nbQA
16-
rev: 0.5.4
17+
rev: 0.5.5
1718
hooks:
1819
- id: nbqa-black
1920
additional_dependencies: [black==20.8b1]
2021
- id: nbqa-isort
2122
additional_dependencies: [isort==5.6.4]
2223
- id: nbqa-pyupgrade
2324
additional_dependencies: [pyupgrade==2.7.4]
25+
args: [--py37-plus]
2426
- repo: https://github.com/PyCQA/isort
2527
rev: 5.6.4
2628
hooks:
@@ -30,7 +32,7 @@ repos:
3032
rev: v2.7.4
3133
hooks:
3234
- id: pyupgrade
33-
args: [--py36-plus]
35+
args: [--py37-plus]
3436
- repo: https://github.com/psf/black
3537
rev: 20.8b1
3638
hooks:
@@ -61,6 +63,19 @@ repos:
6163
language: python
6264
name: Check no tests are ignored
6365
pass_filenames: false
66+
- id: conda-env-sort
67+
additional_dependencies: [pyyaml]
68+
entry: python scripts/sort_conda_envs.py
69+
files: ^conda-envs/
70+
language: python
71+
name: Sort dependencies in conda envs
72+
types: [yaml]
73+
- id: pip-from-conda
74+
additional_dependencies: [pyyaml]
75+
entry: python scripts/generate_pip_deps_from_conda.py
76+
files: ^conda-envs/
77+
language: python
78+
name: Generate pip dependency from conda
6479
- id: no-relative-imports
6580
name: No relative imports
6681
entry: from \.[\.\w]* import

CONTRIBUTING.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ We appreciate being notified of problems with the existing PyMC code. We prefer
1515

1616
Please verify that your issue is not being currently addressed by other issues or pull requests by using the GitHub search tool to look for key words in the project issue tracker.
1717

18+
Filter on the ["beginner friendly"](https://github.com/pymc-devs/pymc3/issues?q=is%3Aopen+is%3Aissue+label%3A%22beginner+friendly%22) label for issues which are good for new contributors.
19+
1820
# Contributing code via pull requests
1921

2022
While issue reporting is valuable, we strongly encourage users who are inclined to do so to submit patches for new or existing issues via pull requests. This is particularly the case for simple fixes, such as typos or tweaks to documentation, which do not require a heavy investment of time and attention.
@@ -38,16 +40,16 @@ The preferred workflow for contributing to PyMC3 is to fork the [GitHub reposito
3840
3. Create a ``feature`` branch to hold your development changes:
3941

4042
```bash
41-
$ git switch -c my-feature
43+
$ git checkout -b my-feature
4244
```
4345

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

4648
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):
4749

4850
```bash
49-
$ conda env create -f conda-envs/environment-dev-py36.yml # or py37 or py38
50-
$ conda activate pymc3-dev-py36
51+
$ conda env create -f conda-envs/environment-dev-py37.yml # or py38 or py39
52+
$ conda activate pymc3-dev-py37
5153
$ pip install -e .
5254
```
5355

@@ -147,4 +149,6 @@ Follow [TensorFlow's style guide](https://www.tensorflow.org/community/contribut
147149

148150
For documentation strings, we *prefer* [numpy style](https://numpydoc.readthedocs.io/en/latest/format.html) to comply with the style that predominates in our upstream dependencies.
149151

152+
Finally, see the [PyMC3 Python Code Style](https://github.com/pymc-devs/pymc3/wiki/PyMC3-Python-Code-Style) and the [PyMC's Jupyter Notebook Style](https://github.com/pymc-devs/pymc3/wiki/PyMC's-Jupyter-Notebook-Style) guides.
153+
150154
#### This guide was derived from the [scikit-learn guide to contributing](https://github.com/scikit-learn/scikit-learn/blob/master/CONTRIBUTING.md)

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Dependencies
120120
============
121121

122122
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
123+
NumPy, SciPy, and pandas
124124
(see `requirements.txt <https://github.com/pymc-devs/pymc3/blob/master/requirements.txt>`__ for version
125125
information).
126126

RELEASE-NOTES.md

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

3+
## PyMC3 4.0.0 (on deck)
4+
5+
This is the first release to support Python3.9 and to drop Python3.6.
6+
7+
### Maintenance
8+
- Fixed bug whereby partial traces returns after keyboard interrupt during parallel sampling had fewer draws than would've been available [#4318](https://github.com/pymc-devs/pymc3/pull/4318)
9+
- Make `sample_shape` same across all contexts in `draw_values` (see [#4305](https://github.com/pymc-devs/pymc3/pull/4305)).
10+
- Removed `theanof.set_theano_config` because it illegally touched Theano's privates (see [#4329](https://github.com/pymc-devs/pymc3/pull/4329)).
11+
12+
313
## PyMC3 3.10.0 (7 December 2020)
414

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

conda-envs/environment-dev-py36.yml

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

conda-envs/environment-dev-py37.yml

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,20 @@
11
name: pymc3-dev-py37
22
channels:
3-
- conda-forge
4-
- defaults
3+
- conda-forge
4+
- defaults
55
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
6+
- h5py>=2.7
7+
- ipython>=7.16
8+
- libblas=*=*mkl
9+
- mkl-service
10+
- nbsphinx>=0.4
11+
- numpydoc>=0.9
12+
- pre-commit>=2.8.0
13+
- pytest-cov>=2.5
14+
- pytest>=3.0
15+
- python-graphviz
16+
- python=3.7
17+
- recommonmark>=0.4
18+
- sphinx-autobuild>=0.7
19+
- sphinx>=1.5
20+
- watermark

0 commit comments

Comments
 (0)