Skip to content

Commit

Permalink
start adding links to api docs (#2081)
Browse files Browse the repository at this point in the history
* start adding links to api docs

* addressed review comments

* added python to intersphinx

* added space formatting in line 72 and 77

* space formatting in line 60,71,73,75

* space formatting changes

* space foramtting changes

* space formatting changes were added to links

* modified line 62

* modified autocorrplot

* modified line 59

* modified line 63

* changed the parameter type to docstring format

* removed the redundant word object in InferenceData object

* changed line 65 from type hints to docstring

* included space in the before an argument type

* added space after an argument name just before the colon

* included space after argument name just before the colon

* added space after aegument name and before argument type

* rectified the chnages suggested im autcorrplot

* made changes to 86,101 and 127

* updated the compareplot

* updated densityplot

* distcomaprisonplot updated

* add two additional elelements to to numpydocs aliases

* changed labeller arguement's capitalisation

* edited lumpyplot and mcseplot

* edited kdeplot,khatplot and implot by adding necessary formatting and edits yo argument descriptions

* made links clickable in forestplot

* edited labeller description and addressed space formatting in essplot

* added the 'ax' description in dotplot

* edited an 'ax' description

* effected suggested changes

* effected suggested changes

* fix conf.py and a handful of parameters

* remove type-hints from function signature

* black

* update bokeh figure alias

Co-authored-by: Oriol (ZBook) <oriol.abril.pla@gmail.com>
  • Loading branch information
dameeolawuyi and OriolAbril committed Nov 29, 2022
1 parent 1700a3f commit 4834f3b
Show file tree
Hide file tree
Showing 17 changed files with 216 additions and 200 deletions.
28 changes: 14 additions & 14 deletions arviz/plots/autocorrplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,53 +29,53 @@ def plot_autocorr(
Parameters
----------
data: obj
data : InferenceData
Any object that can be converted to an :class:`arviz.InferenceData` object
refer to documentation of :func:`arviz.convert_to_dataset` for details
var_names: list of variable names, optional
var_names : list of str, optional
Variables to be plotted, if None all variables are plotted. Prefix the
variables by ``~`` when you want to exclude them from the plot. Vector-value
stochastics are handled automatically.
filter_vars: {None, "like", "regex"}, optional, default=None
filter_vars : {None, "like", "regex"}, default=None
If `None` (default), interpret var_names as the real variables names. If "like",
interpret var_names as substrings of the real variables names. If "regex",
interpret var_names as regular expressions on the real variables names. A la
``pandas.filter``.
max_lag: int, optional
max_lag : int, optional
Maximum lag to calculate autocorrelation. Defaults to 100 or num draws,
whichever is smaller.
combined: bool, default=False
combined : bool, default=False
Flag for combining multiple chains into a single chain. If False, chains will be
plotted separately.
grid : tuple
Number of rows and columns. Defaults to None, the rows and columns are
automatically inferred.
figsize: tuple
figsize : (float, float), optional
Figure size. If None it will be defined automatically.
Note this is not used if ``ax`` is supplied.
textsize: float
textsize : float
Text size scaling factor for labels, titles and lines. If None it will be autoscaled based
on ``figsize``.
labeller : labeller instance, optional
labeller : Labeller, optional
Class providing the method ``make_label_vert`` to generate the labels in the plot titles.
Read the :ref:`label_guide` for more details and usage examples.
ax: numpy array-like of matplotlib axes or bokeh figures, optional
ax : 2D array-like of matplotlib_axes or bokeh_figure, optional
A 2D array of locations into which to plot the densities. If not supplied, Arviz will create
its own array of plot areas (and return it).
backend: str, optional
backend : str, optional
Select plotting backend {"matplotlib","bokeh"}. Default "matplotlib".
backend_config: dict, optional
backend_config : dict, optional
Currently specifies the bounds to use for bokeh axes. Defaults to value set in ``rcParams``.
backend_kwargs: dict, optional
backend_kwargs : dict, optional
These are kwargs specific to the backend being used, passed to
:func:`matplotlib.pyplot.subplots` or
:func:`bokeh.plotting.figure`.
show: bool, optional
show : bool, optional
Call backend show function.
Returns
-------
axes: matplotlib axes or bokeh figures
axes : matplotlib_axes or bokeh_figures
See Also
--------
Expand Down
62 changes: 31 additions & 31 deletions arviz/plots/bpvplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ def plot_bpv(
Parameters
----------
data : az.InferenceData object
data : InferenceData
:class:`arviz.InferenceData` object containing the observed and
posterior/prior predictive data.
kind : str
Type of plot to display ("p_value", "u_value", "t_stat"). Defaults to u_value.
kind : str, default "u_value"
Type of plot to display ("p_value", "u_value", "t_stat").
For "p_value" we compute p := p(y* ≤ y | y). This is the probability of the data y being
larger or equal than the predicted data y*. The ideal value is 0.5 (half the predictions
below and half above the data).
Expand All @@ -55,40 +55,40 @@ def plot_bpv(
pi = p(yi* r ≤ yi | y-i ), where y-i, is all other data except yi.
For "t_stat" we compute := p(T(y)* ≤ T(y) | y) where T is any test statistic. See t_stat
argument below for details of available options.
t_stat : str, float, or callable
t_stat : str, float, or callable, default "median"
Test statistics to compute from the observations and predictive distributions.
Allowed strings are "mean", "median" or "std". Defaults to "median".
Allowed strings are "mean", "median" or "std".
Alternative a quantile can be passed as a float (or str) in the
interval (0, 1). Finally a user defined function is also
acepted, see examples section for details.
bpv : bool
If True (default) add the Bayesian p_value to the legend when ``kind = t_stat``.
plot_mean : bool
Whether or not to plot the mean test statistic. Defaults to True.
reference : str
bpv : bool, default True
If True add the Bayesian p_value to the legend when ``kind = t_stat``.
plot_mean : bool, default True
Whether or not to plot the mean test statistic.
reference : str, default "analytical"
How to compute the distributions used as reference for u_values or p_values. Allowed values
are "analytical" (default) and "samples". Use `None` to do not plot any reference.
are "analytical" and "samples". Use `None` to do not plot any reference.
Defaults to "samples".
mse :bool
mse : bool, default False
Show scaled mean square error between uniform distribution and marginal p_value
distribution. Defaults to False.
n_ref : int, optional
Number of reference distributions to sample when ``reference=samples``. Defaults to 100.
hdi_prob: float, optional
distribution.
n_ref : int, default 100
Number of reference distributions to sample when ``reference=samples``.
hdi_prob : float, optional
Probability for the highest density interval for the analytical reference distribution when
computing u_values. Should be in the interval (0, 1]. Defaults to
0.94.
color : str
computing u_values. Should be in the interval (0, 1]. Defaults to the
rcParam ``stats.hdi_prob``.
color : str, optional
Matplotlib color
grid : tuple
grid : tuple, optional
Number of rows and columns. Defaults to None, the rows and columns are
automatically inferred.
figsize : tuple
figsize : (float, float), optional
Figure size. If None it will be defined automatically.
textsize : float
textsize : float, optional
Text size scaling factor for labels, titles and lines. If None it will be
autoscaled based on ``figsize``.
data_pairs : dict
data_pairs : dict, optional
Dictionary containing relations between observed data and posterior/prior predictive data.
Dictionary structure:
Expand All @@ -98,7 +98,7 @@ def plot_bpv(
For example, ``data_pairs = {'y' : 'y_hat'}``
If None, it will assume that the observed data and the posterior/prior
predictive data have the same variable name.
labeller : labeller instance, optional
Labeller : Labeller, optional
Class providing the method ``make_pp_label`` to generate the labels in the plot titles.
Read the :ref:`label_guide` for more details and usage examples.
var_names : list of variable names
Expand All @@ -109,22 +109,22 @@ def plot_bpv(
interpret var_names as substrings of the real variables names. If "regex",
interpret var_names as regular expressions on the real variables names. A la
``pandas.filter``.
coords : dict
coords : dict, optional
Dictionary mapping dimensions to selected coordinates to be plotted.
Dimensions without a mapping specified will include all coordinates for
that dimension. Defaults to including all coordinates for all
dimensions if None.
flatten : list
flatten : list, optional
List of dimensions to flatten in observed_data. Only flattens across the coordinates
specified in the coords argument. Defaults to flattening all of the dimensions.
flatten_pp : list
flatten_pp : list, optional
List of dimensions to flatten in posterior_predictive/prior_predictive. Only flattens
across the coordinates specified in the coords argument. Defaults to flattening all
of the dimensions. Dimensions should match flatten excluding dimensions for data_pairs
parameters. If flatten is defined and flatten_pp is None, then ``flatten_pp=flatten``.
legend : bool
Add legend to figure. By default True.
ax : numpy array-like of matplotlib axes or bokeh figures, optional
legend : bool, default True
Add legend to figure.
ax : 2D array-like of matplotlib_axes or bokeh_figure, optional
A 2D array of locations into which to plot the densities. If not supplied, Arviz will create
its own array of plot areas (and return it).
backend : str, optional
Expand All @@ -147,7 +147,7 @@ def plot_bpv(
Returns
-------
axes: matplotlib axes or bokeh figures
axes : 2D ndarray of matplotlib_axes or bokeh_figure
See Also
--------
Expand Down
24 changes: 12 additions & 12 deletions arviz/plots/compareplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def plot_compare(
Parameters
----------
comp_df : pd.DataFrame
comp_df : pandas.DataFrame
Result of the :func:`arviz.compare` method
insample_dev : bool, optional
Plot in-sample ELPD, that is the value of the information criteria without the
Expand All @@ -51,28 +51,28 @@ def plot_compare(
and the top-ranked model. Defaults to True
order_by_rank : bool
If True (default) ensure the best model is used as reference.
legend : bool
Add legend to figure. By default True.
figsize : tuple, optional
legend : bool, default True
Add legend to figure.
figsize : (float, float), optional
If None, size is (6, num of models) inches
title : bool:
title : bool
Show a tittle with a description of how to interpret the plot. Defaults to True.
textsize: float
textsize : float
Text size scaling factor for labels, titles and lines. If None it will be autoscaled based
on ``figsize``.
labeller : labeller instance, optional
labeller : Labeller, optional
Class providing the method ``model_name_to_str`` to generate the labels in
the plot.
Read the :ref:`label_guide` for more details and usage examples.
plot_kwargs : dict, optional
Optional arguments for plot elements. Currently accepts 'color_ic',
'marker_ic', 'color_insample_dev', 'marker_insample_dev', 'color_dse',
'marker_dse', 'ls_min_ic' 'color_ls_min_ic', 'fontsize'
ax: axes, optional
Matplotlib axes or bokeh figures.
backend: str, optional
ax : matplotlib_axes or bokeh_figure, optional
Matplotlib axes or bokeh figure.
backend : str, optional
Select plotting backend {"matplotlib","bokeh"}. Default "matplotlib".
backend_kwargs: bool, optional
backend_kwargs : bool, optional
These are kwargs specific to the backend being used, passed to
:func:`matplotlib.pyplot.subplots` or
:func:`bokeh.plotting.figure`.
Expand All @@ -81,7 +81,7 @@ def plot_compare(
Returns
-------
axes : matplotlib axes or bokeh figures
axes : matplotlib_axes or bokeh_figure
See Also
--------
Expand Down
34 changes: 17 additions & 17 deletions arviz/plots/densityplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,23 @@ def plot_density(
Parameters
----------
data : Union[Object, Iterator[Object]]
data : object or iterable of object
Any object that can be converted to an :class:`arviz.InferenceData` object, or an Iterator
returning a sequence of such objects.
Refer to documentation of :func:`arviz.convert_to_dataset` for details about such objects.
group: Optional[str]
group : str, optional
Specifies which :class:`arviz.InferenceData` group should be plotted.
Defaults to 'posterior'.
Alternative values include 'prior' and any other strings used as dataset keys in the
:class:`arviz.InferenceData`.
data_labels : Optional[List[str]]
data_labels : list of str, optional
List with names for the datasets passed as "data." Useful when plotting more than one
dataset. Must be the same shape as the data parameter. Defaults to None.
var_names: Optional[List[str]]
var_names : list of str, optional
List of variables to plot. If multiple datasets are supplied and var_names is not None,
will print the same set of variables for each dataset. Defaults to None, which results in
all the variables being plotted.
filter_vars: {None, "like", "regex"}, optional, default=None
filter_vars : {None, "like", "regex"}, default=None
If `None` (default), interpret var_names as the real variables names. If "like",
interpret var_names as substrings of the real variables names. If "regex",
interpret var_names as regular expressions on the real variables names. A la
Expand All @@ -73,10 +73,10 @@ def plot_density(
hdi_prob : float
Probability for the highest density interval. Should be in the interval (0, 1].
Defaults to 0.94.
point_estimate : Optional[str]
point_estimate : str, optional
Plot point estimate per variable. Values should be 'mean', 'median', 'mode' or None.
Defaults to 'auto' i.e. it falls back to default set in ``rcParams``.
colors : Optional[Union[List[str],str]]
colors : str or list of str, optional
List with valid matplotlib colors, one color per model. Alternative a string can be passed.
If the string is `cycle`, it will automatically choose a color per model from matplotlib's
cycle. If a single color is passed, e.g. 'k', 'C2' or 'red' this color will be used for all
Expand All @@ -86,36 +86,36 @@ def plot_density(
hdi_markers : str
A valid `matplotlib.markers` like 'v', used to indicate the limits of the highest density
interval. Defaults to empty string (no marker).
shade : Optional[float]
shade : float, optional
Alpha blending value for the shaded area under the curve, between 0 (no shade) and 1
(opaque). Defaults to 0.
bw: Optional[float or str]
bw : float or str, optional
If numeric, indicates the bandwidth and must be positive.
If str, indicates the method to estimate the bandwidth and must be
one of "scott", "silverman", "isj" or "experimental" when `circular` is False
and "taylor" (for now) when `circular` is True.
Defaults to "default" which means "experimental" when variable is not circular
and "taylor" when it is.
circular: Optional[bool]
circular : bool, optional
If True, it interprets the values passed are from a circular variable measured in radians
and a circular KDE is used. Only valid for 1D KDE. Defaults to False.
grid : tuple
Number of rows and columns. Defaults to None, the rows and columns are
automatically inferred.
figsize : Optional[Tuple[int, int]]
figsize : (float, float), optional
Figure size. If None it will be defined automatically.
textsize: Optional[float]
textsize : float, optional
Text size scaling factor for labels, titles and lines. If None it will be autoscaled based
on ``figsize``.
labeller : labeller instance, optional
labeller : Labeller, optional
Class providing the method ``make_label_vert`` to generate the labels in the plot titles.
Read the :ref:`label_guide` for more details and usage examples.
ax: numpy array-like of matplotlib axes or bokeh figures, optional
ax : 2D array-like of matplotlib_axes or bokeh_figure, optional
A 2D array of locations into which to plot the densities. If not supplied, Arviz will create
its own array of plot areas (and return it).
backend: str, optional
backend : str, optional
Select plotting backend {"matplotlib","bokeh"}. Default "matplotlib".
backend_kwargs: bool, optional
backend_kwargs : dict, optional
These are kwargs specific to the backend being used, passed to
:func:`matplotlib.pyplot.subplots` or :func:`bokeh.plotting.figure`.
For additional documentation check the plotting method of the backend.
Expand All @@ -124,7 +124,7 @@ def plot_density(
Returns
-------
axes : matplotlib axes or bokeh figures
axes : 2D ndarray of matplotlib_axes or bokeh_figure
See Also
--------
Expand Down

0 comments on commit 4834f3b

Please sign in to comment.