Open
Description
I think it would be reasonable to expect that collect(keys(vi))
would return a vector VarName
s, 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}:
0
Maybe more commonly, empty SimpleVarInfo
s 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