Skip to content

keys(vnt) should not recurse into PartialArrays if... #1257

@penelopeysm

Description

@penelopeysm

... all(pa.mask) is true AND it doesn't contain ALBs/nested PAs/nested VNTs) AND it isn't a GrowableArray

In other words:

julia> using DynamicPPL

julia> vnt = @vnt begin
           @template x = zeros(2)
           x[1] := 1.0
           x[2] := 2.0
       end
VarNamedTuple
└─ x => PartialArray size=(2,) data::Vector{Float64}
        ├─ (1,) => 1.0
        └─ (2,) => 2.0

julia> keys(vnt)
2-element Vector{VarName}:
 x[1]
 x[2]

The final call should return x rather than x[1] and x[2].

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions