-
Notifications
You must be signed in to change notification settings - Fork 36
Closed
Description
I think it would be reasonable to expect that collect(keys(vi)) would return a vector VarNames, but this is not always true for SimpleVarInfo. You can, in fact, make the key type be whatever you want:
julia> collect(keys(DynamicPPL.SimpleVarInfo(OrderedDict(0 => 1))))
1-element Vector{Int64}:
0Maybe more commonly, empty SimpleVarInfos are trouble:
julia> collect(keys(DynamicPPL.SimpleVarInfo(OrderedDict())))
Any[]
julia> collect(keys(DynamicPPL.SimpleVarInfo()))
Union{}[]See https://github.com/TuringLang/DynamicPPL.jl/pull/780/files#r1928908281
We could just fix keys, but I wonder, as @penelopeysm says in the above comment, whether we should put more strict bounds on the values field.
Metadata
Metadata
Assignees
Labels
No labels