diff --git a/ext/DynamicPPLMCMCChainsExt.jl b/ext/DynamicPPLMCMCChainsExt.jl index 5f62f4557..8c598a6a8 100644 --- a/ext/DynamicPPLMCMCChainsExt.jl +++ b/ext/DynamicPPLMCMCChainsExt.jl @@ -17,7 +17,11 @@ end # Load state from a `Chains`: By convention, it is stored in `:samplerstate` metadata function DynamicPPL.loadstate(chain::MCMCChains.Chains) if !haskey(chain.info, :samplerstate) - throw(ArgumentError("The chain object does not contain the final state of the sampler: Metadata `:samplerstate` missing.")) + throw( + ArgumentError( + "The chain object does not contain the final state of the sampler: Metadata `:samplerstate` missing.", + ), + ) end return chain.info[:samplerstate] end diff --git a/src/sampler.jl b/src/sampler.jl index 4b6ee7c78..7435413d7 100644 --- a/src/sampler.jl +++ b/src/sampler.jl @@ -87,10 +87,12 @@ function AbstractMCMC.sample( N::Integer; chain_type=default_chain_type(sampler), resume_from=nothing, - kwargs... + kwargs..., ) initial_state = loadstate(resume_from) - return AbstractMCMC.mcmcsample(rng, model, sampler, N; chain_type, initial_state, kwargs...) + return AbstractMCMC.mcmcsample( + rng, model, sampler, N; chain_type, initial_state, kwargs... + ) end # initial step: general interface for resuming and