Skip to content

Commit

Permalink
Added deprecation warning for method keyword (#974)
Browse files Browse the repository at this point in the history
Co-authored-by: Will Dean <57733339+wd60622@users.noreply.github.com>
Co-authored-by: Juan Orduz <juanitorduz@gmail.com>
  • Loading branch information
3 people authored and twiecki committed Sep 10, 2024
1 parent 1fad294 commit 4150207
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pymc_marketing/mmm/mmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"""Media Mix Model class."""

import json
import warnings
from typing import Annotated, Any, Literal

import arviz as az
Expand Down Expand Up @@ -1701,6 +1702,7 @@ def plot_direct_contribution_curves(
channels: list[str] | None = None,
quantile_lower: float = 0.05,
quantile_upper: float = 0.95,
method: str | None = None,
) -> plt.Figure:
"""Plot the direct contribution curves for each marketing channel.
Expand All @@ -1717,6 +1719,8 @@ def plot_direct_contribution_curves(
A list of channels to plot. If not provided, all channels will be plotted.
same_axes : bool, optional
If True, all channels will be plotted on the same axes. Defaults to False.
method : str | None, optional
Deprecated.
Returns
-------
Expand All @@ -1726,6 +1730,13 @@ def plot_direct_contribution_curves(
"""
channels_to_plot = self.channel_columns if channels is None else channels

if method is not None:
warnings.warn(
"The 'method' keyword is deprecated and will be removed in a future version.",
DeprecationWarning,
stacklevel=2,
)

if not all(channel in self.channel_columns for channel in channels_to_plot):
unknown_channels = set(channels_to_plot) - set(self.channel_columns)
raise ValueError(
Expand Down

0 comments on commit 4150207

Please sign in to comment.