Skip to content

Commit

Permalink
rename plot_cap and plot_comparison to plot_predictions and plot_comp…
Browse files Browse the repository at this point in the history
…arisons (#704)
  • Loading branch information
GStechschulte authored Aug 17, 2023
1 parent fcf8ab5 commit 5dde496
Show file tree
Hide file tree
Showing 8 changed files with 346 additions and 348 deletions.
11 changes: 9 additions & 2 deletions bambi/plots/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
from bambi.plots.effects import comparisons, predictions, slopes
from bambi.plots.plotting import plot_cap, plot_comparison, plot_slopes
from bambi.plots.plotting import plot_comparisons, plot_predictions, plot_slopes


__all__ = ["comparisons", "slopes", "predictions", "plot_cap", "plot_comparison", "plot_slopes"]
__all__ = [
"comparisons",
"slopes",
"predictions",
"plot_comparisons",
"plot_predictions",
"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_cap_data(model: Model, covariates: dict) -> pd.DataFrame:
def create_predictions_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_cap_data, create_differences_data
from bambi.plots.create_data import create_differences_data, create_predictions_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_cap_data(model, covariates)
cap_data = create_predictions_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_cap(
def plot_predictions(
model: Model,
idata: az.InferenceData,
covariates: Union[str, list],
Expand Down Expand Up @@ -212,7 +212,7 @@ def plot_cap(
return fig, axes


def plot_comparison(
def plot_comparisons(
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_cap
notebooks/plot_predictions
notebooks/plot_comparisons
notebooks/plot_slopes
Loading

0 comments on commit 5dde496

Please sign in to comment.