Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add code example to Potential docstrings #6489

Closed
wants to merge 48 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
8eb38c8
Docstring for Potential function updated
Dhruvanshu-Joshi Jan 28, 2023
6c3306e
Updated model.py with all the suggestions
Dhruvanshu-Joshi Feb 3, 2023
e739546
Introduce `IBaseTrace` with minimal API for chain backends
michaelosthege Jan 12, 2023
c5aff17
Modify internal sampling functions from `BaseTrace` to `IBaseTrace`
michaelosthege Jan 12, 2023
26f7636
Create traces with `init_traces` helper function
michaelosthege Jan 14, 2023
b213cf3
Fix `test_weibull_logp` flakyness
michaelosthege Jan 24, 2023
ac9652e
Add nu parametrization to beta distribution (#6344)
alekracicot Feb 3, 2023
db49a15
Introduce `IBaseTrace` with minimal API for chain backends
michaelosthege Jan 12, 2023
8ac2cf6
Modify internal sampling functions from `BaseTrace` to `IBaseTrace`
michaelosthege Jan 12, 2023
591536c
Create traces with `init_traces` helper function
michaelosthege Jan 14, 2023
00a47cf
Fix `test_weibull_logp` flakyness
michaelosthege Jan 24, 2023
2286536
Add nu parametrization to beta distribution (#6344)
alekracicot Feb 3, 2023
0bdfecd
Additional codeblocks added and theory reduced
Dhruvanshu-Joshi Feb 7, 2023
d58f9f6
Allow for `StatsBijection.rmap` of incomplete stat dicts
michaelosthege Feb 3, 2023
9eaf1f2
More robust tune stat fetching and type hints
michaelosthege Feb 5, 2023
c5e4497
⬆️ UPGRADE: Autoupdate pre-commit config
Feb 6, 2023
9b77241
Merge Conflicts solved
Dhruvanshu-Joshi Feb 7, 2023
e74b58d
Move joint_logprob to test/logprob/utils.py
Armavica Dec 23, 2022
5524d6a
Move pymc/distributions/logprob.py to pymc/logprob
Armavica Jan 7, 2023
ab680a5
Remove test redundant with test_measurable_join_*
Armavica Feb 7, 2023
28bac77
Remove test redundant with test_mixture.py
Armavica Feb 7, 2023
3733296
Update GLM_linear.ipynb (#6519)
bsenst Feb 12, 2023
2eb911e
Bump docker/setup-buildx-action from 2.4.0 to 2.4.1 (#6520)
dependabot[bot] Feb 13, 2023
3fcf675
Bump docker/build-push-action from 3 to 4 (#6505)
dependabot[bot] Feb 14, 2023
301b28a
Fix flaky `test_truncation_specialized_op`
ricardoV94 Feb 14, 2023
9172925
Remove experimental module warning from jax.py
ricardoV94 Feb 2, 2023
4ed38b0
Raise error when trying to jaxify graphs with RNGs
ricardoV94 Feb 2, 2023
0660efa
Allow external nuts sampler directly from `sample`
twiecki Jan 1, 2023
c2ce47f
Make all but `draws` keyword-only arguments in `sample`.
ricardoV94 Feb 15, 2023
31c30dc
Adding function for mutable coords (#6515)
Dhruvanshu-Joshi Feb 16, 2023
26f884b
Add `StatsBijection.n_samplers` property
michaelosthege Feb 11, 2023
99f17c7
Introduce `stats_dtypes_shape` attribute
michaelosthege Feb 11, 2023
7e9e17d
Specify `stats_dtypes_shapes` for all samplers
michaelosthege Feb 11, 2023
b3541ad
⬆️ UPGRADE: Autoupdate pre-commit config
Feb 20, 2023
c5e20ff
Small fix in HyperGeometric docstring
aleicazatti Feb 9, 2023
2978b40
Build docs in simplified environment (#6537)
michaelosthege Feb 20, 2023
ec30a2f
BetaBinomial variance is not correctly described (#6516)
soma2000-lang Feb 20, 2023
e45e6c2
increase zerosum readability issue #6459 (#6522)
michaelraczycki Feb 22, 2023
562e51e
issue #5791, dims & cords inference from xarray (#6514)
michaelraczycki Feb 22, 2023
e1d36ca
Move tests outside of code directory
Armavica Feb 21, 2023
b9a3dcc
Fix some code lints found with ruff (#6545)
Armavica Feb 25, 2023
9b59771
Add check for variables in step samplers (#6524)
michaelraczycki Feb 25, 2023
14a10b7
Refactor sample return (#6546)
michaelosthege Feb 26, 2023
d334711
Docstring for Potential function updated
Dhruvanshu-Joshi Jan 28, 2023
941dd44
Updated model.py with all the suggestions
Dhruvanshu-Joshi Feb 3, 2023
110fc87
Additional codeblocks added and theory reduced
Dhruvanshu-Joshi Feb 7, 2023
72f3470
Update Potential docstring according to suggestions
Dhruvanshu-Joshi Feb 26, 2023
639f471
Update docstring according to suggestions
Dhruvanshu-Joshi Feb 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/devcontainer-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b

- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2.4.0
uses: docker/setup-buildx-action@v2.4.1

- name: Prepare metadata
id: meta
Expand All @@ -42,7 +42,7 @@ jobs:

- name: Build and push Docker image
id: docker_build
uses: docker/build-push-action@e551b19e49efd4e98792db7592c17c09b89db8d8
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: scripts/dev.Dockerfile
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
type=semver,pattern={{major}}.{{minor}}

- name: Build and load image
uses: docker/build-push-action@v3
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: scripts/Dockerfile
Expand All @@ -46,7 +46,7 @@ jobs:
docker run --rm ${{ env.CONTAINER_NAME }} conda run -n pymc-dev python -c 'import pymc;print(pymc.__version__)'

- name: Build and push
uses: docker/build-push-action@v3
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
push: true
Expand Down
128 changes: 64 additions & 64 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,66 +38,65 @@ jobs:
python-version: ["3.10"]
test-subset:
- |
pymc/tests/test_util.py
pymc/tests/distributions/test_logprob.py
pymc/tests/test_pytensorf.py
pymc/tests/test_math.py
pymc/tests/backends/test_base.py
pymc/tests/backends/test_ndarray.py
pymc/tests/step_methods/hmc/test_hmc.py
pymc/tests/test_func_utils.py
pymc/tests/distributions/test_shape_utils.py
pymc/tests/distributions/test_mixture.py
tests/test_util.py
tests/test_pytensorf.py
tests/test_math.py
tests/backends/test_base.py
tests/backends/test_ndarray.py
tests/step_methods/hmc/test_hmc.py
tests/test_func_utils.py
tests/distributions/test_shape_utils.py
tests/distributions/test_mixture.py

- |
pymc/tests/distributions/test_continuous.py
pymc/tests/distributions/test_multivariate.py
tests/distributions/test_continuous.py
tests/distributions/test_multivariate.py

- |
pymc/tests/distributions/test_bound.py
pymc/tests/distributions/test_censored.py
pymc/tests/distributions/test_simulator.py
pymc/tests/sampling/test_forward.py
pymc/tests/sampling/test_population.py
pymc/tests/stats/test_convergence.py
pymc/tests/stats/test_log_likelihood.py
pymc/tests/distributions/test_distribution.py
pymc/tests/distributions/test_discrete.py
tests/distributions/test_bound.py
tests/distributions/test_censored.py
tests/distributions/test_simulator.py
tests/sampling/test_forward.py
tests/sampling/test_population.py
tests/stats/test_convergence.py
tests/stats/test_log_likelihood.py
tests/distributions/test_distribution.py
tests/distributions/test_discrete.py

- |
pymc/tests/tuning/test_scaling.py
pymc/tests/tuning/test_starting.py
pymc/tests/distributions/test_dist_math.py
pymc/tests/distributions/test_transform.py
pymc/tests/sampling/test_mcmc.py
pymc/tests/sampling/test_parallel.py
pymc/tests/test_printing.py
tests/tuning/test_scaling.py
tests/tuning/test_starting.py
tests/distributions/test_dist_math.py
tests/distributions/test_transform.py
tests/sampling/test_mcmc.py
tests/sampling/test_parallel.py
tests/test_printing.py

- |
pymc/tests/distributions/test_timeseries.py
pymc/tests/gp/test_cov.py
pymc/tests/gp/test_gp.py
pymc/tests/gp/test_mean.py
pymc/tests/gp/test_util.py
pymc/tests/test_model.py
pymc/tests/test_model_graph.py
pymc/tests/ode/test_ode.py
pymc/tests/ode/test_utils.py
pymc/tests/step_methods/hmc/test_quadpotential.py
tests/distributions/test_timeseries.py
tests/gp/test_cov.py
tests/gp/test_gp.py
tests/gp/test_mean.py
tests/gp/test_util.py
tests/test_model.py
tests/test_model_graph.py
tests/ode/test_ode.py
tests/ode/test_utils.py
tests/step_methods/hmc/test_quadpotential.py

- |
pymc/tests/distributions/test_truncated.py
pymc/tests/logprob/test_abstract.py
pymc/tests/logprob/test_censoring.py
pymc/tests/logprob/test_composite_logprob.py
pymc/tests/logprob/test_cumsum.py
pymc/tests/logprob/test_joint_logprob.py
pymc/tests/logprob/test_mixture.py
pymc/tests/logprob/test_rewriting.py
pymc/tests/logprob/test_scan.py
pymc/tests/logprob/test_tensor.py
pymc/tests/logprob/test_transforms.py
pymc/tests/logprob/test_utils.py
tests/distributions/test_truncated.py
tests/logprob/test_abstract.py
tests/logprob/test_censoring.py
tests/logprob/test_composite_logprob.py
tests/logprob/test_cumsum.py
tests/logprob/test_joint_logprob.py
tests/logprob/test_mixture.py
tests/logprob/test_rewriting.py
tests/logprob/test_scan.py
tests/logprob/test_tensor.py
tests/logprob/test_transforms.py
tests/logprob/test_utils.py

fail-fast: false
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -165,10 +164,10 @@ jobs:
floatx: [float64]
python-version: ["3.8"]
test-subset:
- pymc/tests/variational/test_approximations.py pymc/tests/variational/test_callbacks.py pymc/tests/variational/test_inference.py pymc/tests/variational/test_opvi.py pymc/tests/test_initial_point.py
- pymc/tests/test_model.py pymc/tests/sampling/test_mcmc.py
- pymc/tests/gp/test_cov.py pymc/tests/gp/test_gp.py pymc/tests/gp/test_mean.py pymc/tests/gp/test_util.py pymc/tests/ode/test_ode.py pymc/tests/ode/test_utils.py pymc/tests/smc/test_smc.py pymc/tests/sampling/test_parallel.py
- pymc/tests/step_methods/test_metropolis.py pymc/tests/step_methods/test_slicer.py pymc/tests/step_methods/hmc/test_nuts.py pymc/tests/step_methods/test_compound.py pymc/tests/step_methods/hmc/test_hmc.py
- tests/variational/test_approximations.py tests/variational/test_callbacks.py tests/variational/test_inference.py tests/variational/test_opvi.py tests/test_initial_point.py
- tests/test_model.py tests/sampling/test_mcmc.py
- tests/gp/test_cov.py tests/gp/test_gp.py tests/gp/test_mean.py tests/gp/test_util.py tests/ode/test_ode.py tests/ode/test_utils.py tests/smc/test_smc.py tests/sampling/test_parallel.py
- tests/step_methods/test_metropolis.py tests/step_methods/test_slicer.py tests/step_methods/hmc/test_nuts.py tests/step_methods/test_compound.py tests/step_methods/hmc/test_hmc.py

fail-fast: false
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -239,16 +238,16 @@ jobs:
python-version: ["3.9"]
test-subset:
- |
pymc/tests/sampling/test_parallel.py
pymc/tests/test_data.py
pymc/tests/test_model.py
tests/sampling/test_parallel.py
tests/test_data.py
tests/test_model.py

- |
pymc/tests/sampling/test_mcmc.py
tests/sampling/test_mcmc.py

- |
pymc/tests/backends/test_arviz.py
pymc/tests/variational/test_updates.py
tests/backends/test_arviz.py
tests/variational/test_updates.py
fail-fast: false
runs-on: ${{ matrix.os }}
env:
Expand Down Expand Up @@ -306,14 +305,14 @@ jobs:
env_vars: TEST_SUBSET
name: ${{ matrix.os }} ${{ matrix.floatx }}
fail_ci_if_error: false
jax:
external_samplers:
strategy:
matrix:
os: [ubuntu-20.04]
floatx: [float64]
python-version: ["3.9"]
test-subset:
- pymc/tests/sampling/test_jax.py
- tests/sampling/test_jax.py tests/sampling/test_mcmc_external.py
fail-fast: false
runs-on: ${{ matrix.os }}
env:
Expand Down Expand Up @@ -361,9 +360,10 @@ jobs:
conda activate pymc-test
pip install -e .
python --version
- name: Install jax specific dependencies
- name: Install external samplers
run: |
conda activate pymc-test
conda install -c conda-forge nutpie
pip install "numpyro>=0.8.0"
pip install git+https://github.com/blackjax-devs/blackjax.git@0.7.0
- name: Run tests
Expand All @@ -383,7 +383,7 @@ jobs:
floatx: [float32]
python-version: ["3.10"]
test-subset:
- pymc/tests/sampling/test_mcmc.py pymc/tests/ode/test_ode.py pymc/tests/ode/test_utils.py
- tests/sampling/test_mcmc.py tests/ode/test_ode.py tests/ode/test_utils.py
fail-fast: false
runs-on: ${{ matrix.os }}
env:
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ repos:
- id: pyupgrade
args: [--py37-plus]
- repo: https://github.com/psf/black
rev: 22.12.0
rev: 23.1.0
hooks:
- id: black
- id: black-jupyter
- repo: https://github.com/PyCQA/pylint
rev: v2.16.0b1
rev: v2.16.2
hooks:
- id: pylint
args: [--rcfile=.pylintrc]
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ python:
path: .

conda:
environment: "conda-envs/environment-dev.yml"
environment: "conda-envs/environment-docs.yml"

build:
os: "ubuntu-20.04"
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
recursive-include pymc/tests/data *
recursive-include tests/data *
recursive-include source *
# because of an upload-size limit by PyPI, we're temporarily removing docs from the tarball:
recursive-exclude docs *
Expand Down
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ clean:
rm -rf $(SOURCEDIR)/api/generated
rm -rf $(SOURCEDIR)/api/**/generated
rm -rf $(SOURCEDIR)/api/**/classmethods
rm -rf $(SOURCEDIR)/contributing/private_api/generated
rm -rf $(SOURCEDIR)/contributing/private_api/**/generated
rm -rf $(SOURCEDIR)/contributing/private_api/**/classmethods
rm -rf docs/jupyter_execute

html:
Expand Down
2 changes: 1 addition & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ coverage:
base: auto

ignore:
- "pymc/tests/*"
- "tests/*"
- "pymc/_version.py"

comment:
Expand Down
35 changes: 35 additions & 0 deletions conda-envs/environment-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# "dev" conda envs are to be used by devs in setting their local environments
name: pymc-docs
channels:
- conda-forge
- defaults
dependencies:
# Base dependencies
- arviz>=0.13.0
- cachetools>=4.2.1
- cloudpickle
- fastprogress>=0.2.0
- numpy>=1.15.0
- pandas>=0.24.0
- pip
- pytensor=2.9.1
- python-graphviz
- scipy>=1.4.1
- typing-extensions>=3.7.4
# Extra dependencies for docs build
- ipython>=7.16
- jax
- jupyter-sphinx
- myst-nb
- numpydoc
- pre-commit>=2.8.0
- sphinx-copybutton
- sphinx-design
- sphinx-notfound-page
- sphinx>=1.5
- sphinxext-rediraffe
- watermark
- sphinx-remove-toctrees
- pip:
- git+https://github.com/pymc-devs/pymc-sphinx-theme
- numdifftools>=0.9.40
1 change: 0 additions & 1 deletion docs/source/api/backends.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@ Internal structures
:toctree: generated/

NDArray
point_list_to_multitrace
base.BaseTrace
base.MultiTrace
1 change: 0 additions & 1 deletion docs/source/api/data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ Data
Data
GeneratorAdapter
Minibatch
align_minibatches
2 changes: 0 additions & 2 deletions docs/source/api/distributions/simulator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@ Simulator
.. autosummary::
:toctree: generated

SimulatorRV
Simulator
KullbackLiebler
1 change: 0 additions & 1 deletion docs/source/api/distributions/timeseries.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Timeseries
.. autosummary::
:toctree: generated

AR1
AR
GaussianRandomWalk
GARCH11
Expand Down
2 changes: 0 additions & 2 deletions docs/source/api/distributions/transforms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ Transform instances are the entities that should be used in the
simplex
logodds
log_exp_m1
ordered_univariate
ordered_multivariate
log
sum_to_1
circular
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/math.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Functions exposed in pymc.math
where
and_
or_
abs_
abs
exp
log
cos
Expand Down
4 changes: 1 addition & 3 deletions docs/source/api/pytensorf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,4 @@ PyTensor utils
join_nonshared_inputs
make_shared_replacements
generator
set_at_rng
at_rng
pandas_to_array
convert_observed_data
1 change: 0 additions & 1 deletion docs/source/api/samplers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ This submodule contains functions for MCMC and forward sampling.
sample_posterior_predictive_w
sampling.jax.sample_blackjax_nuts
sampling.jax.sample_numpyro_nuts
iter_sample
init_nuts
draw

Expand Down
2 changes: 0 additions & 2 deletions docs/source/api/vi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Variational Inference

ADVI
ASVGD
NFVI
SVGD
FullRankADVI
ImplicitGradient
Expand All @@ -26,7 +25,6 @@ Approximations
Empirical
FullRank
MeanField
NormalizingFlow
sample_approx

OPVI
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = "en"

# configure notfound extension to not add any prefix to the urls
notfound_urls_prefix = "/projects/docs/en/latest/"
Expand Down
Loading