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

rename plotting function names #704

Merged
merged 1 commit into from
Aug 17, 2023
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
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
Loading