Skip to content

Commit cee3108

Browse files
committed
Remove @submodel
1 parent b4830e0 commit cee3108

File tree

6 files changed

+4
-356
lines changed

6 files changed

+4
-356
lines changed

HISTORY.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
**Breaking changes**
66

7+
### Submodel macro
8+
9+
The `@submodel` macro is fully removed; please use `to_submodel` instead.
10+
711
### Accumulators
812

913
This release overhauls how VarInfo objects track variables such as the log joint probability. The new approach is to use what we call accumulators: Objects that the VarInfo carries on it that may change their state at each `tilde_assume!!` and `tilde_observe!!` call based on the value of the variable in question. They replace both variables that were previously hard-coded in the `VarInfo` object (`logp` and `num_produce`) and some contexts. This brings with it a number of breaking changes:

docs/src/api.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,6 @@ to_submodel
146146

147147
Note that a `[to_submodel](@ref)` is only sampleable; one cannot compute `logpdf` for its realizations.
148148

149-
In the past, one would instead embed sub-models using [`@submodel`](@ref), which has been deprecated since the introduction of [`to_submodel(model)`](@ref)
150-
151-
```@docs
152-
@submodel
153-
```
154-
155149
In the context of including models within models, it's also useful to prefix the variables in sub-models to avoid variable names clashing:
156150

157151
```@docs

src/DynamicPPL.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ export AbstractVarInfo,
128128
to_submodel,
129129
# Convenience macros
130130
@addlogprob!,
131-
@submodel,
132131
value_iterator_from_chain,
133132
check_model,
134133
check_model_and_trace,
@@ -187,7 +186,6 @@ include("simple_varinfo.jl")
187186
include("context_implementations.jl")
188187
include("compiler.jl")
189188
include("pointwise_logdensities.jl")
190-
include("submodel_macro.jl")
191189
include("transforming.jl")
192190
include("logdensityfunction.jl")
193191
include("model_utils.jl")

src/submodel_macro.jl

Lines changed: 0 additions & 290 deletions
This file was deleted.

test/deprecated.jl

Lines changed: 0 additions & 57 deletions
This file was deleted.

test/runtests.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ include("test_util.jl")
7272
include("context_implementations.jl")
7373
include("threadsafe.jl")
7474
include("debug_utils.jl")
75-
include("deprecated.jl")
7675
include("submodels.jl")
7776
include("bijector.jl")
7877
end

0 commit comments

Comments
 (0)