Skip to content

Commit ad48370

Browse files
committed
Replace _check_model with ordinary DynamicPPL.check_model
1 parent 6599cfa commit ad48370

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/mcmc/abstractmcmc.jl

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
# TODO: Implement additional checks for certain samplers, e.g.
2-
# HMC not supporting discrete parameters.
3-
function _check_model(model::DynamicPPL.Model)
4-
return DynamicPPL.check_model(model; error_on_failure=true)
5-
end
6-
function _check_model(model::DynamicPPL.Model, alg::InferenceAlgorithm)
7-
return _check_model(model)
8-
end
9-
101
#########################################
112
# Default definitions for the interface #
123
#########################################
@@ -25,7 +16,7 @@ function AbstractMCMC.sample(
2516
check_model::Bool=true,
2617
kwargs...,
2718
)
28-
check_model && _check_model(model, alg)
19+
check_model && DynamicPPL.check_model(model)
2920
return AbstractMCMC.sample(rng, model, Sampler(alg), N; kwargs...)
3021
end
3122

@@ -52,7 +43,7 @@ function AbstractMCMC.sample(
5243
check_model::Bool=true,
5344
kwargs...,
5445
)
55-
check_model && _check_model(model, alg)
46+
check_model && DynamicPPL.check_model(model)
5647
return AbstractMCMC.sample(rng, model, Sampler(alg), ensemble, N, n_chains; kwargs...)
5748
end
5849

0 commit comments

Comments
 (0)