@@ -718,22 +718,24 @@ def test_sample_posterior_predictive_w(self):
718
718
mu = pm .Normal ("mu" , mu = 0 , sigma = 1 )
719
719
y = pm .Normal ("y" , mu = mu , sigma = 1 , observed = data0 )
720
720
trace_0 = pm .sample ()
721
+ idata_0 = az .from_pymc3 (trace_0 )
721
722
722
723
with pm .Model () as model_1 :
723
724
mu = pm .Normal ("mu" , mu = 0 , sigma = 1 , shape = len (data0 ))
724
725
y = pm .Normal ("y" , mu = mu , sigma = 1 , observed = data0 )
725
726
trace_1 = pm .sample ()
726
-
727
- traces = [trace_0 , trace_0 ]
728
- models = [model_0 , model_0 ]
729
- ppc = pm .sample_posterior_predictive_w (traces , 100 , models )
730
- assert ppc ["y" ].shape == (100 , 500 )
727
+ idata_1 = az .from_pymc3 (trace_1 )
731
728
732
729
traces = [trace_0 , trace_1 ]
730
+ idatas = [idata_0 , idata_1 ]
733
731
models = [model_0 , model_1 ]
732
+
734
733
ppc = pm .sample_posterior_predictive_w (traces , 100 , models )
735
734
assert ppc ["y" ].shape == (100 , 500 )
736
735
736
+ ppc = pm .sample_posterior_predictive_w (idatas , 100 , models )
737
+ assert ppc ["y" ].shape == (100 , 500 )
738
+
737
739
738
740
@pytest .mark .parametrize (
739
741
"method" ,
0 commit comments