diff --git a/src/DynamicPPL.jl b/src/DynamicPPL.jl index df4628f6f..fffaa5967 100644 --- a/src/DynamicPPL.jl +++ b/src/DynamicPPL.jl @@ -129,12 +129,28 @@ export AbstractVarInfo, @submodel, value_iterator_from_chain, check_model, - check_model_and_trace + check_model_and_trace, + # Deprecated. + @logprob_str, + @prob_str # Reexport using Distributions: loglikelihood export loglikelihood +# TODO: Remove once we feel comfortable people aren't using it anymore. +macro logprob_str(str) + return :(error( + "The `@logprob_str` macro is no longer supported. See https://turinglang.org/dev/docs/using-turing/guide/#querying-probabilities-from-model-or-chain for information on how to query probabilities, and https://github.com/TuringLang/DynamicPPL.jl/issues/356 for information regarding its removal.", + )) +end + +macro prob_str(str) + return :(error( + "The `@prob_str` macro is no longer supported. See https://turinglang.org/dev/docs/using-turing/guide/#querying-probabilities-from-model-or-chain for information on how to query probabilities, and https://github.com/TuringLang/DynamicPPL.jl/issues/356 for information regarding its removal.", + )) +end + # Used here and overloaded in Turing function getspace end diff --git a/test/runtests.jl b/test/runtests.jl index 6bc12f294..aa0883708 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -71,6 +71,11 @@ include("test_util.jl") include("ad.jl") end + @testset "prob and logprob macro" begin + @test_throws ErrorException prob"..." + @test_throws ErrorException logprob"..." + end + @testset "doctests" begin DocMeta.setdocmeta!( DynamicPPL,