-
Notifications
You must be signed in to change notification settings - Fork 36
[email protected] #970
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[email protected] #970
Changes from 3 commits
87d8e19
0d4cbba
2982129
62e1c78
67bb055
aaa1e8d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
# DynamicPPL Changelog | ||
|
||
## 0.36.14 | ||
|
||
Added compatibility with [email protected]. | ||
|
||
## 0.36.13 | ||
|
||
Added documentation for the `returned(::Model, ::MCMCChains.Chains)` method. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -356,13 +356,15 @@ function BangBang.setindex!!(vi::SimpleVarInfo, vals, vns::AbstractVector{<:VarN | |
return vi | ||
end | ||
|
||
function BangBang.setindex!!(vi::SimpleVarInfo{<:AbstractDict}, val, vn::VarName) | ||
function BangBang.setindex!!( | ||
vi::SimpleVarInfo{<:AbstractDict}, val, vn::VarName{sym} | ||
|
||
) where {sym} | ||
# For dictlike objects, we treat the entire `vn` as a _key_ to set. | ||
dict = values_as(vi) | ||
# Attempt to split into `parent` and `child` optic. | ||
parent, child, issuccess = splitoptic(getoptic(vn)) do optic | ||
o = optic === nothing ? identity : optic | ||
haskey(dict, VarName(vn, o)) | ||
haskey(dict, VarName{sym}(o)) | ||
end | ||
# When combined with `VarInfo`, `nothing` is equivalent to `identity`. | ||
keyoptic = parent === nothing ? identity : parent | ||
|
@@ -372,7 +374,7 @@ function BangBang.setindex!!(vi::SimpleVarInfo{<:AbstractDict}, val, vn::VarName | |
BangBang.setindex!!(dict, val, vn) | ||
else | ||
# Split exists ⟹ trying to set an existing key. | ||
vn_key = VarName(vn, keyoptic) | ||
vn_key = VarName{sym}(keyoptic) | ||
BangBang.setindex!!(dict, set!!(dict[vn_key], child, val), vn_key) | ||
end | ||
return Accessors.@set vi.values = dict_new | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See main PR comment for rationale (if interested). This is the only meaningful change in this PR, the rest is quite mundane