Skip to content

Commit

Permalink
Merge branch 'master' into mlda
Browse files Browse the repository at this point in the history
  • Loading branch information
gmingas authored Jun 23, 2020
2 parents c5d7e04 + d0de763 commit 478162f
Show file tree
Hide file tree
Showing 116 changed files with 19,286 additions and 8,075 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: release-pipeline

on:
release:
types:
- created

jobs:
release-job:
runs-on: ubuntu-latest
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.7
# TODO: ideally, this pipeline should run parallelized tests in upstream jobs..
#- name: Install test tooling
# run: |
# pip install pytest pytest-cov nose nose-parameterized
# pip install -r requirements.txt
#- name: Run tests
# run: |
# pytest --cov=./pymc3 --cov-report term-missing pymc3/
- name: Install release tooling
run: |
pip install twine wheel
- name: Build package
run: |
python setup.py sdist bdist_wheel
- name: Check version number match
run: |
echo "GITHUB_REF: ${GITHUB_REF}"
# The GITHUB_REF should be something like "refs/tags/v3.x.x"
# Make sure the package version is the same as the tag
grep -Rq "^Version: ${GITHUB_REF:11}$" pymc3.egg-info/PKG-INFO
- name: Publish to PyPI
run: |
twine check dist/*
twine upload --repository pypi --username __token__ --password ${PYPI_TOKEN} dist/*
test-install-job:
needs: release-job
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Give PyPI a chance to update the index
run: sleep 240
- name: Install from PyPI
run: |
pip install pymc3==${GITHUB_REF:11}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ benchmarks/html/
benchmarks/results/
.pytest_cache/

# VSCode
# Visual Studio / VSCode
.vs/
.vscode/
.mypy_cache

Expand Down
16 changes: 15 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,21 @@ stages:

jobs:
include:
- stage: binder
- name: ArviZ compatibility
stage: test
install:
- . ./scripts/create_testenv.sh
- pip uninstall arviz -y
# replace ArviZ with the lastest master
- pip install git+git://github.com/arviz-devs/arviz.git
- pip install codecov
- conda list && pip freeze
- export FLOATX='float64'
script:
- . ./scripts/test.sh --durations=10 --cov-append pymc3/tests/test_sampling.py
after_success: skip
- name: Update Binder
stage: binder
before_install: skip
install: skip
script:
Expand Down
4 changes: 2 additions & 2 deletions GOVERNANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ documentation, designs or other work to one or more Project repositories.
Anyone can be a Contributor. Contributors can be affiliated with any legal
entity or none. Contributors participate in the project by submitting,
reviewing and discussing GitHub Pull Requests and Issues and participating in
open and public Project discussions on GitHub, Google+, Slack, Hackpad, Gitter chat rooms and mailing lists. The foundation of Project participation is openness
open and public Project discussions on GitHub, Slack, Gitter chat rooms and mailing lists. The foundation of Project participation is openness
and transparency.

There have been over 100 Contributors to the Project, whose contributions are listed in the logs of other repositories of the PyMC and projects.
There have been over 100 Contributors to the Project, their contributions are listed in the logs of the PyMC repositories as well as those of associated projects.

The Project Community consists of all Contributors and Users of the Project.
Contributors work on behalf of and are responsible to the larger Project
Expand Down
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
recursive-include pymc3/examples/data *
recursive-include source *
recursive-include docs *
# because of an upload-size limit by PyPI, we're temporarily removing docs from the tarball:
recursive-exclude docs *
include requirements.txt
include *.md *.rst
include scripts/*.sh
Expand Down
24 changes: 21 additions & 3 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,38 @@
# Release Notes

## PyMC3 3.9 (On deck)
## PyMC3 3.9.x (on deck)
*waiting for contributions*

## PyMC3 3.9.1 (16 June 2020)
The `v3.9.0` upload to PyPI didn't include a tarball, which is fixed in this release.
Though we had to temporarily remove the `docs/*` folder from the tarball due to a size limit.

## PyMC3 3.9.0 (16 June 2020)

### New features
- use [fastprogress](https://github.com/fastai/fastprogress) instead of tqdm [#3693](https://github.com/pymc-devs/pymc3/pull/3693)
- Use [fastprogress](https://github.com/fastai/fastprogress) instead of tqdm [#3693](https://github.com/pymc-devs/pymc3/pull/3693).
- `DEMetropolis` can now tune both `lambda` and `scaling` parameters, but by default neither of them are tuned. See [#3743](https://github.com/pymc-devs/pymc3/pull/3743) for more info.
- `DEMetropolisZ`, an improved variant of `DEMetropolis` brings better parallelization and higher efficiency with fewer chains with a slower initial convergence. This implementation is experimental. See [#3784](https://github.com/pymc-devs/pymc3/pull/3784) for more info.
- Notebooks that give insight into `DEMetropolis`, `DEMetropolisZ` and the `DifferentialEquation` interface are now located in the [Tutorials/Deep Dive](https://docs.pymc.io/nb_tutorials/index.html) section.
- Add `fast_sample_posterior_predictive`, a vectorized alternative to `sample_posterior_predictive`. This alternative is substantially faster for large models.
- GP covariance functions can now be exponentiated by a scalar. See PR [#3852](https://github.com/pymc-devs/pymc3/pull/3852)
- `sample_posterior_predictive` can now feed on `xarray.Dataset` - e.g. from `InferenceData.posterior`. (see [#3846](https://github.com/pymc-devs/pymc3/pull/3846))
- `SamplerReport` (`MultiTrace.report`) now has properties `n_tune`, `n_draws`, `t_sampling` for increased convenience (see [#3827](https://github.com/pymc-devs/pymc3/pull/3827))
- `pm.sample(..., return_inferencedata=True)` can now directly return the trace as `arviz.InferenceData` (see [#3911](https://github.com/pymc-devs/pymc3/pull/3911))
- `pm.sample` now has support for adapting dense mass matrix using `QuadPotentialFullAdapt` (see [#3596](https://github.com/pymc-devs/pymc3/pull/3596), [#3705](https://github.com/pymc-devs/pymc3/pull/3705), [#3858](https://github.com/pymc-devs/pymc3/pull/3858), and [#3893](https://github.com/pymc-devs/pymc3/pull/3893)). Use `init="adapt_full"` or `init="jitter+adapt_full"` to use.
- `Moyal` distribution added (see [#3870](https://github.com/pymc-devs/pymc3/pull/3870)).
- `pm.LKJCholeskyCov` now automatically computes and returns the unpacked Cholesky decomposition, the correlations and the standard deviations of the covariance matrix (see [#3881](https://github.com/pymc-devs/pymc3/pull/3881)).
- `pm.Data` container can now be used for index variables, i.e with integer data and not only floats (issue [#3813](https://github.com/pymc-devs/pymc3/issues/3813), fixed by [#3925](https://github.com/pymc-devs/pymc3/pull/3925)).
- `pm.Data` container can now be used as input for other random variables (issue [#3842](https://github.com/pymc-devs/pymc3/issues/3842), fixed by [#3925](https://github.com/pymc-devs/pymc3/pull/3925)).
- Allow users to specify coordinates and dimension names instead of numerical shapes when specifying a model. This makes interoperability with ArviZ easier. ([see #3551](https://github.com/pymc-devs/pymc3/pull/3551))
- Plots and Stats API sections now link to ArviZ documentation [#3927](https://github.com/pymc-devs/pymc3/pull/3927)
- Add `SamplerReport` with properties `n_draws`, `t_sampling` and `n_tune` to SMC. `n_tune` is always 0 [#3931](https://github.com/pymc-devs/pymc3/issues/3931).
- SMC-ABC: add option to define summary statistics, allow to sample from more complex models, remove redundant distances [#3940](https://github.com/pymc-devs/pymc3/issues/3940)

### Maintenance
- Tuning results no longer leak into sequentially sampled `Metropolis` chains (see #3733 and #3796).
- We'll deprecate the `Text` and `SQLite` backends and the `save_trace`/`load_trace` functions, since this is now done with ArviZ. (see [#3902](https://github.com/pymc-devs/pymc3/pull/3902))
- ArviZ `v0.8.3` is now the minimum required version
- In named models, `pm.Data` objects now get model-relative names (see [#3843](https://github.com/pymc-devs/pymc3/pull/3843)).
- `pm.sample` now takes 1000 draws and 1000 tuning samples by default, instead of 500 previously (see [#3855](https://github.com/pymc-devs/pymc3/pull/3855)).
- Moved argument division out of `NegativeBinomial` `random` method. Fixes [#3864](https://github.com/pymc-devs/pymc3/issues/3864) in the style of [#3509](https://github.com/pymc-devs/pymc3/pull/3509).
Expand All @@ -25,11 +41,13 @@
- End of sampling report now uses `arviz.InferenceData` internally and avoids storing
pointwise log likelihood (see [#3883](https://github.com/pymc-devs/pymc3/pull/3883)).
- The multiprocessing start method on MacOS is now set to "forkserver", to avoid crashes (see issue [#3849](https://github.com/pymc-devs/pymc3/issues/3849), solved by [#3919](https://github.com/pymc-devs/pymc3/pull/3919)).
- The AR1 logp now uses the precision of the whole AR1 process instead of just the innovation precision (see issue [#3892](https://github.com/pymc-devs/pymc3/issues/3892), fixed by [#3899](https://github.com/pymc-devs/pymc3/pull/3899)).
- Forced the `Beta` distribution's `random` method to generate samples that are in the open interval $(0, 1)$, i.e. no value can be equal to zero or equal to one (issue [#3898](https://github.com/pymc-devs/pymc3/issues/3898) fixed by [#3924](https://github.com/pymc-devs/pymc3/pull/3924)).
- Fixed an issue that happened on Windows, that was introduced by the clipped beta distribution rvs function ([#3924](https://github.com/pymc-devs/pymc3/pull/3924)). Windows does not support the `float128` dtype, but we had assumed that it had to be available. The solution was to only support `float128` on Linux and Darwin systems (see issue [#3929](https://github.com/pymc-devs/pymc3/issues/3849) fixed by [#3930](https://github.com/pymc-devs/pymc3/pull/3930)).

### Deprecations
- Remove `sample_ppc` and `sample_ppc_w` that were deprecated in 3.6.
- Deprecated `sd` in version 3.7 has been replaced by `sigma` now raises `DeprecationWarning` on using `sd` in continuous, mixed and timeseries distributions. (see [#3837](https://github.com/pymc-devs/pymc3/pull/3837) and [#3688](https://github.com/pymc-devs/pymc3/issues/3688)).
- Deprecated `sd` has been replaced by `sigma` (already in version 3.7) in continuous, mixed and timeseries distributions and now raises `DeprecationWarning` when `sd` is used. (see [#3837](https://github.com/pymc-devs/pymc3/pull/3837) and [#3688](https://github.com/pymc-devs/pymc3/issues/3688)).
- We'll deprecate the `Text` and `SQLite` backends and the `save_trace`/`load_trace` functions, since this is now done with ArviZ. (see [#3902](https://github.com/pymc-devs/pymc3/pull/3902))
- Dropped some deprecated kwargs and functions (see [#3906](https://github.com/pymc-devs/pymc3/pull/3906))
- Dropped the outdated 'nuts' initialization method for `pm.sample` (see [#3863](https://github.com/pymc-devs/pymc3/pull/3863)).
Expand Down
19 changes: 16 additions & 3 deletions docs/source/api/plots.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,20 @@ Plots
*****

.. currentmodule:: pymc3.plots
Plots are delegated to the
`ArviZ <https://arviz-devs.github.io/arviz/index.html>`_.
library, a general purpose library for
"exploratory analysis of Bayesian models."
For plots, ``pymc3.<function>`` are now aliases
for ArviZ functions. Thus, the links below will redirect you to
ArviZ docs:

.. automodule:: pymc3.plots
:members: traceplot, plot_posterior, forestplot, compareplot, autocorrplot,
energyplot, kdeplot, densityplot, pairplot
- :func:`pymc3.traceplot <arviz:arviz.plot_trace>`
- :func:`pymc3.plot_posterior <arviz:arviz.plot_posterior>`
- :func:`pymc3.forestplot <arviz:arviz.plot_forest>`
- :func:`pymc3.compareplot <arviz:arviz.plot_compare>`
- :func:`pymc3.autocorrplot <arviz:arviz.plot_autocorr>`
- :func:`pymc3.energyplot <arviz:arviz.plot_energy>`
- :func:`pymc3.kdeplot <arviz:arviz.plot_kde>`
- :func:`pymc3.densityplot <arviz:arviz.plot_density>`
- :func:`pymc3.pairplot <arviz:arviz.plot_pair>`
21 changes: 19 additions & 2 deletions docs/source/api/stats.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
*****
Stats
*****
Statistics and diagnostics are delegated to the
`ArviZ <https://arviz-devs.github.io/arviz/index.html>`_.
library, a general purpose library for
"exploratory analysis of Bayesian models."
For statistics and diagnostics, ``pymc3.<function>`` are now aliases
for ArviZ functions. Thus, the links below will redirect you to
ArviZ docs:

.. currentmodule:: pymc3.stats

.. automodule:: pymc3.stats
:members:

- :func:`pymc3.bfmi <arviz:arviz.bfmi>`
- :func:`pymc3.compare <arviz:arviz.compare>`
- :func:`pymc3.ess <arviz:arviz.ess>`
- :data:`pymc3.geweke <arviz:arviz.geweke>`
- :func:`pymc3.hpd <arviz:arviz.hpd>`
- :func:`pymc3.loo <arviz:arviz.loo>`
- :func:`pymc3.mcse <arviz:arviz.mcse>`
- :func:`pymc3.r2_score <arviz:arviz.r2_score>`
- :func:`pymc3.rhat <arviz:arviz.rhat>`
- :func:`pymc3.summary <arviz:arviz.summary>`
- :func:`pymc3.waic <arviz:arviz.waic>`
6 changes: 6 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.mathjax",
"sphinx.ext.intersphinx",
"nbsphinx",
"numpydoc",
"IPython.sphinxext.ipython_console_highlighting",
Expand Down Expand Up @@ -130,6 +131,11 @@
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False

# intersphinx configuration to ease linking arviz docs
intersphinx_mapping = {
"arviz": ("https://arviz-devs.github.io/arviz/", None),
}


# -- Options for HTML output ----------------------------------------------

Expand Down
525 changes: 386 additions & 139 deletions docs/source/notebooks/AR.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit 478162f

Please sign in to comment.