Skip to content

Commit

Permalink
remove warnings on init (#771)
Browse files Browse the repository at this point in the history
  • Loading branch information
wd60622 authored Jun 22, 2024
1 parent eba67dc commit 3fc7caf
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions pymc_marketing/mmm/delayed_saturated_mmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,11 +426,6 @@ def build_model(
)
):
if self.model_config["gamma_control"].get("dims") != "control":
msg = (
"The 'dims' key in gamma_control must be 'control'."
" This will be fixed automatically."
)
warnings.warn(msg, stacklevel=2)
self.model_config["gamma_control"]["dims"] = "control"

gamma_control = create_distribution_from_config(
Expand Down Expand Up @@ -470,11 +465,6 @@ def build_model(
)

if self.model_config["gamma_fourier"].get("dims") != "fourier_mode":
msg = (
"The 'dims' key in gamma_fourier must be 'fourier_mode'."
" This will be fixed automatically."
)
warnings.warn(msg, stacklevel=2)
self.model_config["gamma_fourier"]["dims"] = "fourier_mode"

gamma_fourier = create_distribution_from_config(
Expand Down Expand Up @@ -548,14 +538,8 @@ def default_model_config(self) -> dict:
}

for media_transform in [self.adstock, self.saturation]:
for param, config in media_transform.function_priors.items():
for config in media_transform.function_priors.values():

Check warning on line 541 in pymc_marketing/mmm/delayed_saturated_mmm.py

View check run for this annotation

Codecov / codecov/patch

pymc_marketing/mmm/delayed_saturated_mmm.py#L541

Added line #L541 was not covered by tests
if "dims" not in config:
msg = (
f"{param} doesn't have a 'dims' key in config. Setting to channel."
f" Set priors explicitly in {media_transform.__class__.__name__}"
" to avoid this warning."
)
warnings.warn(msg, stacklevel=2)
config["dims"] = "channel"

return {
Expand Down

0 comments on commit 3fc7caf

Please sign in to comment.