Skip to content

Fix/replace deprecated budget method #1604

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
6 changes: 1 addition & 5 deletions tests/mmm/test_mmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,21 +571,17 @@ def test_allocate_budget_to_maximize_response_bad_noise_level(
) -> None:
budget = 2.0
num_periods = 8
time_granularity = "weekly"
budget_bounds = optimizer_xarray_builder(
value=[[0.5, 1.2], [0.5, 1.5]],
channel=["channel_1", "channel_2"],
bound=["lower", "upper"],
)
noise_level = "bad_noise_level"

with pytest.raises(ValueError, match="noise_level must be a float"):
mmm_fitted.allocate_budget_to_maximize_response(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, reading this better. Here we are doing the wrong fix. We should:

  1. Replace all the suite (not only this test) to work with the new class.
  2. We need to test the same scenarios, meaning, you need to test optimize budget and sample_response_distribution
  3. No parameters should be delete, the test should be handle differently.
  4. We need test for the method to be deprecated, and the new one. This because we still will hold the old method for at least one more release. So, best way should be to have test for both, and be sure non of them is doing something funny. IF we don't want to do this then we should deprecated already the old method. @williambdean Whats your take?

mmm_fitted.optimize_budget(
budget=budget,
time_granularity=time_granularity,
num_periods=num_periods,
budget_bounds=budget_bounds,
noise_level=noise_level,
)

@pytest.mark.parametrize(
Expand Down
Loading