Skip to content

Commit

Permalink
Rename all mentions of PyMC3 and pymc3 to PyMC and pymc, respetively
Browse files Browse the repository at this point in the history
  • Loading branch information
twiecki authored and michaelosthege committed Sep 24, 2021
1 parent 6572266 commit 8ed23e0
Show file tree
Hide file tree
Showing 187 changed files with 1,412 additions and 1,432 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/arviz_compat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
os: [ubuntu-latest, macos-latest]
floatx: [float64]
test-subset:
- pymc3/tests/test_distributions.py
- pymc3/tests/test_distributions_random.py
- pymc3/tests/test_sampling.py
- pymc/tests/test_distributions.py
- pymc/tests/test_distributions_random.py
- pymc/tests/test_sampling.py
fail-fast: false
runs-on: ${{ matrix.os }}
env:
Expand Down Expand Up @@ -48,20 +48,20 @@ jobs:
hashFiles('requirements.txt') }}
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: pymc3-dev-py39
activate-environment: pymc-dev-py39
channel-priority: strict
environment-file: conda-envs/environment-dev-py39.yml
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- name: Install pymc3
- name: Install pymc
run: |
conda activate pymc3-dev-py39
conda activate pymc-dev-py39
pip install -e .
python --version
- name: Install latest arviz
run: |
conda activate pymc3-dev-py39
conda activate pymc-dev-py39
pip uninstall arviz -y
pip install git+git://github.com/arviz-devs/arviz.git
- name: Run tests
run: |
python -m pytest -vv --cov=pymc3 --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET
python -m pytest -vv --cov=pymc --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET
12 changes: 6 additions & 6 deletions .github/workflows/jaxtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
os: [ubuntu-latest]
floatx: [float64]
test-subset:
- pymc3/tests/test_sampling_jax.py
- pymc/tests/test_sampling_jax.py
fail-fast: false
runs-on: ${{ matrix.os }}
env:
Expand Down Expand Up @@ -46,19 +46,19 @@ jobs:
hashFiles('requirements.txt') }}
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: pymc3-dev-py39
activate-environment: pymc-dev-py39
channel-priority: strict
environment-file: conda-envs/environment-dev-py39.yml
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- name: Install pymc3
- name: Install pymc
run: |
conda activate pymc3-dev-py39
conda activate pymc-dev-py39
pip install -e .
python --version
- name: Install jax specific dependencies
run: |
conda activate pymc3-dev-py39
conda activate pymc-dev-py39
pip install numpyro tensorflow_probability "jax<0.2.21"
- name: Run tests
run: |
python -m pytest -vv --cov=pymc3 --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET
python -m pytest -vv --cov=pymc --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET
164 changes: 81 additions & 83 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,72 +29,70 @@ jobs:
# Subsequent blocks: Only pass paths to test files.
# → pytest will run only these files
- |
--ignore=pymc3/tests/test_distributions_timeseries.py
--ignore=pymc3/tests/test_initvals.py
--ignore=pymc3/tests/test_mixture.py
--ignore=pymc3/tests/test_model_graph.py
--ignore=pymc3/tests/test_modelcontext.py
--ignore=pymc3/tests/test_parallel_sampling.py
--ignore=pymc3/tests/test_posteriors.py
--ignore=pymc3/tests/test_sampling.py
--ignore=pymc3/tests/test_profile.py
--ignore=pymc3/tests/test_step.py
--ignore=pymc3/tests/test_tuning.py
--ignore=pymc3/tests/test_transforms.py
--ignore=pymc3/tests/test_types.py
--ignore=pymc3/tests/test_variational_inference.py
--ignore=pymc3/tests/test_sampling_jax.py
--ignore=pymc3/tests/test_dist_math.py
--ignore=pymc3/tests/test_minibatches.py
--ignore=pymc3/tests/test_pickling.py
--ignore=pymc3/tests/test_plots.py
--ignore=pymc3/tests/test_updates.py
--ignore=pymc3/tests/test_examples.py
--ignore=pymc3/tests/test_gp.py
--ignore=pymc3/tests/test_model.py
--ignore=pymc3/tests/test_model_func.py
--ignore=pymc3/tests/test_ode.py
--ignore=pymc3/tests/test_posdef_sym.py
--ignore=pymc3/tests/test_quadpotential.py
--ignore=pymc3/tests/test_shape_handling.py
--ignore=pymc3/tests/test_distributions.py
--ignore=pymc3/tests/test_distributions_random.py
--ignore=pymc3/tests/test_idata_conversion.py
--ignore=pymc/tests/test_distributions_timeseries.py
--ignore=pymc/tests/test_initvals.py
--ignore=pymc/tests/test_mixture.py
--ignore=pymc/tests/test_model_graph.py
--ignore=pymc/tests/test_modelcontext.py
--ignore=pymc/tests/test_parallel_sampling.py
--ignore=pymc/tests/test_posteriors.py
--ignore=pymc/tests/test_sampling.py
--ignore=pymc/tests/test_profile.py
--ignore=pymc/tests/test_step.py
--ignore=pymc/tests/test_tuning.py
--ignore=pymc/tests/test_transforms.py
--ignore=pymc/tests/test_types.py
--ignore=pymc/tests/test_variational_inference.py
--ignore=pymc/tests/test_sampling_jax.py
--ignore=pymc/tests/test_dist_math.py
--ignore=pymc/tests/test_minibatches.py
--ignore=pymc/tests/test_pickling.py
--ignore=pymc/tests/test_plots.py
--ignore=pymc/tests/test_updates.py
--ignore=pymc/tests/test_gp.py
--ignore=pymc/tests/test_model.py
--ignore=pymc/tests/test_model_func.py
--ignore=pymc/tests/test_ode.py
--ignore=pymc/tests/test_posdef_sym.py
--ignore=pymc/tests/test_quadpotential.py
--ignore=pymc/tests/test_shape_handling.py
--ignore=pymc/tests/test_distributions.py
--ignore=pymc/tests/test_distributions_random.py
--ignore=pymc/tests/test_idata_conversion.py
- |
pymc3/tests/test_initvals.py
pymc3/tests/test_distributions.py
pymc/tests/test_initvals.py
pymc/tests/test_distributions.py
- |
pymc3/tests/test_modelcontext.py
pymc3/tests/test_dist_math.py
pymc3/tests/test_minibatches.py
pymc3/tests/test_pickling.py
pymc3/tests/test_plots.py
pymc3/tests/test_updates.py
pymc3/tests/test_transforms.py
pymc/tests/test_modelcontext.py
pymc/tests/test_dist_math.py
pymc/tests/test_minibatches.py
pymc/tests/test_pickling.py
pymc/tests/test_plots.py
pymc/tests/test_updates.py
pymc/tests/test_transforms.py
- |
pymc3/tests/test_parallel_sampling.py
pymc3/tests/test_sampling.py
pymc3/tests/test_tuning.py
pymc3/tests/test_posteriors.py
pymc/tests/test_parallel_sampling.py
pymc/tests/test_sampling.py
pymc/tests/test_tuning.py
pymc/tests/test_posteriors.py
- |
pymc3/tests/test_idata_conversion.py
pymc3/tests/test_distributions_random.py
pymc3/tests/test_distributions_timeseries.py
pymc3/tests/test_examples.py
pymc3/tests/test_gp.py
pymc3/tests/test_model.py
pymc3/tests/test_model_func.py
pymc3/tests/test_model_graph.py
pymc3/tests/test_ode.py
pymc3/tests/test_posdef_sym.py
pymc3/tests/test_profile.py
pymc3/tests/test_quadpotential.py
pymc3/tests/test_shape_handling.py
pymc3/tests/test_step.py
pymc/tests/test_idata_conversion.py
pymc/tests/test_distributions_random.py
pymc/tests/test_distributions_timeseries.py
pymc/tests/test_gp.py
pymc/tests/test_model.py
pymc/tests/test_model_func.py
pymc/tests/test_model_graph.py
pymc/tests/test_ode.py
pymc/tests/test_posdef_sym.py
pymc/tests/test_profile.py
pymc/tests/test_quadpotential.py
pymc/tests/test_shape_handling.py
pymc/tests/test_step.py
fail-fast: false
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -129,20 +127,20 @@ jobs:
hashFiles('requirements.txt') }}
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: pymc3-dev-py37
activate-environment: pymc-dev-py37
channel-priority: strict
environment-file: conda-envs/environment-dev-py37.yml
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- name: Install-pymc3
- name: Install-pymc
run: |
conda activate pymc3-dev-py37
conda activate pymc-dev-py37
pip install -e .
pip install --pre -U polyagamma
python --version
- name: Run tests
run: |
conda activate pymc3-dev-py37
python -m pytest -vv --cov=pymc3 --cov-append --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET
conda activate pymc-dev-py37
python -m pytest -vv --cov=pymc --cov-append --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
Expand All @@ -156,24 +154,24 @@ jobs:
floatx: [float32, float64]
test-subset:
- |
pymc3/tests/test_initvals.py
pymc3/tests/test_distributions_random.py
pymc3/tests/test_distributions_timeseries.py
pymc/tests/test_initvals.py
pymc/tests/test_distributions_random.py
pymc/tests/test_distributions_timeseries.py
- |
pymc3/tests/test_parallel_sampling.py
pymc3/tests/test_sampling.py
pymc3/tests/test_tuning.py
pymc3/tests/test_shared.py
pymc/tests/test_parallel_sampling.py
pymc/tests/test_sampling.py
pymc/tests/test_tuning.py
pymc/tests/test_shared.py
- |
pymc3/tests/test_gp.py
pymc3/tests/test_ode.py
pymc/tests/test_gp.py
pymc/tests/test_ode.py
- |
pymc3/tests/test_model.py
pymc3/tests/test_model_func.py
pymc3/tests/test_modelcontext.py
pymc3/tests/test_model_graph.py
pymc3/tests/test_pickling.py
pymc3/tests/test_profile.py
pymc/tests/test_model.py
pymc/tests/test_model_func.py
pymc/tests/test_modelcontext.py
pymc/tests/test_model_graph.py
pymc/tests/test_pickling.py
pymc/tests/test_profile.py
fail-fast: false
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -208,19 +206,19 @@ jobs:
hashFiles('requirements.txt') }}
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: pymc3-dev-py38
activate-environment: pymc-dev-py38
channel-priority: strict
environment-file: conda-envs/windows-environment-dev-py38.yml
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- name: Install-pymc3
- name: Install-pymc
run: |
conda activate pymc3-dev-py38
conda activate pymc-dev-py38
pip install -e .
pip install --pre -U polyagamma
python --version
- name: Run tests
# This job uses a cmd shell, therefore the environment variable syntax is different!
# The ">-" in the next line replaces newlines with spaces (see https://stackoverflow.com/a/66809682).
run: >-
conda activate pymc3-dev-py38 &&
python -m pytest -vv --cov=pymc3 --cov-append --cov-report=xml --cov-report term --durations=50 %TEST_SUBSET%
conda activate pymc-dev-py38 &&
python -m pytest -vv --cov=pymc --cov-append --cov-report=xml --cov-report term --durations=50 %TEST_SUBSET%
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
# pip install -r requirements.txt
#- name: Run tests
# run: |
# pytest --cov=./pymc3 --cov-report term-missing pymc3/
# pytest --cov=./pymc --cov-report term-missing pymc/
- name: Install release tooling
run: |
pip install twine wheel
Expand All @@ -33,9 +33,9 @@ jobs:
- name: Check version number match
run: |
echo "GITHUB_REF: ${GITHUB_REF}"
# The GITHUB_REF should be something like "refs/tags/v3.x.x"
# The GITHUB_REF should be something like "refs/tags/v1.2.3"
# Make sure the package version is the same as the tag
grep -Rq "^Version: ${GITHUB_REF:11}$" pymc3.egg-info/PKG-INFO
grep -Rq "^Version: ${GITHUB_REF:11}$" pymc.egg-info/PKG-INFO
- name: Publish to PyPI
run: |
twine check dist/*
Expand All @@ -52,4 +52,4 @@ jobs:
run: sleep 240
- name: Install from PyPI
run: |
pip install pymc3==${GITHUB_REF:11}
pip install pymc==${GITHUB_REF:11}
20 changes: 10 additions & 10 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# Architecture
This document describes the high-level architecture of PyMC3.
This document describes the high-level architecture of PyMC.

# Bird's Eye View
[comment]: <> (https://drive.google.com/file/d/1lfEzokkNUJr_JIeSDQfha5a57pokz0qI)
![Architecture](docs/Architecture.png)
Lets you define probabilistic graphs or models that can be easily used to compute log probabilities for posterior
inference or to draw random samples for prior and posterior prediction.

PyMC3 includes a few inference techniques, in particular:
PyMC includes a few inference techniques, in particular:
* Markov chain Monte Carlo
* Variational Inference
* Sequential Monte Carlo

It also contains numerous others pieces of functionality such as GraphviZ model visualization tools
as well as various mathematical helper functions.

The most central pieces functionality of PyMC3 are shown visually below, as well as their
The most central pieces functionality of PyMC are shown visually below, as well as their
relation to other major packages. Not all modules are shown, either because
they are smaller or self explanatory in scope, or they're pending
deprecation

## Functionality not in PyMC3
It is easier to start with functionality that is not present in PyMC3 but
## Functionality not in PyMC
It is easier to start with functionality that is not present in PyMC but
rather deferred to outside libraries. If seeking to understand any
of the topics below refer to that specific library

Expand All @@ -39,7 +39,7 @@ of the topics below refer to that specific library


# Modules
The codebase of PyMC3 is split among single Python file modules at the root
The codebase of PyMC is split among single Python file modules at the root
level, as well as directories with Python code for logical groups of functionality.
Admittedly the split between single `.py` module or directory is not defined by a strict
criteria but tends to occur when single `.py` files would be "too big".
Expand All @@ -56,21 +56,21 @@ with pm.Model() as model:

```

## {mod}`pymc3.model`
## {mod}`pymc.model`
Contains primitives related model definition and methods used for evaluation of the model.
In no particular order they are

* `ContextMeta`: The context manager that enables the `with pm.Model() as model` syntax
* {class}`~pymc3.Factor`: Defines the methods for the various logprobs for models
* {class}`~pymc.Factor`: Defines the methods for the various logprobs for models
* `ValueGrad` which handles the value and gradient and is the main connection point to Aesara
* `Deterministic` and `Potential`: Definitions for two pieces of functionality useful in some model definitions

## distributions/
Contains multiple submodules that define distributions, as well as logic that aids in distributions usage.
Important modules to note are

* `distribution.py`: This contains parent class for all PyMC3 distributions.
Notably the `distribution.distribution` class contains the `observed` argument which in PyMC3 differentiates
* `distribution.py`: This contains parent class for all PyMC distributions.
Notably the `distribution.distribution` class contains the `observed` argument which in PyMC differentiates
a random variable distribution from a likelihood distribution.

* `logprob.py`: This contains the log probability logic for the distributions themselves.
Expand Down
Loading

0 comments on commit 8ed23e0

Please sign in to comment.