Skip to content

Commit 281db62

Browse files
committed
Add support for StructArray
1 parent 7b80078 commit 281db62

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/structarray-connect.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using StructArrays
2+
3+
# A basic chains constructor that works with the Transition struct we defined.
4+
function bundle_samples(
5+
rng::AbstractRNG,
6+
model::DensityModel,
7+
s::Metropolis,
8+
N::Integer,
9+
ts::Vector{T},
10+
chain_type::Type{StructArray};
11+
param_names=missing,
12+
kwargs...
13+
) where {ModelType<:AbstractModel, T<:AbstractTransition}
14+
return StructArray(bundle_samples(rng, model, s, N, ts, NamedTuple; param_names=param_names, kwargs...))
15+
end

0 commit comments

Comments
 (0)