Skip to content

Commit 5f0b381

Browse files
committed
[no ci] Improve emcee error message
1 parent e7e29ef commit 5f0b381

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/mcmc/emcee.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,11 @@ function AbstractMCMC.step(
5050

5151
# Update the parameters if provided.
5252
if initial_params !== nothing
53-
if !(initial_params isa AbstractVector && length(initial_params) == n)
54-
err_msg = "initial_params for `Emcee` must be a vector of initialisation strategies, with length equal to the number of walkers ($n)"
53+
if !(
54+
initial_params isa AbstractVector{<:DynamicPPL.AbstractInitStrategy} &&
55+
length(initial_params) == n
56+
)
57+
err_msg = "initial_params for `Emcee` must be a vector of `DynamicPPL.AbstractInitStrategy`, with length equal to the number of walkers ($n)"
5558
throw(ArgumentError(err_msg))
5659
end
5760
vis = map(vis, initial_params) do vi, strategy

0 commit comments

Comments
 (0)