diff --git a/conda-envs/environment-dev-py37.yml b/conda-envs/environment-dev-py37.yml index c944732928..2c6bf43a78 100644 --- a/conda-envs/environment-dev-py37.yml +++ b/conda-envs/environment-dev-py37.yml @@ -7,7 +7,7 @@ dependencies: - ipython>=7.16 - libblas=*=*mkl - mkl-service -- nbsphinx>=0.4 +- myst-nb - numpy=1.15 - numpydoc>=0.9 - pandas=0.24 @@ -16,7 +16,6 @@ dependencies: - pytest>=3.0 - python-graphviz - python=3.7 -- recommonmark>=0.4 - scipy=1.2 - sphinx-autobuild>=0.7 - sphinx>=1.5 diff --git a/conda-envs/environment-dev-py38.yml b/conda-envs/environment-dev-py38.yml index 24e9040cb3..d01e58a530 100644 --- a/conda-envs/environment-dev-py38.yml +++ b/conda-envs/environment-dev-py38.yml @@ -7,14 +7,13 @@ dependencies: - ipython>=7.16 - libblas=*=*mkl - mkl-service -- nbsphinx>=0.4 +- myst-nb - numpydoc>=0.9 - pre-commit>=2.8.0 - pytest-cov>=2.5 - pytest>=3.0 - python-graphviz - python=3.8 -- recommonmark>=0.4 - sphinx-autobuild>=0.7 - sphinx>=1.5 - watermark diff --git a/conda-envs/environment-dev-py39.yml b/conda-envs/environment-dev-py39.yml index 6f6db58e67..59d093edc5 100644 --- a/conda-envs/environment-dev-py39.yml +++ b/conda-envs/environment-dev-py39.yml @@ -7,14 +7,13 @@ dependencies: - ipython>=7.16 - libblas=*=*mkl - mkl-service -- nbsphinx>=0.4 +- myst-nb - numpydoc>=0.9 - pre-commit>=2.8.0 - pytest-cov>=2.5 - pytest>=3.0 - python-graphviz - python=3.9 -- recommonmark>=0.4 - sphinx-autobuild>=0.7 - sphinx>=1.5 - watermark diff --git a/docs/source/conf.py b/docs/source/conf.py index 0b7d3a1cc2..be3ece6758 100755 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,3 +1,7 @@ +""" Sphinx configuration file. + + isort:skip_file +""" #!/usr/bin/env python3 # # pymc3 documentation build configuration file, created by @@ -15,13 +19,13 @@ import os import sys -import pymc3 # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath(os.path.join("..", ".."))) sys.path.insert(0, os.path.abspath("sphinxext")) +import pymc3 # isort:skip # -- General configuration ------------------------------------------------ @@ -37,14 +41,13 @@ "sphinx.ext.autosummary", "sphinx.ext.mathjax", "sphinx.ext.intersphinx", - "nbsphinx", "numpydoc", "IPython.sphinxext.ipython_console_highlighting", "IPython.sphinxext.ipython_directive", "sphinx.ext.autosectionlabel", "sphinx.ext.napoleon", "gallery_generator", - "recommonmark", + "myst_nb", ] # Don't auto-generate summary for class members. @@ -72,8 +75,8 @@ # General information about the project. project = "PyMC3" -copyright = "2018, The PyMC Development Team" -author = "PyMC developers" +copyright = "2021, The PyMC Development Team" +author = "PyMC contributors" # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -101,7 +104,7 @@ # directories to ignore when looking for source files. exclude_patterns = ["_build", "**.ipynb_checkpoints"] -nbsphinx_execute = "never" +jupyter_execute_notebooks = "off" # The reST default role (used for this markup: `text`) to use for all # documents. diff --git a/fast_build_docs.sh b/fast_build_docs.sh index ec1f97a199..4030f4d9f2 100755 --- a/fast_build_docs.sh +++ b/fast_build_docs.sh @@ -1,6 +1,6 @@ #!/bin/bash -git --git-dir=docs/source/pymc-examples/.git --work-tree=docs/source/pymc-examples checkout fast-docs-build +git --git-dir=docs/source/pymc-examples/.git --work-tree=docs/source/pymc-examples checkout main pushd docs/source make clean make html diff --git a/pymc3/distributions/multivariate.py b/pymc3/distributions/multivariate.py index 7cea4a90e2..c1160ba764 100644 --- a/pymc3/distributions/multivariate.py +++ b/pymc3/distributions/multivariate.py @@ -531,7 +531,7 @@ class DirichletMultinomial(Discrete): .. math:: - f(x \mid n, a) = \frac{\Gamma(n + 1)\Gamma(\sum a_k)} + f(x \mid n, a) = \frac{\Gamma(n + 1)\Gamma(\sum a_k)} {\Gamma(\n + \sum a_k)} \prod_{k=1}^K \frac{\Gamma(x_k + a_k)} diff --git a/pymc3/distributions/timeseries.py b/pymc3/distributions/timeseries.py index 0c72550387..27cafe5529 100644 --- a/pymc3/distributions/timeseries.py +++ b/pymc3/distributions/timeseries.py @@ -486,6 +486,7 @@ def random(self, point=None, size=None): Examples ------- + .. code-block:: python with pm.Model(): @@ -502,6 +503,7 @@ def random(self, point=None, size=None): # draw four samples from a 2-dimensional Gaussian random walk with 10 timesteps, # indexed with a (2, 2) array sample = MvGaussianRandomWalk(mu, cov, shape=(10, 2)).random(size=(2, 2)) + """ # for each draw specified by the size input, we need to draw time_steps many diff --git a/pymc3/math.py b/pymc3/math.py index 918c1c62ea..0765b1a7da 100644 --- a/pymc3/math.py +++ b/pymc3/math.py @@ -241,10 +241,9 @@ def log1mexp(x): https://cran.r-project.org/web/packages/Rmpfr/vignettes/log1mexp-note.pdf References - ---------- - .. [Machler2012] Martin Mächler (2012). - "Accurately computing `\log(1-\exp(- \mid a \mid))` Assessed by the Rmpfr - package" + ---------- + .. [Machler2012] Martin Mächler (2012). + "Accurately computing `\log(1-\exp(- \mid a \mid))` Assessed by the Rmpfr package" """ return at.switch(at.lt(x, 0.6931471805599453), at.log(-at.expm1(-x)), at.log1p(-at.exp(-x))) diff --git a/requirements-dev.txt b/requirements-dev.txt index ec92f04f0d..483625d741 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,12 +3,11 @@ h5py>=2.7 ipython>=7.16 -nbsphinx>=0.4 +myst-nb numpydoc>=0.9 pre-commit>=2.8.0 pytest-cov>=2.5 pytest>=3.0 -recommonmark>=0.4 sphinx-autobuild>=0.7 sphinx>=1.5 watermark