@@ -1132,9 +1132,26 @@ def test_transfer_function_bayesian_adstock_only(mock_pymc_sample):
11321132 assert isinstance (fig , plt .Figure )
11331133 assert len (ax ) == 2 # Should have 2 subplots
11341134
1135+ # Test plot_transforms (Bayesian-specific path)
1136+ fig_trans , ax_trans = result .plot_transforms ()
1137+ assert isinstance (fig_trans , plt .Figure )
1138+ assert len (ax_trans ) >= 1 # Should have at least 1 panel (adstock)
1139+
11351140 # Test summary (should not raise)
11361141 result .summary ()
11371142
1143+ # Test effect() method (Bayesian-specific path)
1144+ effect_result = result .effect (
1145+ window = (df .index [0 ], df .index [- 1 ]), channels = ["treatment" ], scale = 0.0
1146+ )
1147+ assert "effect_df" in effect_result
1148+ assert "total_effect" in effect_result
1149+
1150+ # Test plot_effect() (Bayesian-specific path)
1151+ fig_eff , ax_eff = result .plot_effect (effect_result )
1152+ assert isinstance (fig_eff , plt .Figure )
1153+ assert len (ax_eff ) == 2
1154+
11381155 # Test that half_life posterior is reasonable (should be positive)
11391156 half_life_samples = az .extract (result .model .idata , var_names = ["half_life" ])
11401157 assert (half_life_samples > 0 ).all (), "Half-life should be positive"
@@ -1251,9 +1268,26 @@ def test_transfer_function_ar_bayesian(mock_pymc_sample):
12511268 assert isinstance (fig , plt .Figure )
12521269 assert len (ax ) == 2 # Should have 2 subplots
12531270
1271+ # Test plot_transforms (Bayesian-specific path)
1272+ fig_trans , ax_trans = result .plot_transforms ()
1273+ assert isinstance (fig_trans , plt .Figure )
1274+ assert len (ax_trans ) >= 1 # Should have at least 1 panel (adstock)
1275+
12541276 # Test summary (should not raise)
12551277 result .summary ()
12561278
1279+ # Test effect() method (Bayesian-specific path)
1280+ effect_result = result .effect (
1281+ window = (df .index [0 ], df .index [- 1 ]), channels = ["treatment" ], scale = 0.0
1282+ )
1283+ assert "effect_df" in effect_result
1284+ assert "total_effect" in effect_result
1285+
1286+ # Test plot_effect() (Bayesian-specific path)
1287+ fig_eff , ax_eff = result .plot_effect (effect_result )
1288+ assert isinstance (fig_eff , plt .Figure )
1289+ assert len (ax_eff ) == 2
1290+
12571291 # Test that half_life posterior is reasonable (should be positive)
12581292 half_life_samples = az .extract (result .model .idata , var_names = ["half_life" ])
12591293 assert (half_life_samples > 0 ).all (), "Half-life should be positive"
0 commit comments