Skip to content

Commit

Permalink
Revert "rename plot_cap and plot_comparison to plot_predictions and p…
Browse files Browse the repository at this point in the history
…lot_comparisons (#704)"

This reverts commit 5dde496.
  • Loading branch information
tomicapretto authored Aug 17, 2023
1 parent 5dde496 commit d35eb49
Show file tree
Hide file tree
Showing 8 changed files with 348 additions and 346 deletions.
11 changes: 2 additions & 9 deletions bambi/plots/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
from bambi.plots.effects import comparisons, predictions, slopes
from bambi.plots.plotting import plot_comparisons, plot_predictions, plot_slopes
from bambi.plots.plotting import plot_cap, plot_comparison, plot_slopes


__all__ = [
"comparisons",
"slopes",
"predictions",
"plot_comparisons",
"plot_predictions",
"plot_slopes",
]
__all__ = ["comparisons", "slopes", "predictions", "plot_cap", "plot_comparison", "plot_slopes"]
2 changes: 1 addition & 1 deletion bambi/plots/create_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def create_differences_data(
return _grid_level(condition_info, variable_info, user_passed, kind)


def create_predictions_data(model: Model, covariates: dict) -> pd.DataFrame:
def create_cap_data(model: Model, covariates: dict) -> pd.DataFrame:
"""Creates a data grid for conditional adjusted predictions using the covariates
passed by the user.
Expand Down
4 changes: 2 additions & 2 deletions bambi/plots/effects.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import xarray as xr

from bambi.models import Model
from bambi.plots.create_data import create_differences_data, create_predictions_data
from bambi.plots.create_data import create_cap_data, create_differences_data
from bambi.plots.utils import (
average_over,
ConditionalInfo,
Expand Down Expand Up @@ -478,7 +478,7 @@ def predictions(
if not 0 < prob < 1:
raise ValueError(f"'prob' must be greater than 0 and smaller than 1. It is {prob}.")

cap_data = create_predictions_data(model, covariates)
cap_data = create_cap_data(model, covariates)

if target != "mean":
component = model.components[target]
Expand Down
4 changes: 2 additions & 2 deletions bambi/plots/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def _plot_differences(
return fig, axes


def plot_predictions(
def plot_cap(
model: Model,
idata: az.InferenceData,
covariates: Union[str, list],
Expand Down Expand Up @@ -212,7 +212,7 @@ def plot_predictions(
return fig, axes


def plot_comparisons(
def plot_comparison(
model: Model,
idata: az.InferenceData,
contrast: Union[str, dict, list],
Expand Down
2 changes: 1 addition & 1 deletion docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ Examples
notebooks/distributional_models
notebooks/hsgp_1d
notebooks/hsgp_2d
notebooks/plot_predictions
notebooks/plot_cap
notebooks/plot_comparisons
notebooks/plot_slopes
175 changes: 71 additions & 104 deletions docs/notebooks/plot_predictions.ipynb → docs/notebooks/plot_cap.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit d35eb49

Please sign in to comment.