Skip to content

Commit 8813dd7

Browse files
committed
Add changelog entry for prefixing
1 parent 0e2aae8 commit 8813dd7

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

HISTORY.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,39 @@
11
# DynamicPPL Changelog
22

3+
## 0.36.0
4+
5+
**Breaking changes**
6+
7+
### VarName prefixing behaviour
8+
9+
Previously, a prefixed varname would concatenate its prefixes with the symbol.
10+
Now, a prefixed varname creates a new field on the prefix.
11+
This is rather abstract, so it's best explained through an example.
12+
Consider this model and submodel:
13+
14+
```julia
15+
using DynamicPPL, Distributions
16+
@model inner() = x ~ Normal()
17+
@model outer() = a ~ to_submodel(inner())
18+
```
19+
20+
In previous versions, the inner variable `x` would be saved as `a.x`.
21+
However, this was represented as a single symbol `Symbol("a.x")`:
22+
23+
```julia
24+
julia> dump(keys(VarInfo(outer()))[1])
25+
VarName{Symbol("a.x"), typeof(identity)}
26+
optic: identity (function of type typeof(identity))
27+
```
28+
29+
Now, the inner variable is stored as a field `x` on the VarName `a`:
30+
31+
```julia
32+
julia> dump(keys(VarInfo(outer()))[1])
33+
VarName{:a, Accessors.PropertyLens{:x}}
34+
optic: Accessors.PropertyLens{:x} (@o _.x)
35+
```
36+
337
## 0.35.5
438

539
Several internal methods have been removed:

0 commit comments

Comments
 (0)