diff --git a/HISTORY.md b/HISTORY.md index 1e1705cff..fd3e1c106 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,9 @@ # DynamicPPL Changelog +## 0.38.6 + +Renamed keyword argument `only_ddpl` to `only_dppl` for `Experimental.is_suitable_varinfo`. + ## 0.38.5 Improve performance of VarNamedVector, mostly by changing how it handles contiguification. diff --git a/Project.toml b/Project.toml index 0ee50d493..8ced1d425 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "DynamicPPL" uuid = "366bfd00-2699-11ea-058f-f148b4cae6d8" -version = "0.38.5" +version = "0.38.6" [deps] ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b" diff --git a/ext/DynamicPPLJETExt.jl b/ext/DynamicPPLJETExt.jl index e0163bb35..cb35c5ffb 100644 --- a/ext/DynamicPPLJETExt.jl +++ b/ext/DynamicPPLJETExt.jl @@ -4,12 +4,12 @@ using DynamicPPL: DynamicPPL using JET: JET function DynamicPPL.Experimental.is_suitable_varinfo( - model::DynamicPPL.Model, varinfo::DynamicPPL.AbstractVarInfo; only_ddpl::Bool=true + model::DynamicPPL.Model, varinfo::DynamicPPL.AbstractVarInfo; only_dppl::Bool=true ) f, argtypes = DynamicPPL.DebugUtils.gen_evaluator_call_with_types(model, varinfo) # If specified, we only check errors originating somewhere in the DynamicPPL.jl. # This way we don't just fall back to untyped if the user's code is the issue. - result = if only_ddpl + result = if only_dppl JET.report_call(f, argtypes; target_modules=(JET.AnyFrameModule(DynamicPPL),)) else JET.report_call(f, argtypes) @@ -18,7 +18,7 @@ function DynamicPPL.Experimental.is_suitable_varinfo( end function DynamicPPL.Experimental._determine_varinfo_jet( - model::DynamicPPL.Model; only_ddpl::Bool=true + model::DynamicPPL.Model; only_dppl::Bool=true ) # Generate a typed varinfo to test model type stability with varinfo = DynamicPPL.typed_varinfo(model) @@ -26,7 +26,7 @@ function DynamicPPL.Experimental._determine_varinfo_jet( # Check type stability of evaluation (i.e. DefaultContext) model = DynamicPPL.setleafcontext(model, DynamicPPL.DefaultContext()) eval_issuccess, eval_result = DynamicPPL.Experimental.is_suitable_varinfo( - model, varinfo; only_ddpl + model, varinfo; only_dppl ) if !eval_issuccess @debug "Evaluation with typed varinfo failed with the following issues:" @@ -36,7 +36,7 @@ function DynamicPPL.Experimental._determine_varinfo_jet( # Check type stability of initialisation (i.e. InitContext) model = DynamicPPL.setleafcontext(model, DynamicPPL.InitContext()) init_issuccess, init_result = DynamicPPL.Experimental.is_suitable_varinfo( - model, varinfo; only_ddpl + model, varinfo; only_dppl ) if !init_issuccess @debug "Initialisation with typed varinfo failed with the following issues:" diff --git a/src/experimental.jl b/src/experimental.jl index 974912957..8c82dca68 100644 --- a/src/experimental.jl +++ b/src/experimental.jl @@ -16,7 +16,7 @@ Check if the `model` supports evaluation using the provided `varinfo`. - `varinfo`: The varinfo to verify the support for. # Keyword Arguments -- `only_ddpl`: If `true`, only consider error reports occuring in the tilde pipeline. Default: `true`. +- `only_dppl`: If `true`, only consider error reports occuring in the tilde pipeline. Default: `true`. # Returns - `issuccess`: `true` if the model supports the varinfo, otherwise `false`. @@ -28,7 +28,7 @@ function is_suitable_varinfo end function _determine_varinfo_jet end """ - determine_suitable_varinfo(model; only_ddpl::Bool=true) + determine_suitable_varinfo(model; only_dppl::Bool=true) Return a suitable varinfo for the given `model`. @@ -42,7 +42,7 @@ See also: [`DynamicPPL.Experimental.is_suitable_varinfo`](@ref). - `model`: The model for which to determine the varinfo. # Keyword Arguments -- `only_ddpl`: If `true`, only consider error reports within DynamicPPL.jl. +- `only_dppl`: If `true`, only consider error reports within DynamicPPL.jl. # Examples @@ -83,10 +83,10 @@ julia> vi isa typeof(DynamicPPL.typed_varinfo(model_with_static_support())) true ``` """ -function determine_suitable_varinfo(model::DynamicPPL.Model; only_ddpl::Bool=true) +function determine_suitable_varinfo(model::DynamicPPL.Model; only_dppl::Bool=true) # If JET.jl has been loaded, and thus `determine_varinfo` has been defined, we use that. return if Base.get_extension(DynamicPPL, :DynamicPPLJETExt) !== nothing - _determine_varinfo_jet(model; only_ddpl) + _determine_varinfo_jet(model; only_dppl) else # Warn the user. @warn "JET.jl is not loaded. Assumes the model is compatible with typed varinfo." diff --git a/test/ext/DynamicPPLJETExt.jl b/test/ext/DynamicPPLJETExt.jl index 8ed29e0c7..c74beefdb 100644 --- a/test/ext/DynamicPPLJETExt.jl +++ b/test/ext/DynamicPPLJETExt.jl @@ -56,7 +56,7 @@ DynamicPPL.NTVarInfo # Should fail if we're including errors in the model body. @test DynamicPPL.Experimental.determine_suitable_varinfo( - demo5(); only_ddpl=false + demo5(); only_dppl=false ) isa DynamicPPL.UntypedVarInfo end