From a4c8f5b5752aa140805f1a4147019e0166b64555 Mon Sep 17 00:00:00 2001 From: CloudChaoszero Date: Sun, 17 Jan 2021 22:21:09 -0800 Subject: [PATCH] :pencil2: Minor docs notation for posterioplot function(s) --- docs/source/api/plots.rst | 7 +++---- pymc3/plots/__init__.py | 6 +++--- pymc3/plots/posteriorplot.py | 32 +++++++++++++++++++------------- 3 files changed, 25 insertions(+), 20 deletions(-) diff --git a/docs/source/api/plots.rst b/docs/source/api/plots.rst index 0089529f2d3..ff4f0762d98 100644 --- a/docs/source/api/plots.rst +++ b/docs/source/api/plots.rst @@ -10,8 +10,7 @@ library, a general purpose library for "exploratory analysis of Bayesian models." Refer to its documentation to use the plotting functions directly. -.. warning:: - The `plot_posterior_predictive_glm` function will removed in a future PyMC3 release. - Keep up to date with `ArviZ `_ for a future equivalent of `plot_posterior_predictive_glm`. +.. currentmodule:: pymc3.plots.posteriorplot -- :func:`pymc3.plot_posterior_predictive_glm ` +.. automodule:: pymc3.plots.posteriorplot + :members: diff --git a/pymc3/plots/__init__.py b/pymc3/plots/__init__.py index 9ea026dfbed..5923114cee3 100644 --- a/pymc3/plots/__init__.py +++ b/pymc3/plots/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021 The PyMC Developers +# Copyright 2020 The PyMC Developers # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,9 +15,9 @@ """PyMC3 Plotting. Plots are delegated to the `ArviZ `_ library, a general purpose library for -"exploratory analysis of Bayesian models." For more details, see https://arviz-devs.github.io/arviz/ +exploratory analysis of Bayesian models. For more details, see https://arviz-devs.github.io/arviz/. -Only the `plot_posterior_predictive_glm` is kept in the PyMC code base for now, but it'll will move to ArviZ once the latter adds features for regression plot. +Only `plot_posterior_predictive_glm` is kept in the PyMC code base for now, but it will move to ArviZ once the latter adds features for regression plots. """ import functools import sys diff --git a/pymc3/plots/posteriorplot.py b/pymc3/plots/posteriorplot.py index 5e34b5c57cb..f6ebb110db9 100644 --- a/pymc3/plots/posteriorplot.py +++ b/pymc3/plots/posteriorplot.py @@ -35,19 +35,25 @@ def plot_posterior_predictive_glm( **kwargs: Any ) -> None: """Plot posterior predictive of a linear model. - :Arguments: - trace: InferenceData or MultiTrace - Output of pm.sample() - eval: - Array over which to evaluate lm - lm: function - Function mapping parameters at different points - to their respective outputs. - input: point, sample - output: estimated value - samples: int - How many posterior samples to draw. - Additional keyword arguments are passed to pylab.plot(). + Parameters + ---------- + trace: InferenceData or MultiTrace + Output of pm.sample() + eval: + Array over which to evaluate lm + lm: function + Function mapping parameters at different points + to their respective outputs. + input: point, sample + output: estimated value + samples: int + How many posterior samples to draw. + kwargs : mapping, optional + Additional keyword arguments are passed to ``matplotlib.pyplot.plot()``. + + Warnings + -------- + The `plot_posterior_predictive_glm` function will removed in a future PyMC3 release. """ warnings.warn( "The `plot_posterior_predictive_glm` function will migrate to Arviz in a future release. "