Skip to content

Commit b4ec399

Browse files
committed
Make installation optional
1 parent d38b4f1 commit b4ec399

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

README.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ Or via conda-forge:
7878

7979
conda install -c conda-forge pymc3
8080

81+
Plotting is done using `ArviZ <https://arviz-devs.github.io/arviz/>`__
82+
which may be installed separately, or along with PyMC3:
83+
84+
::
85+
86+
pip install pymc3[plots]
87+
8188
The current development branch of PyMC3 can be installed from GitHub, also using ``pip``:
8289

8390
::

pymc3/plots/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
"""PyMC3 Plotting.
2+
3+
Plots are delegated to the ArviZ library, a general purpose library for
4+
"exploratory analysis of Bayesian models." See https://arviz-devs.github.io/arviz/
5+
for details on plots.
6+
"""
17
try:
28
import arviz as az
39
except ImportError: # arviz is optional, throw exception when used
@@ -8,7 +14,7 @@ def __init__(self, attr):
814

915
def __call__(self, *args, **kwargs):
1016
raise ImportError(
11-
f"ArviZ is not installed. In order to use `{self.attr}`:\npip install arviz"
17+
"ArviZ is not installed. In order to use `{0.attr}`:\npip install arviz".format(self)
1218
)
1319

1420
class _ArviZ:

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
arviz
12
bokeh>=0.12.13
23
CommonMark==0.5.4
34
graphviz>=0.8.3
45
h5py>=2.7.0
56
ipython
67
Keras>=2.0.8
7-
matplotlib>=1.5.0
88
nbsphinx>=0.2.13
99
nose>=1.3.7
1010
nose-parameterized==0.6.0

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,8 @@ def get_version():
6060
include_package_data=True,
6161
classifiers=classifiers,
6262
install_requires=install_reqs,
63+
extras_require={
64+
"plots": ["arviz"],
65+
}
6366
tests_require=test_reqs,
6467
test_suite='nose.collector')

0 commit comments

Comments
 (0)