Skip to content

Commit 8962d6f

Browse files
committed
Raise NotImplementedError in sample_posterior_predictive_w
1 parent fd31103 commit 8962d6f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pymc/sampling.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2032,6 +2032,8 @@ def sample_posterior_predictive_w(
20322032
weighted models (default), or a dictionary with variable names as keys, and samples as
20332033
numpy arrays.
20342034
"""
2035+
raise NotImplementedError(f"sample_posterior_predictive_w has not yet been ported to PyMC 4.0.")
2036+
20352037
if isinstance(traces[0], InferenceData):
20362038
n_samples = [
20372039
trace.posterior.sizes["chain"] * trace.posterior.sizes["draw"] for trace in traces

pymc/tests/test_sampling.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -935,8 +935,10 @@ def test_deterministics_out_of_idata(self, multitrace):
935935
assert np.all(np.abs(ppc.posterior_predictive.c + 4) <= 0.1)
936936

937937

938+
@pytest.mark.xfail(
939+
reason="sample_posterior_predictive_w not refactored for v4", raises=NotImplementedError
940+
)
938941
class TestSamplePPCW(SeededTest):
939-
@pytest.mark.xfail(reason="sample_posterior_predictive_w not refactored for v4")
940942
def test_sample_posterior_predictive_w(self):
941943
data0 = np.random.normal(0, 1, size=50)
942944
warning_msg = "The number of samples is too small to check convergence reliably"
@@ -986,7 +988,6 @@ def test_sample_posterior_predictive_w(self):
986988
):
987989
pm.sample_posterior_predictive_w([trace_0, trace_2], 100, [model_0, model_2])
988990

989-
@pytest.mark.xfail(reason="sample_posterior_predictive_w not refactored for v4")
990991
def test_potentials_warning(self):
991992
warning_msg = "The effect of Potentials on other parameters is ignored during"
992993
with pm.Model() as m:

0 commit comments

Comments
 (0)