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 summary dictionary arguments #125

Merged
merged 2 commits into from
Feb 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions docs/source/api/managers.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
=============================================
Managers for facetting and aesthetics mapping
Managers for faceting and aesthetics mapping
=============================================
The classes in this module lay at the core of the library,
and are consequently available at the ``arviz_plots`` top level namespace.

They abstract all information regarding :term:`facetting` and :term:`aesthetic mapping`
They abstract all information regarding :term:`faceting` and :term:`aesthetic mapping`
in our :term:`chart` to prevent duplication and ensure coherence between
the different functions.

Expand Down Expand Up @@ -43,7 +43,7 @@ Attributes
PlotCollection.base_loop_dims
PlotCollection.data

Facetting and aesthetics mapping
faceting and aesthetics mapping
................................

.. autosummary::
Expand Down
2 changes: 1 addition & 1 deletion docs/source/gallery/distribution/plot_dist_ecdf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
# ECDF plot

Facetted ECDF plots for 1D marginals of the distribution
faceted ECDF plots for 1D marginals of the distribution

---

Expand Down
2 changes: 1 addition & 1 deletion docs/source/gallery/distribution/plot_dist_hist.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
# Histogram plot

Facetted histogram plots for 1D marginals of the distribution
faceted histogram plots for 1D marginals of the distribution

---

Expand Down
2 changes: 1 addition & 1 deletion docs/source/gallery/distribution/plot_dist_kde.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
# KDE plot

Facetted KDE plots for 1D marginals of the distribution
faceted KDE plots for 1D marginals of the distribution

---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
# ESS Evolution plot

Facetted plot with ESS 'bulk' and 'tail' for each variable
faceted plot with ESS 'bulk' and 'tail' for each variable

---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
# ESS Local plot

Facetted local ESS plot
faceted local ESS plot

---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
# ESS Quantile plot

Facetted quantile ESS plot
faceted quantile ESS plot

---

Expand Down
2 changes: 1 addition & 1 deletion docs/source/gallery/inference_diagnostics/plot_trace.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
# Trace plot

Facetted plot with MCMC traces for each variable
faceted plot with MCMC traces for each variable

---

Expand Down
9 changes: 6 additions & 3 deletions docs/source/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,19 @@ chart
plot
plots
Area (or areas) where the data will be plotted into. A {term}`chart`
can contain multiple {term}`facetted` plots.
can contain multiple {term}`faceted` plots.

artist
artists
Visual element added by `arviz-plots`

facetting
facetted
faceting
faceted
Generate multiple similar {term}`plot` elements with each of them
referring to a specific property or value of the data.

Faceting is the process of segmenting your plotting area into a grid of smaller plots, each of which shows a distinct subset of the data depending on one or more categorical factors.

:::

## Equivalences with library specific objects
Expand Down
172 changes: 111 additions & 61 deletions docs/source/tutorials/plots_intro.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/arviz_plots/backend/plotly/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def remove_row_col_from_doc(docstring):
class PlotlyPlot:
"""Custom class to represent a :term:`plot` in Plotly.

Plotly supports :term:`facetting` but it doesn't have any object that represents
Plotly supports :term:`faceting` but it doesn't have any object that represents
a :term:`plot`, instead, plotting happens only though the Plotly figure
(which represents the :term:`chart`) indicating the row and column indexes
in case plotting should happen to a single :term:`plot`.
Expand Down
10 changes: 5 additions & 5 deletions src/arviz_plots/plot_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def subset_da(da, sel):


def process_facet_dims(data, facet_dims):
"""Process facetting dimensions.
"""Process faceting dimensions.

It takes into account the ``__variable__`` "special dimension name" and helps find out
how many plots are needed.
Expand All @@ -87,7 +87,7 @@ def process_facet_dims(data, facet_dims):
missing_dims = {k: v for k, v in missing_dims.items() if v}
if any(missing_dims.values()):
raise ValueError(
"All variables must have all facetting dimensions, but found the following "
"All variables must have all faceting dimensions, but found the following "
f"dims to be missing in these variables: {missing_dims}"
)
n_facets = np.prod([data.sizes[dim] for dim in facet_dims])
Expand Down Expand Up @@ -369,7 +369,7 @@ def generate_aes_dt(self, aes=None, **kwargs):
Examples
--------
Initialize a `PlotCollection` with the rugby dataset as data.
Facetting and aesthetics mapping are independent. Thus, as
faceting and aesthetics mapping are independent. Thus, as
we are limiting ourselves to the use of this method, we can
provide an empty DataTree as ``viz_dt``.

Expand Down Expand Up @@ -641,7 +641,7 @@ def wrap(
it can also be combined with other dimensions.
col_wrap : int, default 4
Number of columns in the generated grid. If more than `col_wrap`
plots are needed from :term:`facetting` according to `cols`,
plots are needed from :term:`faceting` according to `cols`,
new rows are created.
backend : str, optional
Plotting backend.
Expand Down Expand Up @@ -959,7 +959,7 @@ def map(
applied exactly once per :term:`plot`. Defaults to the value of `data`.
coords : mapping, optional
Dictionary of {coordinate names : coordinate values} that should
be used to subset the aes, data and viz objects before any facetting
be used to subset the aes, data and viz objects before any faceting
or aesthetics mapping is applied.
ignore_aes : set, optional
Set of aesthetics present in ``aes`` that should be ignore for this
Expand Down
2 changes: 1 addition & 1 deletion src/arviz_plots/plots/distplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def plot_dist(
):
"""Plot 1D marginal densities in the style of John K. Kruschke’s book.

Generate :term:`facetted` :term:`plots` with: a graphical representation of 1D marginal
Generate :term:`faceted` :term:`plots` with: a graphical representation of 1D marginal
densities (as KDE, histogram, ECDF or dotplot), a credible interval and a point estimate.

Parameters
Expand Down
2 changes: 1 addition & 1 deletion src/arviz_plots/plots/essplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ def plot_ess(
**min_ess_kwargs,
)

# plot titles for each facetted subplot
# plot titles for each faceted subplot
title_kwargs = copy(plot_kwargs.get("title", {}))

if title_kwargs is not False:
Expand Down
2 changes: 1 addition & 1 deletion src/arviz_plots/plots/evolutionplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ def compute_ess_dataset(
**min_ess_kwargs,
)

# plot titles for each facetted subplot
# plot titles for each faceted subplot
title_kwargs = copy(plot_kwargs.get("title", {}))

if title_kwargs is not False:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_plot_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def dataset(seed=31):
@pytest.mark.parametrize("backend", ["matplotlib", "bokeh", "plotly"])
@pytest.mark.usefixtures("clean_plots")
@pytest.mark.usefixtures("check_skips")
class TestFacetting:
class Testfaceting:
def test_wrap(self, dataset, backend):
pc = PlotCollection.wrap(
dataset[["theta", "eta"]], backend=backend, cols=["hierarchy"], col_wrap=4
Expand Down