From 19845576bbe294bcd4c3a49459ad8bf43dac41aa Mon Sep 17 00:00:00 2001 From: Tor Erlend Fjelde Date: Mon, 13 Mar 2023 22:31:54 +0000 Subject: [PATCH 1/4] remove an overly specialized default bundle_sample --- src/interface.jl | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/interface.jl b/src/interface.jl index eaecb492..39e1843e 100644 --- a/src/interface.jl +++ b/src/interface.jl @@ -35,14 +35,6 @@ function bundle_samples( return samples end -function bundle_samples( - samples::Vector, ::AbstractModel, ::AbstractSampler, ::Any, ::Type{Vector{T}}; kwargs... -) where {T} - return map(samples) do sample - convert(T, sample) - end -end - """ step(rng, model, sampler[, state; kwargs...]) From f91067c4bed3aabb5466e26d0cfb089e93f62a9a Mon Sep 17 00:00:00 2001 From: Tor Erlend Fjelde Date: Mon, 13 Mar 2023 22:32:24 +0000 Subject: [PATCH 2/4] bump minor version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 40494911..8382775b 100644 --- a/Project.toml +++ b/Project.toml @@ -3,7 +3,7 @@ uuid = "80f14c24-f653-4e6a-9b94-39d6b0f70001" keywords = ["markov chain monte carlo", "probablistic programming"] license = "MIT" desc = "A lightweight interface for common MCMC methods." -version = "4.4.0" +version = "4.5.0" [deps] BangBang = "198e06fe-97b7-11e9-32a5-e1d131e6ad66" From 5a6fffc1c37a59a2f4e396f6633dce9a81160fb0 Mon Sep 17 00:00:00 2001 From: Tor Erlend Fjelde Date: Mon, 13 Mar 2023 22:44:36 +0000 Subject: [PATCH 3/4] removed no longer relevant test --- test/sample.jl | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/test/sample.jl b/test/sample.jl index fcd3ab13..fa2bb3bc 100644 --- a/test/sample.jl +++ b/test/sample.jl @@ -553,21 +553,6 @@ @test all(chain[i].b == ref_chain[i].b for i in 1:N) end - @testset "Sample vector of `NamedTuple`s" begin - chain = sample(MyModel(), MySampler(), 1_000; chain_type=Vector{NamedTuple}) - # Check output type - @test chain isa Vector{<:NamedTuple} - @test length(chain) == 1_000 - @test all(keys(x) == (:a, :b) for x in chain) - - # Check some statistical properties - @test ismissing(chain[1].a) - @test mean(x.a for x in view(chain, 2:1_000)) ≈ 0.5 atol = 6e-2 - @test var(x.a for x in view(chain, 2:1_000)) ≈ 1 / 12 atol = 1e-2 - @test mean(x.b for x in chain) ≈ 0 atol = 0.1 - @test var(x.b for x in chain) ≈ 1 atol = 0.15 - end - @testset "Testing callbacks" begin function count_iterations( rng, model, sampler, sample, state, i; iter_array, kwargs... From 216488fd863f6bc3abb4b12f7336d103be372db7 Mon Sep 17 00:00:00 2001 From: Tor Erlend Fjelde Date: Mon, 13 Mar 2023 22:44:58 +0000 Subject: [PATCH 4/4] removed no longer relevant piece of code --- test/utils.jl | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/utils.jl b/test/utils.jl index f69fcdab..8e4a36c3 100644 --- a/test/utils.jl +++ b/test/utils.jl @@ -79,9 +79,6 @@ function AbstractMCMC.chainscat( return vcat(chain, chains...) end -# Conversion to NamedTuple -Base.convert(::Type{NamedTuple}, x::MySample) = (a=x.a, b=x.b) - # Gaussian log density (without additive constants) # Without LogDensityProblems.jl interface mylogdensity(x) = -sum(abs2, x) / 2