diff --git a/pymc/sampling/mcmc.py b/pymc/sampling/mcmc.py index 7cbd2da98a..f05fcc2dd0 100644 --- a/pymc/sampling/mcmc.py +++ b/pymc/sampling/mcmc.py @@ -630,10 +630,7 @@ def sample( else: kwargs["nuts"] = {"target_accept": kwargs.pop("target_accept")} if isinstance(trace, list): - raise DeprecationWarning( - "We have removed support for partial traces because it simplified things." - " Please open an issue if & why this is a problem for you." - ) + raise ValueError("Please use `var_names` keyword argument for partial traces.") model = modelcontext(model) if not model.free_RVs: diff --git a/tests/sampling/test_mcmc.py b/tests/sampling/test_mcmc.py index 647e8ada70..8611a7028b 100644 --- a/tests/sampling/test_mcmc.py +++ b/tests/sampling/test_mcmc.py @@ -507,11 +507,11 @@ def test_empty_model(): error.match("any free variables") -def test_partial_trace_unsupported(): +def test_partial_trace_with_trace_unsupported(): with pm.Model() as model: a = pm.Normal("a", mu=0, sigma=1) b = pm.Normal("b", mu=0, sigma=1) - with pytest.raises(DeprecationWarning, match="removed support"): + with pytest.raises(ValueError, match="var_names"): pm.sample(trace=[a])