Skip to content

Commit 5ed1230

Browse files
committed
Fix for upstream removal of default_chain_type
1 parent 3a13c63 commit 5ed1230

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/mcmc/abstractmcmc.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ end
1212
# Default definitions for the interface #
1313
#########################################
1414

15+
const DEFAULT_CHAIN_TYPE = MCMCChains.Chains
16+
1517
function AbstractMCMC.sample(
1618
model::AbstractModel, alg::InferenceAlgorithm, N::Integer; kwargs...
1719
)
@@ -24,10 +26,11 @@ function AbstractMCMC.sample(
2426
alg::InferenceAlgorithm,
2527
N::Integer;
2628
check_model::Bool=true,
29+
chain_type=DEFAULT_CHAIN_TYPE,
2730
kwargs...,
2831
)
2932
check_model && _check_model(model, alg)
30-
return AbstractMCMC.sample(rng, model, Sampler(alg), N; kwargs...)
33+
return AbstractMCMC.sample(rng, model, Sampler(alg), N; chain_type, kwargs...)
3134
end
3235

3336
function AbstractMCMC.sample(
@@ -50,9 +53,12 @@ function AbstractMCMC.sample(
5053
ensemble::AbstractMCMC.AbstractMCMCEnsemble,
5154
N::Integer,
5255
n_chains::Integer;
56+
chain_type=DEFAULT_CHAIN_TYPE,
5357
check_model::Bool=true,
5458
kwargs...,
5559
)
5660
check_model && _check_model(model, alg)
57-
return AbstractMCMC.sample(rng, model, Sampler(alg), ensemble, N, n_chains; kwargs...)
61+
return AbstractMCMC.sample(
62+
rng, model, Sampler(alg), ensemble, N, n_chains; chain_type, kwargs...
63+
)
5864
end

0 commit comments

Comments
 (0)