File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
pymc_marketing/mmm/builders Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 1616from __future__ import annotations
1717
1818import os
19+ import warnings
1920from collections .abc import Mapping
2021from pathlib import Path
2122from typing import Any
2425import yaml # type: ignore
2526
2627from pymc_marketing .mmm .builders .factories import build
28+ from pymc_marketing .mmm .multidimensional import MMM
2729from pymc_marketing .utils import from_netcdf
2830
2931
@@ -47,7 +49,7 @@ def build_mmm_from_yaml(
4749 * ,
4850 X : pd .DataFrame | None = None ,
4951 y : pd .DataFrame | None = None ,
50- ) -> Any :
52+ ) -> MMM :
5153 """
5254 Build an MMM model from *config_path*.
5355
@@ -67,7 +69,10 @@ def build_mmm_from_yaml(
6769
6870 # 1 ─────────────────────────────────── shell (no effects yet)
6971 model_config = cfg ["model" ]["kwargs" ] # Get model kwargs
70- model = build (cfg ["model" ])
72+
73+ with warnings .catch_warnings ():
74+ warnings .filterwarnings ("ignore" , category = DeprecationWarning )
75+ model = build (cfg ["model" ])
7176
7277 # 2 ──────────────────────────────── resolve covariates / target
7378 data_cfg : Mapping [str , Any ] = cfg .get ("data" , {})
Original file line number Diff line number Diff line change 1515Tests for the YAML builder module in pymc_marketing.mmm.builders.yaml.
1616"""
1717
18+ import warnings
1819from pathlib import Path
1920
2021import pandas as pd
2122import pytest
2223import xarray as xr
2324import yaml
2425
25- from pymc_marketing .mmm .builders .yaml import build_mmm_from_yaml
26+ with warnings .catch_warnings ():
27+ warnings .simplefilter ("ignore" , FutureWarning )
28+ from pymc_marketing .mmm .builders .yaml import build_mmm_from_yaml
29+
2630from pymc_marketing .model_config import ModelConfigError
2731
2832
You can’t perform that action at this time.
0 commit comments