Skip to content
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

MCMCChains.get_sections broken in 6.0.4 #446

Closed
sefffal opened this issue Dec 21, 2023 · 1 comment
Closed

MCMCChains.get_sections broken in 6.0.4 #446

sefffal opened this issue Dec 21, 2023 · 1 comment

Comments

@sefffal
Copy link

sefffal commented Dec 21, 2023

In the latest version of MCMCChains, the function MCMCChains.get_sections(chain) is broken.

julia> MCMCChains.get_sections(chain)
ERROR: ArgumentError: index Symbol[] not found
Stacktrace:
  [1] axisindexes
    @ AxisArrays ~/.julia/packages/AxisArrays/CtyI0/src/indexing.jl:329 [inlined]
  [2] axisindexes
    @ AxisArrays ~/.julia/packages/AxisArrays/CtyI0/src/indexing.jl:199 [inlined]
  [3] macro expansion
    @ AxisArrays ~/.julia/packages/AxisArrays/CtyI0/src/indexing.jl:394 [inlined]
  [4] _to_index(::AxisArrays.AxisArray{…}, ::Tuple{…}, ::Colon, ::Vector{…}, ::Colon)
    @ AxisArrays ~/.julia/packages/AxisArrays/CtyI0/src/indexing.jl:349
  [5] to_index
    @ AxisArrays ~/.julia/packages/AxisArrays/CtyI0/src/indexing.jl:347 [inlined]
  [6] getindex(::AxisArrays.AxisArray{Float64, 3, Array{…}, Tuple{…}}, ::Function, ::Vector{Symbol}, ::Function)
    @ AxisArrays ~/.julia/packages/AxisArrays/CtyI0/src/indexing.jl:123
  [7] Chains(chn::Chains{Float64, AxisArrays.AxisArray{…}, Missing, @NamedTuple{…}, @NamedTuple{…}}, sections::Tuple{Symbol})
    @ MCMCChains ~/.julia/packages/MCMCChains/AQENn/src/chains.jl:114
  [8] Chains(chn::Chains{Float64, AxisArrays.AxisArray{…}, Missing, @NamedTuple{…}, @NamedTuple{…}}, sections::Tuple{Symbol})
    @ MCMCChains ~/.julia/packages/MCMCChains/AQENn/src/chains.jl:104 [inlined]
  [9] #48
    @ ./none:0 [inlined]
 [10] iterate(g::Base.Generator, s::Vararg{Any})
    @ Base ./generator.jl:47 [inlined]
 [11] collect_to!(dest::Vector{Chains{…}}, itr::Base.Generator{Tuple{…}, MCMCChains.var"#48#49"{…}}, offs::Int64, st::Int64)
    @ Base ./array.jl:892
 [12] collect_to_with_first!(dest::Vector{…}, v1::Chains{…}, itr::Base.Generator{…}, st::Int64)
    @ Base ./array.jl:870
 [13] collect(itr::Base.Generator{Tuple{Symbol, Symbol}, MCMCChains.var"#48#49"{Chains{…}}})
    @ Base ./array.jl:844
 [14] get_sections
    @ MCMCChains ~/.julia/packages/MCMCChains/AQENn/src/chains.jl:549 [inlined]
 [15] get_sections(chains::Chains{Float64, AxisArrays.AxisArray{…}, Missing, @NamedTuple{…}, @NamedTuple{…}})
    @ MCMCChains ~/.julia/packages/MCMCChains/AQENn/src/chains.jl:549
 [16] top-level scope
    @ REPL[10]:1
Some type information was truncated. Use `show(err)` to see complete types.
@yebai
Copy link
Member

yebai commented May 23, 2024

The following example works on most recent release:

val = rand(500, 2, 3)
chn = Chains(val, [:a, :b])
MCMCChains.get_sections(chn)

@yebai yebai closed this as completed May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants