Skip to content

Commit 1091986

Browse files
committed
Fix a bug
1 parent 756cc25 commit 1091986

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/varinfo.jl

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Let `md` be an instance of `Metadata`:
2020
- `md.dists[md.idcs[vn]]` is the distribution of `vn`.
2121
- `md.ranges[md.idcs[vn]]` is the index range of `vn` in `md.vals`.
2222
- `md.vals[md.ranges[md.idcs[vn]]]` is the vector of values of corresponding to `vn`.
23-
- `md.trans` is a Bitvector of true/false flags for whether a variable has been transformed.
23+
- `md.trans` is a BitVector of true/false flags for whether a variable has been transformed.
2424
`md.trans[md.idcs[vn]]` is the value of `trans` corresponding to `vn`.
2525
2626
To make `md::Metadata` type stable, all the `md.vns` must have the same symbol
@@ -1663,14 +1663,7 @@ function BangBang.push!!(vi::VarInfo, vn::VarName, r, dist::Distribution)
16631663
if vi isa NTVarInfo && ~haskey(vi.metadata, sym)
16641664
# The NamedTuple doesn't have an entry for this variable, let's add one.
16651665
val = tovec(r)
1666-
md = Metadata(
1667-
Dict(vn => 1),
1668-
[vn],
1669-
[1:length(val)],
1670-
val,
1671-
[dist],
1672-
Dict{String,BitVector}("trans" => [false]),
1673-
)
1666+
md = Metadata(Dict(vn => 1), [vn], [1:length(val)], val, [dist], BitVector([false]))
16741667
vi = Accessors.@set vi.metadata[sym] = md
16751668
else
16761669
meta = getmetadata(vi, vn)

0 commit comments

Comments
 (0)