Skip to content

Implement to_varname_dict better #1134

@penelopeysm

Description

@penelopeysm

This is a very bad implementation that I did a while ago:

DynamicPPL.jl/src/utils.jl

Lines 851 to 854 in 08fffa2

# Convert (x=1,) to Dict(@varname(x) => 1)
function to_varname_dict(nt::NamedTuple)
return Dict{VarName,Any}(VarName{k}() => v for (k, v) in pairs(nt))
end

It should really make sure that at least the value type, and possibly the key type, is as concrete as possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions