|
4 | 4 |
|
5 | 5 | **Breaking changes**
|
6 | 6 |
|
7 |
| -### VarInfo constructor |
| 7 | +### VarInfo constructors |
8 | 8 |
|
9 | 9 | `VarInfo(vi::VarInfo, values)` has been removed. You can replace this directly with `unflatten(vi, values)` instead.
|
10 | 10 |
|
| 11 | +The `metadata` argument to `VarInfo([rng, ]model[, sampler, context, metadata])` has been removed. |
| 12 | +If you were not using this argument (most likely), then there is no change needed. |
| 13 | +If you were using the `metadata` argument to specify a blank `VarNamedVector`, then you should replace calls to `VarInfo` with `DynamicPPL.typed_vector_varinfo` instead (see 'Other changes' below). |
| 14 | + |
| 15 | +The `UntypedVarInfo` constructor and type is no longer exported. |
| 16 | +If you needed to construct one, you should now use `DynamicPPL.untyped_varinfo` instead. |
| 17 | + |
| 18 | +The `TypedVarInfo` constructor and type is no longer exported. |
| 19 | +The _type_ has been replaced with `DynamicPPL.NTVarInfo`. |
| 20 | +The _constructor_ has been replaced with `DynamicPPL.typed_varinfo`. |
| 21 | + |
| 22 | +Note that the exact kind of VarInfo returned by `VarInfo(rng, model, ...)` is an implementation detail. |
| 23 | +Previously, it was guaranteed that this would always be a VarInfo whose metadata was a `NamedTuple` containing `Metadata` structs. |
| 24 | +Going forward, this is no longer the case, and you should only assume that the returned object obeys the `AbstractVarInfo` interface. |
| 25 | + |
11 | 26 | ### VarName prefixing behaviour
|
12 | 27 |
|
13 | 28 | The way in which VarNames in submodels are prefixed has been changed.
|
@@ -53,6 +68,20 @@ outer() | (a.x=1.0,)
|
53 | 68 | If you are sampling from a model with submodels, this doesn't affect the way you interact with the `MCMCChains.Chains` object, because VarNames are converted into Symbols when stored in the chain.
|
54 | 69 | (This behaviour will likely be changed in the future, in that Chains should be indexable by VarNames and not just Symbols, but that has not been implemented yet.)
|
55 | 70 |
|
| 71 | +**Other changes** |
| 72 | + |
| 73 | +While these are technically breaking, they are only internal changes and do not affect the public API. |
| 74 | +The following four functions have been added and/or reworked to make it easier to construct VarInfos with different types of metadata: |
| 75 | + |
| 76 | + 1. `DynamicPPL.untyped_varinfo([rng, ]model[, sampler, context])` |
| 77 | + 2. `DynamicPPL.typed_varinfo([rng, ]model[, sampler, context])` |
| 78 | + 3. `DynamicPPL.untyped_vector_varinfo([rng, ]model[, sampler, context])` |
| 79 | + 4. `DynamicPPL.typed_vector_varinfo([rng, ]model[, sampler, context])` |
| 80 | + |
| 81 | +The reason for this change is that there were several flavours of VarInfo. |
| 82 | +Some, like `typed_varinfo`, were easy to construct because we had convenience methods for them; however, the others were more difficult. |
| 83 | +This change makes it easier to access different VarInfo types, and also makes it more explicit which one you are constructing. |
| 84 | + |
56 | 85 | ## 0.35.5
|
57 | 86 |
|
58 | 87 | Several internal methods have been removed:
|
|
0 commit comments